From 8ed770d7e4c82fbebdb1b67ecaaaa8f75b8c0cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Gardini?= Date: Tue, 14 Jul 2026 21:59:24 -0300 Subject: [PATCH 001/249] Add Pydantic support (PydanticClassDeclaration) (#11243) ## Summary This branch adds Pydantic-oriented Python emitter support in `@typespec/emitter-framework` by aligning with the new APIs introduced in Alloy Python (`PydanticClassDeclaration`, richer `pydantic`/`typing`/`pydantic_settings` externals, and decorator ordering for class/static methods). ### What changed - Added a new emitter-framework wrapper: - `python/components/class-declaration/PydanticClassDeclaration` - Converts TypeSpec models to Pydantic classes (`BaseModel` default base) - Supports: - `modelConfig` (structured `ConfigDict(...)` generation) - `modelConfigExpression` (verbatim `model_config = ...` expression) - Expanded Python builtins used by emitter-framework: - `pydanticModule` (including validators/serializers, `ConfigDict`, `RootModel`, subpaths) - `typingModule` (additional annotation symbols) - `pydanticSettingsModule` (`BaseSettings`, `SettingsConfigDict`) - Added decorator support for typed class methods in emitter-framework: - `Method` now accepts `decorators?: Children[]` - Decorators render before intrinsic method decorators (`@classmethod` / `@staticmethod`) to support Pydantic validator stacking order. - Updated Python test harness externals: - includes Pydantic and settings modules in `externals`. - Added focused tests for new behavior: - `pydantic-class-declaration.test.tsx` - Covers pydantic model emission, `model_config`, validator ordering, and settings base usage. ## Validation - `@typespec/emitter-framework` build passes. - Focused Python tests related to this work pass (including new Pydantic tests and class method decorator ordering tests). --------- Co-authored-by: Cursor --- ...thon-pydantic-helpers-2026-7-14-16-15-0.md | 7 + .claude/settings.local.json | 16 ++ cspell.yaml | 1 + packages/emitter-framework/CHANGELOG.md | 3 - .../emitter-framework/src/python/builtins.ts | 3 + .../class-declaration/class-method.tsx | 29 ++- .../components/class-declaration/index.ts | 2 + .../pydantic-class-declaration.test.tsx | 147 +++++++++++ .../pydantic-class-declaration.tsx | 236 ++++++++++++++++++ .../pydantic-decorators.test.tsx | 112 +++++++++ .../class-declaration/pydantic-decorators.tsx | 66 +++++ .../src/python/test-utils.tsx | 2 + pnpm-lock.yaml | 8 +- 13 files changed, 618 insertions(+), 14 deletions(-) create mode 100644 .chronus/changes/add-python-pydantic-helpers-2026-7-14-16-15-0.md create mode 100644 .claude/settings.local.json create mode 100644 packages/emitter-framework/src/python/components/class-declaration/pydantic-class-declaration.test.tsx create mode 100644 packages/emitter-framework/src/python/components/class-declaration/pydantic-class-declaration.tsx create mode 100644 packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.test.tsx create mode 100644 packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.tsx diff --git a/.chronus/changes/add-python-pydantic-helpers-2026-7-14-16-15-0.md b/.chronus/changes/add-python-pydantic-helpers-2026-7-14-16-15-0.md new file mode 100644 index 00000000000..504a8e957cb --- /dev/null +++ b/.chronus/changes/add-python-pydantic-helpers-2026-7-14-16-15-0.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/emitter-framework" +--- + +Add Python Pydantic helpers to the emitter framework: `PydanticClassDeclaration`, `PydanticSettingsClassDeclaration`, and `PydanticRootModelDeclaration` components, along with `field_validator`, `model_validator`, `field_serializer`, and `computed_field` decorator helpers. diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000000..968b2b43b42 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,16 @@ +{ + "permissions": { + "allow": [ + "Bash(npx vitest *)", + "Bash(node -e \"const p=require\\('./packages/compiler/package.json'\\); console.log\\(JSON.stringify\\(p.exports['./testing'],null,2\\)\\); console.log\\('---main---'\\); console.log\\(JSON.stringify\\(p.exports['.'],null,2\\)\\)\")", + "Bash(node -e \"const p=require\\('./packages/compiler/package.json'\\); console.log\\('declared:', p.dependencies['vscode-languageserver']\\)\")", + "Bash(node -e \"const p=require\\('./node_modules/.pnpm/vscode-languageserver@9.0.1/node_modules/vscode-languageserver/package.json'\\); console.log\\(JSON.stringify\\(p.exports,null,2\\)\\)\")", + "Bash(npm run *)", + "Bash(node -e \"const p=require\\('./node_modules/.pnpm/lock'\\);\")", + "Bash(pnpm chronus *)", + "Bash(xargs cat)", + "Bash(npx prettier *)", + "Bash(pnpm run *)" + ] + } +} diff --git a/cspell.yaml b/cspell.yaml index 4efb8e61b94..2c26354c41f 100644 --- a/cspell.yaml +++ b/cspell.yaml @@ -218,6 +218,7 @@ words: - ptvsd - pwsh - pycache + - pydantic - pyexpat - pygen - pygments diff --git a/packages/emitter-framework/CHANGELOG.md b/packages/emitter-framework/CHANGELOG.md index c853fc76bc1..038ffe1a361 100644 --- a/packages/emitter-framework/CHANGELOG.md +++ b/packages/emitter-framework/CHANGELOG.md @@ -29,14 +29,12 @@ - [#9879](https://github.com/microsoft/typespec/pull/9879) Add the missing export in index for extensible-enum in csharp - ## 0.16.0 ### Bump dependencies - [#9446](https://github.com/microsoft/typespec/pull/9446) Upgrade dependencies - ## 0.15.0 ### Features @@ -49,7 +47,6 @@ - [#9202](https://github.com/microsoft/typespec/pull/9202) Update to alloy 0.22 - [#9223](https://github.com/microsoft/typespec/pull/9223) Upgrade dependencies - ## 0.14.0 No changes, version bump only. diff --git a/packages/emitter-framework/src/python/builtins.ts b/packages/emitter-framework/src/python/builtins.ts index 7fc20b4d539..b04fe804782 100644 --- a/packages/emitter-framework/src/python/builtins.ts +++ b/packages/emitter-framework/src/python/builtins.ts @@ -29,8 +29,10 @@ export const typingModule = createModule({ name: "typing", descriptor: { ".": [ + "Annotated", "Any", "Callable", + "ClassVar", "Generic", "Literal", "Never", @@ -38,6 +40,7 @@ export const typingModule = createModule({ "Protocol", "TypeAlias", "TypeVar", + "Union", ], }, }); diff --git a/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx b/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx index da717d79694..233ba5a9899 100644 --- a/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx +++ b/packages/emitter-framework/src/python/components/class-declaration/class-method.tsx @@ -1,4 +1,4 @@ -import { type Children, createContext, splitProps, useContext } from "@alloy-js/core"; +import { createContext, For, splitProps, useContext, type Children } from "@alloy-js/core"; import * as py from "@alloy-js/python"; import type { Operation } from "@typespec/compiler"; import { useTsp } from "../../../core/index.js"; @@ -15,11 +15,14 @@ export interface MethodPropsWithType extends Omit) { const explicit = (props as any).abstract as boolean | undefined; return explicit ?? (!isTypeSpecTyped ? false : undefined); })(); + const decorators = (props as { decorators?: Children[] }).decorators; + const decoratorsBlock = decorators ? ( + + {(decorator) => ( + <> + {decorator} + + + )} + + ) : undefined; /** * If the method does not come from the Typespec class declaration, return a standard Python method declaration. * Have in mind that, with that, we lose some of the TypeSpec class declaration overrides. */ if (!isTypeSpecTyped) { - return ; + const { decorators: _decorators, ...methodProps } = props; + return ( + <> + {decoratorsBlock} + + + ); } const [efProps, updateProps, forwardProps] = splitProps( props, - ["type"], + ["type", "decorators"], ["returnType", "parameters"], ); @@ -83,6 +103,7 @@ export function Method(props: Readonly) { return ( <> + {decoratorsBlock} { + it("creates a pydantic class from a model", async () => { + const { program, User } = await Tester.compile(t.code` + model ${t.model("User")} { + id: string; + } + `); + + expect(getOutput(program, [])).toRenderTo(` + from pydantic import BaseModel + + + class User(BaseModel): + id: str + + `); + }); + + it("emits model_config from structured modelConfig", async () => { + const { program, User } = await Tester.compile(t.code` + model ${t.model("User")} { + id: string; + } + `); + + expect( + getOutput(program, [ + , + ]), + ).toRenderTo(` + from pydantic import BaseModel + from pydantic import ConfigDict + + + class User(BaseModel): + model_config = ConfigDict(frozen=True, extra="forbid", validate_assignment=True) + id: str + + `); + }); + + it("places pydantic validator decorators above @classmethod", async () => { + const { program, stripName } = await Tester.compile( + t.code`@test op ${t.op("stripName")}(value: string): string;`, + ); + + expect( + getOutput(program, [ + + + , + ]), + ).toRenderTo(` + from pydantic import BaseModel + from pydantic import field_validator + + + class User(BaseModel): + @field_validator("name", mode="before") + @classmethod + def strip_name(cls, value: str) -> str: + pass + + + `); + }); + + it("supports BaseSettings via pydantic_settings module", async () => { + const { program } = await Tester.compile(``); + + expect( + getOutput(program, [ + , + ]), + ).toRenderTo(` + from pydantic_settings import BaseSettings + + + class AppSettings(BaseSettings): + pass + + `); + }); + + it("creates a settings class with SettingsConfigDict", async () => { + const { program } = await Tester.compile(``); + + expect( + getOutput(program, [ + , + ]), + ).toRenderTo(` + from pydantic_settings import BaseSettings + from pydantic_settings import SettingsConfigDict + + + class AppSettings(BaseSettings): + model_config = SettingsConfigDict(env_prefix="APP_", env_file=".env") + + + `); + }); + + it("creates a RootModel declaration from a root type", async () => { + const { program } = await Tester.compile(``); + + expect( + getOutput(program, [ + , + ]), + ).toRenderTo(` + from pydantic import RootModel + + + class TagList(RootModel[list[str]]): + pass + + `); + }); +}); diff --git a/packages/emitter-framework/src/python/components/class-declaration/pydantic-class-declaration.tsx b/packages/emitter-framework/src/python/components/class-declaration/pydantic-class-declaration.tsx new file mode 100644 index 00000000000..85bf3aa1d5a --- /dev/null +++ b/packages/emitter-framework/src/python/components/class-declaration/pydantic-class-declaration.tsx @@ -0,0 +1,236 @@ +import { code, For, type Children } from "@alloy-js/core"; +import * as py from "@alloy-js/python"; +import type { Model } from "@typespec/compiler"; +import { useTsp } from "../../../core/context/tsp-context.js"; +import { reportDiagnostic } from "../../../lib.js"; +import { declarationRefkeys } from "../../utils/refkey.js"; +import { DocElement } from "../doc-element/doc-element.js"; +import { ClassBases } from "./class-bases.js"; +import { ClassDeclaration } from "./class-declaration.js"; +import { ClassMember } from "./class-member.js"; +import { MethodProvider } from "./class-method.js"; + +export interface PydanticModelConfigDictProps { + arbitraryTypesAllowed?: boolean; + extra?: "allow" | "forbid" | "ignore"; + fromAttributes?: boolean; + frozen?: boolean; + populateByName?: boolean; + strStripWhitespace?: boolean; + strict?: boolean; + validateAssignment?: boolean; + validateDefault?: boolean; +} + +export interface PydanticSettingsConfigDictProps { + caseSensitive?: boolean; + envFile?: string; + envFileEncoding?: string; + envIgnoreEmpty?: boolean; + envNestedDelimiter?: string; + envPrefix?: string; +} + +export interface PydanticClassDeclarationBaseProps extends Omit { + name: string; + modelConfig?: PydanticModelConfigDictProps; + modelConfigExpression?: Children; +} + +export interface PydanticClassDeclarationPropsWithType extends Omit< + PydanticClassDeclarationBaseProps, + "name" +> { + type: Model; + name?: string; + methodType?: "method" | "class" | "static"; +} + +export type PydanticClassDeclarationProps = + | PydanticClassDeclarationPropsWithType + | PydanticClassDeclarationBaseProps; + +function isTypedPydanticClassDeclarationProps( + props: PydanticClassDeclarationProps, +): props is PydanticClassDeclarationPropsWithType { + return "type" in props; +} + +/** + * Converts TypeSpec Models to Pydantic classes. + */ +export function PydanticClassDeclaration(props: PydanticClassDeclarationProps) { + const { $ } = useTsp(); + const configEntries: Array<[string, unknown]> = []; + if (props.modelConfig && props.modelConfigExpression === undefined) { + for (const key of Object.keys(props.modelConfig)) { + const value = (props.modelConfig as Record)[key]; + if (value !== undefined) { + configEntries.push([toSnakeCase(key), value]); + } + } + } + const hasStructuredModelConfig = + props.modelConfigExpression === undefined && configEntries.length > 0; + const hasExpressionModelConfig = props.modelConfigExpression !== undefined; + const configLine = hasExpressionModelConfig ? ( + <> + {"model_config = "} + {props.modelConfigExpression} + + + ) : hasStructuredModelConfig ? ( + <> + {"model_config = "} + {py.pydanticModule["."].ConfigDict} + {"("} + + {([k, v]) => ( + <> + {k}= + + )} + + {")"} + + + ) : undefined; + + if (!isTypedPydanticClassDeclarationProps(props)) { + return ( + + {configLine} + {props.children} + + ); + } + + const docSource = props.doc ?? $.type.getDoc(props.type); + const docElement = docSource ? : undefined; + const namePolicy = py.usePythonNamePolicy(); + + let name = props.name ?? props.type.name; + if (!name) { + reportDiagnostic($.program, { code: "type-declaration-missing-name", target: props.type }); + } + name = namePolicy.getName(name, "class"); + + // Pydantic models currently don't support anonymous additional properties. + const additionalPropsRecord = $.model.getAdditionalPropertiesRecord(props.type); + if (additionalPropsRecord) { + throw new Error("Models with additional properties (Record[…]) are not supported"); + } + const modelMembers = Array.from($.model.getProperties(props.type).values()); + + const refkeys = declarationRefkeys(props.refkey, props.type); + + const bases = ClassBases({ + type: props.type, + bases: props.bases, + }); + const resolvedBases = + props.bases === undefined && bases.length === 0 ? [py.pydanticModule["."].BaseModel] : bases; + + return ( + + + {configLine} + + {(typeMember) => } + + {/* Allow callers to append custom class content after generated members. */} + <>{props.children} + + + ); +} + +type PydanticSettingsClassDeclarationBaseProps = Omit< + PydanticClassDeclarationBaseProps, + "bases" | "modelConfig" | "modelConfigExpression" +>; + +type PydanticSettingsClassDeclarationPropsWithType = Omit< + PydanticClassDeclarationPropsWithType, + "bases" | "modelConfig" | "modelConfigExpression" +>; + +export type PydanticSettingsClassDeclarationProps = + | (PydanticSettingsClassDeclarationBaseProps & { + settingsConfig?: PydanticSettingsConfigDictProps; + settingsConfigExpression?: Children; + }) + | (PydanticSettingsClassDeclarationPropsWithType & { + settingsConfig?: PydanticSettingsConfigDictProps; + settingsConfigExpression?: Children; + }); + +/** + * Convenience wrapper for classes that inherit from pydantic-settings BaseSettings. + */ +export function PydanticSettingsClassDeclaration(props: PydanticSettingsClassDeclarationProps) { + const { settingsConfig, settingsConfigExpression, ...classProps } = props; + const configEntries: Array<[string, unknown]> = []; + if (settingsConfig && settingsConfigExpression === undefined) { + for (const key of Object.keys(settingsConfig)) { + const value = (settingsConfig as Record)[key]; + if (value !== undefined) { + configEntries.push([toSnakeCase(key), value]); + } + } + } + + const hasStructuredConfig = settingsConfigExpression === undefined && configEntries.length > 0; + const hasExpressionConfig = settingsConfigExpression !== undefined; + + const modelConfigExpression = hasExpressionConfig ? ( + settingsConfigExpression + ) : hasStructuredConfig ? ( + <> + {py.pydanticSettingsModule["."].SettingsConfigDict} + {"("} + + {([k, v]) => ( + <> + {k}= + + )} + + {")"} + + ) : undefined; + + return ( + + ); +} + +export interface PydanticRootModelDeclarationProps extends Omit { + rootType: Children; +} + +/** + * Convenience wrapper for pydantic RootModel[T] declarations. + */ +export function PydanticRootModelDeclaration(props: PydanticRootModelDeclarationProps) { + const { rootType, ...classProps } = props; + return ( + + ); +} + +function toSnakeCase(value: string): string { + return value.replaceAll(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase(); +} diff --git a/packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.test.tsx b/packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.test.tsx new file mode 100644 index 00000000000..0f52e60dada --- /dev/null +++ b/packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.test.tsx @@ -0,0 +1,112 @@ +import { Tester } from "#test/test-host.js"; +import { t } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { getOutput } from "../../test-utils.js"; +import { Method } from "./class-method.js"; +import { PydanticClassDeclaration } from "./pydantic-class-declaration.js"; +import { + computedFieldDecorator, + fieldSerializerDecorator, + fieldValidatorDecorator, + modelValidatorDecorator, +} from "./pydantic-decorators.js"; + +describe("Python pydantic decorator helpers", () => { + it("builds @field_validator decorator with mode", async () => { + const { program, normalizeName } = await Tester.compile( + t.code`@test op ${t.op("normalizeName")}(value: string): string;`, + ); + + expect( + getOutput(program, [ + + + , + ]), + ).toRenderTo(` + from pydantic import BaseModel + from pydantic import field_validator + + + class User(BaseModel): + @field_validator("name", mode="before") + @classmethod + def normalize_name(cls, value: str) -> str: + pass + + + `); + }); + + it("builds @model_validator decorator for class methods", async () => { + const { program, checkModel } = await Tester.compile( + t.code`@test op ${t.op("checkModel")}(value: string): string;`, + ); + + expect( + getOutput(program, [ + + + , + ]), + ).toRenderTo(` + from pydantic import BaseModel + from pydantic import model_validator + + + class User(BaseModel): + @model_validator(mode="after") + @classmethod + def check_model(cls, value: str) -> str: + pass + + + `); + }); + + it("builds serializer and computed field decorators", async () => { + const { program } = await Tester.compile(``); + + expect( + getOutput(program, [ + + + + , + ]), + ).toRenderTo(` + from pydantic import BaseModel + from pydantic import computed_field + from pydantic import field_serializer + + + class User(BaseModel): + @field_serializer("name", when_used="json") + def serialize_name(self) -> str: + pass + @computed_field + def display_name(self) -> str: + pass + + + `); + }); +}); diff --git a/packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.tsx b/packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.tsx new file mode 100644 index 00000000000..3663203debc --- /dev/null +++ b/packages/emitter-framework/src/python/components/class-declaration/pydantic-decorators.tsx @@ -0,0 +1,66 @@ +import { code, type Children } from "@alloy-js/core"; +import * as py from "@alloy-js/python"; + +export type PydanticValidationMode = "before" | "after" | "plain" | "wrap"; + +export interface PydanticFieldValidatorOptions { + mode?: PydanticValidationMode; + checkFields?: boolean; +} + +export interface PydanticModelValidatorOptions { + mode?: Exclude; +} + +export interface PydanticFieldSerializerOptions { + mode?: "plain" | "wrap"; + returnType?: string; + whenUsed?: "always" | "unless-none" | "json" | "json-unless-none"; +} + +/** + * Build a `@field_validator(...)` decorator for method `decorators`. + */ +export function fieldValidatorDecorator( + fields: string | string[], + options: PydanticFieldValidatorOptions = {}, +): Children { + const values = Array.isArray(fields) ? fields : [fields]; + const args = values.map((x) => JSON.stringify(x)); + if (options.mode !== undefined) args.push(`mode=${JSON.stringify(options.mode)}`); + if (options.checkFields !== undefined) args.push(`check_fields=${options.checkFields}`); + + return code`@${py.pydanticModule["."].field_validator}(${args.join(", ")})`; +} + +/** + * Build a `@model_validator(...)` decorator for method `decorators`. + */ +export function modelValidatorDecorator(options: PydanticModelValidatorOptions = {}): Children { + const args: string[] = []; + if (options.mode !== undefined) args.push(`mode=${JSON.stringify(options.mode)}`); + return code`@${py.pydanticModule["."].model_validator}(${args.join(", ")})`; +} + +/** + * Build a `@field_serializer(...)` decorator for method `decorators`. + */ +export function fieldSerializerDecorator( + fields: string | string[], + options: PydanticFieldSerializerOptions = {}, +): Children { + const values = Array.isArray(fields) ? fields : [fields]; + const args = values.map((x) => JSON.stringify(x)); + if (options.mode !== undefined) args.push(`mode=${JSON.stringify(options.mode)}`); + if (options.returnType !== undefined) args.push(`return_type=${options.returnType}`); + if (options.whenUsed !== undefined) args.push(`when_used=${JSON.stringify(options.whenUsed)}`); + + return code`@${py.pydanticModule["."].field_serializer}(${args.join(", ")})`; +} + +/** + * Build a `@computed_field` decorator for method `decorators`. + */ +export function computedFieldDecorator(): Children { + return code`@${py.pydanticModule["."].computed_field}`; +} diff --git a/packages/emitter-framework/src/python/test-utils.tsx b/packages/emitter-framework/src/python/test-utils.tsx index c94e9f66dfd..21ba85af158 100644 --- a/packages/emitter-framework/src/python/test-utils.tsx +++ b/packages/emitter-framework/src/python/test-utils.tsx @@ -18,6 +18,8 @@ export function getOutput(program: Program, children: Children[]): Children { abcModule, datetimeModule, decimalModule, + py.pydanticModule, + py.pydanticSettingsModule, typingModule, py.abcModule, py.dataclassesModule, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 923a402e4c6..f5c3765a928 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9080,10 +9080,6 @@ packages: resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==} engines: {node: '>=0.3.1'} - diff@9.0.0: - resolution: {integrity: sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==} - engines: {node: '>=0.3.1'} - dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -16950,7 +16946,7 @@ snapshots: '@rushstack/rig-package': 0.7.3 '@rushstack/terminal': 0.24.0(@types/node@26.0.0) '@rushstack/ts-command-line': 5.3.10(@types/node@26.0.0) - diff: 9.0.0 + diff: 8.0.4 minimatch: 10.2.3 resolve: 1.22.12 semver: 7.7.4 @@ -21668,8 +21664,6 @@ snapshots: diff@8.0.4: {} - diff@9.0.0: {} - dir-glob@3.0.1: dependencies: path-type: 4.0.0 From ca92ba3d1f05317a04afb1c2ca8dcdcaa15527f1 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Tue, 14 Jul 2026 21:34:32 -0700 Subject: [PATCH 002/249] [python] release new version (#11252) Co-authored-by: Yuchao Yan --- ...x-model-base-docstrings-2026-7-8-14-9-0.md | 7 - ...-mode-none-constructor-2026-7-10-9-46-0.md | 7 - ...eddict-constant-enum-literal-2026-07-08.md | 7 - packages/http-client-python/CHANGELOG.md | 9 + packages/http-client-python/package-lock.json | 1751 ++++------------- packages/http-client-python/package.json | 66 +- 6 files changed, 464 insertions(+), 1383 deletions(-) delete mode 100644 .chronus/changes/fix-model-base-docstrings-2026-7-8-14-9-0.md delete mode 100644 .chronus/changes/fix-models-mode-none-constructor-2026-7-10-9-46-0.md delete mode 100644 .chronus/changes/fix-typeddict-constant-enum-literal-2026-07-08.md diff --git a/.chronus/changes/fix-model-base-docstrings-2026-7-8-14-9-0.md b/.chronus/changes/fix-model-base-docstrings-2026-7-8-14-9-0.md deleted file mode 100644 index a4e55282507..00000000000 --- a/.chronus/changes/fix-model-base-docstrings-2026-7-8-14-9-0.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-python" ---- - -Clarify docstrings in the generated `_MyMutableMapping` base class in `_model_base.py` so they no longer use the ambiguous `D` placeholder (e.g. `Remove all items from D.` is now `Remove all items from the dictionary.`) diff --git a/.chronus/changes/fix-models-mode-none-constructor-2026-7-10-9-46-0.md b/.chronus/changes/fix-models-mode-none-constructor-2026-7-10-9-46-0.md deleted file mode 100644 index 099a85bb66d..00000000000 --- a/.chronus/changes/fix-models-mode-none-constructor-2026-7-10-9-46-0.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-python" ---- - -Fix crash when generating with `models-mode=none`. Options passed to the `OptionsDict` constructor are now normalized through the same validation/transform path as `__setitem__`, so `models-mode=none` is correctly treated as falsy and a modelless client is produced instead of crashing. diff --git a/.chronus/changes/fix-typeddict-constant-enum-literal-2026-07-08.md b/.chronus/changes/fix-typeddict-constant-enum-literal-2026-07-08.md deleted file mode 100644 index a91b5185109..00000000000 --- a/.chronus/changes/fix-typeddict-constant-enum-literal-2026-07-08.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-client-python" ---- - -Fix constant enum values referencing the nonexistent `_enums` module in `models-mode: typeddict`. In typeddict mode enums are emitted as `Literal` aliases in `types.py` and `_enums.py` is never generated, so a single constant enum value now annotates with its literal value (e.g. `Literal["red"]`) and no longer imports from `_enums`. diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md index 6b8b78c06dc..a0fb2874c00 100644 --- a/packages/http-client-python/CHANGELOG.md +++ b/packages/http-client-python/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log - @typespec/http-client-python +## 0.34.2 + +### Bug Fixes + +- [#11216](https://github.com/microsoft/typespec/pull/11216) Clarify docstrings in the generated `_MyMutableMapping` base class in `_model_base.py` so they no longer use the ambiguous `D` placeholder (e.g. `Remove all items from D.` is now `Remove all items from the dictionary.`) +- [#11229](https://github.com/microsoft/typespec/pull/11229) Fix crash when generating with `models-mode=none`. Options passed to the `OptionsDict` constructor are now normalized through the same validation/transform path as `__setitem__`, so `models-mode=none` is correctly treated as falsy and a modelless client is produced instead of crashing. +- [#11212](https://github.com/microsoft/typespec/pull/11212) Fix constant enum values referencing the nonexistent `_enums` module in `models-mode: typeddict`. In typeddict mode enums are emitted as `Literal` aliases in `types.py` and `_enums.py` is never generated, so a single constant enum value now annotates with its literal value (e.g. `Literal["red"]`) and no longer imports from `_enums`. + + ## 0.34.1 ### Bug Fixes diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json index e3197d5be9a..24fce49d063 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.34.0", + "version": "0.34.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-python", - "version": "0.34.0", + "version": "0.34.2", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -17,27 +17,27 @@ "tsx": "^4.21.0" }, "devDependencies": { - "@azure-tools/azure-http-specs": "0.1.0-alpha.42", - "@azure-tools/typespec-autorest": "~0.69.1", - "@azure-tools/typespec-azure-core": "~0.69.0", - "@azure-tools/typespec-azure-resource-manager": "~0.69.1", - "@azure-tools/typespec-azure-rulesets": "~0.69.1", - "@azure-tools/typespec-client-generator-core": "~0.69.1", + "@azure-tools/azure-http-specs": "0.1.0-alpha.43", + "@azure-tools/typespec-autorest": "~0.70.0", + "@azure-tools/typespec-azure-core": "~0.70.0", + "@azure-tools/typespec-azure-resource-manager": "~0.70.0", + "@azure-tools/typespec-azure-rulesets": "~0.70.0", + "@azure-tools/typespec-client-generator-core": "~0.70.0", "@types/js-yaml": "~4.0.5", "@types/node": "~25.0.2", "@types/semver": "7.5.8", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "~0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/http-specs": "0.1.0-alpha.39-dev.2", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "~0.83.0", - "@typespec/spec-api": "0.1.0-alpha.14", - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/sse": "~0.83.0", - "@typespec/streams": "~0.83.0", - "@typespec/versioning": "~0.83.0", - "@typespec/xml": "~0.83.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "~0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/http-specs": "0.1.0-alpha.39", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "~0.84.0", + "@typespec/spec-api": "0.1.0-alpha.15", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/sse": "~0.84.0", + "@typespec/streams": "~0.84.0", + "@typespec/versioning": "~0.84.0", + "@typespec/xml": "~0.84.0", "c8": "^10.1.3", "picocolors": "~1.1.1", "rimraf": "~6.1.2", @@ -49,63 +49,66 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.1 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": ">=0.83.0 <1.0.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/sse": ">=0.83.0 <1.0.0", - "@typespec/streams": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.70.0 <1.0.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": ">=0.84.0 <1.0.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": ">=0.84.0 <1.0.0", + "@typespec/sse": ">=0.84.0 <1.0.0", + "@typespec/streams": ">=0.84.0 <1.0.0", + "@typespec/versioning": ">=0.84.0 <1.0.0", + "@typespec/xml": ">=0.84.0 <1.0.0" } }, "node_modules/@azure-tools/azure-http-specs": { - "version": "0.1.0-alpha.42", - "resolved": "https://registry.npmjs.org/@azure-tools/azure-http-specs/-/azure-http-specs-0.1.0-alpha.42.tgz", - "integrity": "sha512-vQOAepoGK1lSc9ohAub+NM1MiLJS5swIA5Ya3TTIJ4KkD1x6j5msdSRMgNgb0rmux/WWrKTRtsFDAiOF1Z0HKg==", + "version": "0.1.0-alpha.43", + "resolved": "https://registry.npmjs.org/@azure-tools/azure-http-specs/-/azure-http-specs-0.1.0-alpha.43.tgz", + "integrity": "sha512-5FTIh21iGlMtVkQHZrbFPg7fIDYtIxjG1oYNbcxdirfQUm/XtWvCv8UAwr3OzEBrE1+YEC6c164x4+bINm5UHA==", "dev": true, "license": "MIT", "dependencies": { - "@typespec/spec-api": "^0.1.0-alpha.14", - "@typespec/spector": "^0.1.0-alpha.25" + "@typespec/spec-api": "^0.1.0-alpha.15", + "@typespec/spector": "^0.1.0-alpha.26" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.69.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.69.1.tgz", - "integrity": "sha512-nbAsTagr4pyBO0ajlRnE5TW4tAXrYKFYSoWD+8bevXpe23bkVIJkDUJCZPSgWE7CBf3kxfw53lAb70a50oJmRA==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.70.0.tgz", + "integrity": "sha512-OaxLkgMcuOXAbaqTNpezmFF24jtkiIH1+2PBwAeRo3ZG7C1r7Hf8xZwCK6KVtBEgMbqnrd5eCqxsPl1zy3y9/Q==", "dev": true, "license": "MIT", + "dependencies": { + "yaml": "^2.8.3" + }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.1", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/xml": { @@ -114,24 +117,24 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", - "integrity": "sha512-UNdPb/DgMvXqwWk9hb54QOAumCJ6u6GGy+bj3RIIT1Sht6FR9rIn8AQ/UQ7WtrhbJBoqvQo5dxtS565a9/VRZw==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", + "integrity": "sha512-8MojHWRtTLKycJJ98IMoXX/5b9tTo3F0d3Iu20OKoCsORnSDG2NfjOWHJVW63oxA2t8VTlqC6J8BDcnRihygQQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.69.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.69.1.tgz", - "integrity": "sha512-NF7fqmPwaQbywcxGhH+v9qPYtIrPRR5MncXmeml6Kf9WLeqQj0rJt76KZCsZ8zwj58ZVbTNFPKcjsTQ00yQupA==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.70.0.tgz", + "integrity": "sha512-hVrbbsOhU3EQ2yQTppCqsGQwY/HcVZPOINtFkoUo+PUVBmCFXyqLkTO4jvUbsp/LvJEwoQ8aEA8Y35f7VWT5uw==", "dev": true, "license": "MIT", "dependencies": { @@ -142,34 +145,34 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.69.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.69.1.tgz", - "integrity": "sha512-vRvO8MoO4dwHdOKCFUB0IZkwf5AFGW92PP+48GKDYSNVFA7mwKVlbAlRa0rU6yURsUppAT6BPEurtau3FR+N0Q==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.70.0.tgz", + "integrity": "sha512-Uxxl/18oryDwk2S+aYx6cIqiyjmoMeFDGmjuQ72a+aw6u8mZjgahMxNsY0ShvGLSchjsDqsVGaUlazXGXakVrw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.1", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.69.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.1.tgz", - "integrity": "sha512-v84ZTh9lffTyjUSfMzZMDPv+fHjXJO/LpYT+V73Zco9YL8fC6o7ou2hvSlWTnMW2KIIrymdM3AyXONxSIZUEBw==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", + "integrity": "sha512-8yxOYJfID3wp3FLQYNIa3kbmR5YLWjYtpB+i4u66quHTTQWWANHV1/o9f8xymAf+8fO9jbLo5tw1JerumxISWg==", "dev": true, "license": "MIT", "dependencies": { @@ -181,35 +184,35 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.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==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.2.0.tgz", + "integrity": "sha512-fNAjWnA/nZ2jz31kxR/AqRaUT8ewHBw/WuBIosK0moMy1C9e5ValbDfFdIxJzVOOYaYkV/b2F1S4H/aHiqfVQg==", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-auth": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz", - "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.11.0.tgz", + "integrity": "sha512-IUZydyTUkDnYdstOW9pFOOUQlBjAepK5teihDE3x6yxsPJs/hsAaaYpeGxdxrgtOiJbBKSjKW7MDk7AEhb4LRg==", "dev": true, "license": "MIT", "dependencies": { @@ -218,13 +221,13 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-client": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.10.1.tgz", - "integrity": "sha512-Nh5PhEOeY6PrnxNPsEHRr9eimxLwgLlpmguQaHKBinFYA/RU9+kOYVOQqOrTsCL+KSxrLLl1gD8Dk5BFW/7l/w==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.0.tgz", + "integrity": "sha512-JjQWO6akOck45PH/XBrxzsQGAiKrfFl4m5iggJ0ItMIz5omRufOXWpqCPpdjKN3vKDzlSUvFjaMb7Zwf0gvAdA==", "dev": true, "license": "MIT", "dependencies": { @@ -237,20 +240,20 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-http-compat": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.3.2.tgz", - "integrity": "sha512-Tf6ltdKzOJEgxZeWLCjMxrxbodB/ZeCbzzA1A2qHbhzAjzjHoBVSUeSl/baT/oHAxhc4qdqVaDKnc2+iE932gw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.5.0.tgz", + "integrity": "sha512-BoSmXPx2er1Ai+wKlDvj29jIQespCNBwEmKyZVHO2kEFsWbGjAjwMCGzug3DJM5/QYIV3vej0S1zcU5bq9fa8w==", "dev": true, "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.1.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" }, "peerDependencies": { "@azure/core-client": "^1.10.0", @@ -274,22 +277,22 @@ } }, "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==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.7.0.tgz", + "integrity": "sha512-7GEAoIsaoBr6KELNRb8nypowCqvk8dnCHFCYg4XD4lOQGY2GqjQg5IhkRjyBFRO18CGSMq05PaNqSOE9GQro3g==", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.23.0.tgz", - "integrity": "sha512-Evs1INHo+jUjwHi1T6SG6Ua/LHOQBCLuKEEE6efIpt4ZOoNonaT1kP32GoOcdNDbfqsD2445CPri3MubBy5DEQ==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", + "integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==", "dev": true, "license": "MIT", "dependencies": { @@ -302,26 +305,26 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-tracing": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.3.1.tgz", - "integrity": "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.4.0.tgz", + "integrity": "sha512-eGwxD0AtncrxeBM4tG8R55Pc3rdX1hNW2WibJAgYpCVA6E93mvvVH+LcssoVjOBrSKWS55yEIHsk0X8ctHmfOQ==", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-util": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.13.1.tgz", - "integrity": "sha512-XPArKLzsvl0Hf0CaGyKHUyVgF7oDnhKoP85Xv6M4StF/1AhfORhZudHtOyf2s+FcbuQ9dPRAjB8J2KvRRMUK2A==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.14.0.tgz", + "integrity": "sha512-9n2pWK61veAuN0V20t9lOuoV4CFMdyAZ1ygZzvBGk/pBBJRib/PjL9PLXa/aI2CcPpyHfqVsxxqLCYl6uZlfDw==", "dev": true, "license": "MIT", "dependencies": { @@ -330,21 +333,21 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-xml": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.5.0.tgz", - "integrity": "sha512-D/sdlJBMJfx7gqoj66PKVmhDDaU6TKA49ptcolxdas29X7AfvLTmfAGLjAcIMBK7UZ2o4lygHIqVckOlQU3xWw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.6.0.tgz", + "integrity": "sha512-e7lX/dk//F6Qf7BB6PTY4+p2yuOQtyOeHGyapYHNwqSp2OnYpwQt49A/Nin2XmKBQ69pwagR4k/lQBq8lbHQkA==", "dev": true, "license": "MIT", "dependencies": { - "fast-xml-parser": "^5.0.7", + "fast-xml-parser": "^5.5.9", "tslib": "^2.8.1" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/identity": { @@ -371,9 +374,9 @@ } }, "node_modules/@azure/logger": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.3.0.tgz", - "integrity": "sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.4.0.tgz", + "integrity": "sha512-rbAE25KUfjU/s3XHUdJgceoCP5dEOpMx85J04kF+QMdta73XkuG9JGHHinch+XIoKpBdqljin+KqURpJriSzLA==", "dev": true, "license": "MIT", "dependencies": { @@ -381,26 +384,26 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/msal-browser": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-5.6.3.tgz", - "integrity": "sha512-sTjMtUm+bJpENU/1WlRzHEsgEHppZDZ1EtNyaOODg/sQBtMxxJzGB+MOCM+T2Q5Qe1fKBrdxUmjyRxm0r7Ez9w==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-5.17.0.tgz", + "integrity": "sha512-/yTnW2TCk9Mh+2b/NOaHAN+MryUNxzRTaJD/YtrqOA9bpBWfTXn/iyReRbaLrK/btBo3stEzLyEvuWp2NZ5DuA==", "dev": true, "license": "MIT", "dependencies": { - "@azure/msal-common": "16.4.1" + "@azure/msal-common": "16.11.1" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-16.4.1.tgz", - "integrity": "sha512-Bl8f+w37xkXsYh7QRkAKCFGYtWMYuOVO7Lv+BxILrvGz3HbIEF22Pt0ugyj0QPOl6NLrHcnNUQ9yeew98P/5iw==", + "version": "16.11.1", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-16.11.1.tgz", + "integrity": "sha512-yPohvMwWLv1XnaWnIUyKUh8CvcVChCGqG/VluGwfGmaAfrZTNt5yQ+sIs462Sgw6+e2K83KGmMJ860p73ZSCrw==", "dev": true, "license": "MIT", "engines": { @@ -408,29 +411,19 @@ } }, "node_modules/@azure/msal-node": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-5.2.2.tgz", - "integrity": "sha512-toS+2AePxqyzb0YOKttDOOiSl3jrkK9aiqIvpurpis0O34QcIS5gToqrgT39p04Dpxw3YoUU0lxJKTpSFFfA6Q==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-5.4.0.tgz", + "integrity": "sha512-6EZEParwHRlnSSIikw8FNAnAzwmh71uhveUXdPNFeZFviJ9SH+rwFiurhjzXqICYTrpm3E+dj693QOwfPbJXAQ==", "dev": true, "license": "MIT", "dependencies": { - "@azure/msal-common": "16.6.2", + "@azure/msal-common": "16.11.1", "jsonwebtoken": "^9.0.0" }, "engines": { "node": ">=20" } }, - "node_modules/@azure/msal-node/node_modules/@azure/msal-common": { - "version": "16.6.2", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-16.6.2.tgz", - "integrity": "sha512-hQjjsekAjB00cM1EmatWJlzhEoK2Qhz7Rj5gvM6tYf8iL7RM3tkxlpU9fG0+ofkulzg9AEEA6dIEnSmDr5ZqUA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/@azure/storage-blob": { "version": "12.31.0", "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.31.0.tgz", @@ -458,16 +451,16 @@ } }, "node_modules/@azure/storage-common": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.3.0.tgz", - "integrity": "sha512-/OFHhy86aG5Pe8dP5tsp+BuJ25JOAl9yaMU3WZbkeoiFMHFtJ7tu5ili7qEdBXNW9G5lDB19trwyI6V49F/8iQ==", + "version": "12.4.1", + "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.4.1.tgz", + "integrity": "sha512-t14unw/WofGDUi7TKJrsyXyPsN+NLgRm7hMaq0llxNmTIzt7f257+6LE6FKIJPh88zLj6M7LPvzve0fEYg/L3A==", "dev": true, "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", "@azure/core-http-compat": "^2.2.0", - "@azure/core-rest-pipeline": "^1.19.1", + "@azure/core-rest-pipeline": "^1.24.0", "@azure/core-tracing": "^1.2.0", "@azure/core-util": "^1.11.0", "@azure/logger": "^1.1.4", @@ -1714,9 +1707,9 @@ } }, "node_modules/@nodable/entities": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.1.tgz", - "integrity": "sha512-Pig3HxDIoMgjdEH8OCf/dkcTmLFjJRjWuq8jSnklu284/TKOPibSRERmOykiwmyXTtv61mP+44f3GMx0tLAyjg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-9uGyhaQavEUMC8AIddIjau4NsnsXhou+j5sBAGojCM1oxmQpVKTWR/9JxABD6UAv12vpIms55fPZKFQEhG6uBg==", "dev": true, "funding": [ { @@ -1726,44 +1719,6 @@ ], "license": "MIT" }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@oxc-project/types": { "version": "0.133.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.133.0.tgz", @@ -2048,19 +2003,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@sindresorhus/merge-streams": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", - "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@standard-schema/spec": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", @@ -2384,9 +2326,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.13.0.tgz", - "integrity": "sha512-DonoHiyAMx0UjSmssqTrFtya+v97wny1aHcTLU5QF2wFzLATtcwUU9hbPC+eXhepuTunMOCHf8yk3pEsH6PZYA==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.14.0.tgz", + "integrity": "sha512-RRN0LGVDlonG/IbB2b4mvRjdCo6LywwB9/J8lOp6UaH7vtaFnKe5FL+rpxhof4rXx/zI/4OWnQO6c01bTCz4/Q==", "dev": true, "license": "MIT", "dependencies": { @@ -2401,8 +2343,8 @@ "prettier": "^3.8.1", "semver": "^7.7.4", "tar": "^7.5.13", - "temporal-polyfill": "^0.3.2", - "vscode-languageserver": "^9.0.1", + "temporal-polyfill": "^1.0.1", + "vscode-languageserver": "^10.0.0", "vscode-languageserver-textdocument": "^1.0.12", "yaml": "^2.8.3", "yargs": "^18.0.0" @@ -2497,30 +2439,30 @@ } }, "node_modules/@typespec/events": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.83.0.tgz", - "integrity": "sha512-3EP1EIjdLgwStgd2rGWaF/QqY7YRAt+DIYnnYG2VsdPwa8s2t6K6eJ9YJDXveeHImAkHs+cpFuwxnjKMl4hOyw==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.84.0.tgz", + "integrity": "sha512-UroDIu6t6Z+cOLyX8I+GJWhSFmYGrp1L93F7ZVt0Ypmj0ndmC9YYa4cpeEyS5PDDIC8u49WfCIwfGegxt4rPVQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/http": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.13.0.tgz", - "integrity": "sha512-tf8XFddU6g1MZSAVCLC/0Xa4fNfUO0CcHe6PWpmC3bvUojxMnpRcERI2DdoRJ+aycB9Q+Z8wN8bJO3up6u+sCw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.14.0.tgz", + "integrity": "sha512-W+heCzu8K63AVcoX8MachVWaRxSAMFWOI1yBTc2Kq8QHaJeDiLL5JbU8VfTZ4tL/6EoGSdKfIT5ZNRW7oVCzhg==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/streams": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -2529,67 +2471,66 @@ } }, "node_modules/@typespec/http-specs": { - "version": "0.1.0-alpha.39-dev.2", - "resolved": "https://registry.npmjs.org/@typespec/http-specs/-/http-specs-0.1.0-alpha.39-dev.2.tgz", - "integrity": "sha512-NsxuimkS12gB6RF3j2yGf48bV/LzG0JQbtrZbiGy00RxOAZV59L7gYp852ij6fYN37Uv8P31KHcGM6wIAduAyg==", + "version": "0.1.0-alpha.39", + "resolved": "https://registry.npmjs.org/@typespec/http-specs/-/http-specs-0.1.0-alpha.39.tgz", + "integrity": "sha512-x3ORyF/qLSLt+QDyievKT90STB0tT9J4s0Yu/Isio8zK16U+eRbCFHi69T7FZ94ZrRpPDWJ2u9+dEZv/SCPj+w==", "dev": true, "license": "MIT", "dependencies": { - "@typespec/spec-api": "^0.1.0-alpha.14 || >= 0.1.0-dev.0", - "@typespec/spector": "^0.1.0-alpha.25 || >= 0.1.0-dev.0" + "@typespec/spec-api": "^0.1.0-alpha.15", + "@typespec/spector": "^0.1.0-alpha.26" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0 || >= 1.14.0-dev.0", - "@typespec/http": "^1.13.0 || >= 1.14.0-dev.0", - "@typespec/rest": "^0.83.0 || >= 0.84.0-dev.0", - "@typespec/versioning": "^0.83.0 || >= 0.84.0-dev.0", - "@typespec/xml": "^0.83.0 || >= 0.84.0-dev.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@typespec/openapi": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.13.0.tgz", - "integrity": "sha512-omPc9n+LM2WvjYwnIf31RCxmG17fFUOVLBRsWg4T1mbcsNCj4grnNP7Lwt+irIZCiKtmLKxq3ViE7jYixCkZ3g==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.14.0.tgz", + "integrity": "sha512-KL7kImPhCXRmxpHVt1k7TWaa4bb3NbSeUx2rxyxeq7lYZFllI6/NYRCTOI/5JOrbElWmmSxrajU9K9IAKI6PkQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/rest": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.83.0.tgz", - "integrity": "sha512-WMEwEe1kdaOdZ0c+ct5BVmTSBXkrPniUYDWCz3K52T4in2dNc7J6YGP6tL8bXgQz5B0CsP0VNO12N+UysQDsLw==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.84.0.tgz", + "integrity": "sha512-9s5dDfRoHRPdtbVvkBasUx/RnMvwWMTuXRieSQDEji4gWGgxVu4Zt4MiEEKSfQrkMr3Aw0QjRCSxBxjMCHIOmA==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/spec-api": { - "version": "0.1.0-alpha.14", - "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.14.tgz", - "integrity": "sha512-MpLVtJZMsONMB9Di9aiXRbbihqa/+4MmbDHpuwd3ka39wtRhcA3sbFQY/+oU5zVEfEAldGgVkenFd2wnoI/xkQ==", + "version": "0.1.0-alpha.15", + "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.15.tgz", + "integrity": "sha512-rVPcA3KFJEBYpXq9BJkmtOk0SmF/pHUXv4m1FJNbXX8YW7eo3/NUKwB2Tc3TQVZB9zEIfBmf3BtLWpwvmVMAUQ==", "dev": true, "license": "MIT", "dependencies": { - "deep-equal": "^2.2.3", "express": "^5.2.1", - "xml2js": "^0.6.2" + "fast-xml-parser": "^5.7.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@typespec/spec-coverage-sdk": { @@ -2620,9 +2561,9 @@ } }, "node_modules/@typespec/spec-coverage-sdk/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -2640,65 +2581,34 @@ "license": "MIT" }, "node_modules/@typespec/spector": { - "version": "0.1.0-alpha.25", - "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.25.tgz", - "integrity": "sha512-KxMiwA/+XDWpZOdhr7TbnsR8ppXVi+edFa9hdUuerOGQzzALbSeQYUJLUr4RErRiHpqg2/P4FyJ2E0eiA2fTYA==", + "version": "0.1.0-alpha.26", + "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.26.tgz", + "integrity": "sha512-WtaWIJE+Xh80G11Bi/3zC1GIrK4EVYBSCnkmSvm9bEYcBMH8QuryPDbUeTXYUyozcCrMYXaKnBboHN91IEi8ug==", "dev": true, "license": "MIT", "dependencies": { - "@azure/identity": "~4.13.0", - "@typespec/compiler": "^1.11.0", - "@typespec/http": "^1.11.0", - "@typespec/rest": "^0.81.0", - "@typespec/spec-api": "^0.1.0-alpha.14", + "@azure/identity": "^4.13.1", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/spec-api": "^0.1.0-alpha.15", "@typespec/spec-coverage-sdk": "^0.1.0-alpha.16", - "@typespec/versioning": "^0.81.0", - "ajv": "~8.18.0", - "body-parser": "^2.2.2", - "deep-equal": "^2.2.3", + "@typespec/versioning": "^0.84.0", + "ajv": "^8.18.0", "express": "^5.2.1", - "globby": "~16.1.1", "micromatch": "^4.0.8", "morgan": "^1.10.1", - "multer": "^2.1.1", - "picocolors": "~1.1.1", - "source-map-support": "~0.5.21", - "xml2js": "^0.6.2", - "yaml": "~2.8.2", - "yargs": "~18.0.0" + "multer": "^2.2.0", + "picocolors": "^1.1.1", + "source-map-support": "^0.5.21", + "yaml": "^2.8.3", + "yargs": "^18.0.0" }, "bin": { "tsp-spector": "cmd/cli.mjs" }, "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@typespec/spector/node_modules/@typespec/rest": { - "version": "0.81.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.81.0.tgz", - "integrity": "sha512-qQXZRKEvq5aNlDFEUqBiiXXPIFyr/+PWgBY0kIrnhyZzMjfUqPInkB12QgXpVp2O2Wm3jmETJD45SaLHTCYBbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.11.0", - "@typespec/http": "^1.11.0" - } - }, - "node_modules/@typespec/spector/node_modules/@typespec/versioning": { - "version": "0.81.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.81.0.tgz", - "integrity": "sha512-5bha4t64xA85zLY8VGm/6jNd2kwPHzjPq/dlCUjtgGfGXv2R6Ow/YIukqhqZnwnIgNAIlZ7nguekRMRx+2oO2w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.11.0" + "node": ">=22.0.0" } }, "node_modules/@typespec/spector/node_modules/cliui": { @@ -2770,38 +2680,38 @@ } }, "node_modules/@typespec/sse": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.83.0.tgz", - "integrity": "sha512-04WNaju2rwBbcF5pG+HrKQtdcrmSGuTVziLHNA9XOqj1qM7Uon3+wo2g+ZZ3Z6tngfqQoTCPyDcRHqZtGRdNuw==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.84.0.tgz", + "integrity": "sha512-9joNgVisRCWDFfV1d79iTAuR1W/6r+AKJrKUfcjsaTrq5A8OWW3v5TTsfxbHAZArn7n2WxQkqhNGgNyc8LjEng==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/streams": "^0.84.0" } }, "node_modules/@typespec/streams": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.83.0.tgz", - "integrity": "sha512-wbO6sdH1Uf+UwjxxsWdHQkjJ3wwiYsAKI+L66qnDYVXAFe02sUdMKd0mxH5o9ipGXE52MZ+yvZ52vHAD+g3RFQ==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.84.0.tgz", + "integrity": "sha512-SDneR8+zY+ueOpzg9yJtttfDe/ikB99JgddZSXKPwiDPlAIEeEvI8auipcYfB58EEOB21h8Oq0tEm8HqiAAWdQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/ts-http-runtime": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.4.tgz", - "integrity": "sha512-CI0NhTrz4EBaa0U+HaaUZrJhPoso8sG7ZFya8uQoBA57fjzrjRSv87ekCjLZOFExN+gXE/z0xuN2QfH4H2HrLQ==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.7.tgz", + "integrity": "sha512-JVUD8X2tfDMWjcjLs4yVxxVrS8yR5vnh386GAXT9Qj79nBxxXSaHFQZg5FweLmT8HlPQ3kii6noUB+Z9RN7DvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2810,33 +2720,33 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@typespec/versioning": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.83.0.tgz", - "integrity": "sha512-nE66ta0ixpHB6FQpSzqnj8QnVfgFsxeK/4Xv+DxYx2nB/w18f6VjkF+hW+A/zs1tZIYvBZVbCNa/Rcr8zM6fhg==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.84.0.tgz", + "integrity": "sha512-ZoDasTDj4z0mgFK+0cJL2+7DduCaTjvICHL2nQ/RBWc7nLgObaIYCjvXLno8WneDXnpxCAr7larN4/nlHEv9fg==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/xml": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.83.0.tgz", - "integrity": "sha512-2/dtAD8jGPkIdwpQ1G1P+5+qdMPeafQiIKCd8NdAnOo0w9OZ59Io52jINm9HdN8+FcbOrqK8+B2N9rlPRj7PqA==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.84.0.tgz", + "integrity": "sha512-3x0spgIrr4u3azkYaOxrlumtjoqPiUnJ/G5RwGBmUCAeE5F413MHf/AeIkmZ2ULT1gY3myabfZp8bOijTbMk7A==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@vitest/expect": { @@ -3063,6 +2973,19 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/anynum": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/anynum/-/anynum-1.0.1.tgz", + "integrity": "sha512-N6//FLET/tXYNM/F6ABca1oH6fWB+KlTt909Le28WMDBk8oaT4vY17DCrwg2MvmuqUKt3Ni4N5dGJ/EoBgcO6A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", @@ -3075,23 +2998,6 @@ "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.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -3102,22 +3008,6 @@ "node": ">=12" } }, - "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, - "license": "MIT", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3146,22 +3036,36 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", - "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", "dev": true, "license": "MIT", "dependencies": { "bytes": "^3.1.2", - "content-type": "^1.0.5", + "content-type": "^2.0.0", "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3278,25 +3182,6 @@ } } }, - "node_modules/call-bind": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", - "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.0", - "es-define-property": "^1.0.0", - "get-intrinsic": "^1.2.4", - "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.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -3479,9 +3364,9 @@ } }, "node_modules/content-disposition": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", - "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", "dev": true, "license": "MIT", "engines": { @@ -3560,39 +3445,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, - "license": "MIT", - "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/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -3630,24 +3482,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -3661,24 +3495,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -3789,27 +3605,6 @@ "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, - "license": "MIT", - "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": "2.1.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", @@ -3818,9 +3613,9 @@ "license": "MIT" }, "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", "dev": true, "license": "MIT", "dependencies": { @@ -4217,36 +4012,6 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "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.8" - }, - "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==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "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", @@ -4307,9 +4072,9 @@ } }, "node_modules/fast-xml-builder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", - "integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.3.0.tgz", + "integrity": "sha512-F74cZEdCvuw9P41GAC3rod4X04jjWGM1JPEv/GWSqFTWLsdyMSBMBMlm9Hk3GLBgLBbdBNY8yee0pQh2RBVESQ==", "dev": true, "funding": [ { @@ -4319,14 +4084,14 @@ ], "license": "MIT", "dependencies": { - "path-expression-matcher": "^1.5.0", - "xml-naming": "^0.1.0" + "path-expression-matcher": "^1.6.2", + "xml-naming": "^0.3.0" } }, "node_modules/fast-xml-parser": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.8.0.tgz", - "integrity": "sha512-6bIM7fsJxeo3uXv7OncQYsBAMPJ7V16Slahl/6M98C/i2q+vB1+4a0MtrvYwDFEUrwDSbAmeLDRXsOBwrL7yAg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.10.0.tgz", + "integrity": "sha512-SLhnTEqE5QpJHq/6zl9bsmImEP2adv+y6Wy+cJa7nVTRzQh1OZfCe9k29M5xN74LWnu0xa1zrUrq3KnOKl92Fg==", "dev": true, "funding": [ { @@ -4336,26 +4101,17 @@ ], "license": "MIT", "dependencies": { - "@nodable/entities": "^2.1.0", + "@nodable/entities": "^2.2.0", "fast-xml-builder": "^1.2.0", - "path-expression-matcher": "^1.5.0", - "strnum": "^2.3.0", - "xml-naming": "^0.1.0" + "is-unsafe": "^2.0.0", + "path-expression-matcher": "^1.6.2", + "strnum": "^2.4.1", + "xml-naming": "^0.3.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -4442,22 +4198,6 @@ "license": "ISC", "peer": true }, - "node_modules/for-each": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", - "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", @@ -4517,16 +4257,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, - "license": "MIT", - "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", @@ -4683,54 +4413,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-16.1.1.tgz", - "integrity": "sha512-dW7vl+yiAJSp6aCekaVnVJxurRv7DCOLyXqEG3RYMYUg7AuJ2jCqPkZTA8ooqC2vtnkaMcV5WfFBMuEnTu1OQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/merge-streams": "^4.0.0", - "fast-glob": "^3.3.3", - "ignore": "^7.0.5", - "is-path-inside": "^4.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.4.0" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "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, "license": "MIT", "engines": { @@ -4749,19 +4435,6 @@ "node": ">=8" } }, - "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, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -4775,26 +4448,10 @@ "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, - "license": "MIT", - "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", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, "license": "MIT", "dependencies": { @@ -4923,21 +4580,6 @@ "dev": true, "license": "ISC" }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "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", @@ -4948,104 +4590,6 @@ "node": ">= 0.10" } }, - "node_modules/is-arguments": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", - "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "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, - "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -5067,6 +4611,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -5085,6 +4630,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "peer": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -5111,19 +4657,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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", @@ -5134,36 +4667,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "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", @@ -5171,25 +4674,6 @@ "dev": true, "license": "MIT" }, - "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, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-safe-filename": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-safe-filename/-/is-safe-filename-0.1.1.tgz", @@ -5203,70 +4687,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", @@ -5279,35 +4699,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "node_modules/is-unsafe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.0.tgz", + "integrity": "sha512-2LdV822R+wmI86unXA93WCFpL6g+av8ynWk0nrHyJqGop5VoocYsSLFgN8jrfalT6iGeLNM4KXuVSsULP53kEA==", "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" }, "node_modules/is-wsl": { "version": "3.1.1", @@ -5325,13 +4728,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -5905,16 +5301,6 @@ "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==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5995,20 +5381,24 @@ } }, "node_modules/morgan": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.1.tgz", - "integrity": "sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.11.0.tgz", + "integrity": "sha512-zSkVu3t18r39pw4ixfBKvfZi3y2UOqr7d4WYwcj3m8nXpEQK4rPO6GLzs/CExoRgmX3y9EjmmcXqv6jq0SK46g==", "dev": true, "license": "MIT", "dependencies": { "basic-auth": "~2.0.1", "debug": "2.6.9", "depd": "~2.0.0", - "on-finished": "~2.3.0", + "on-finished": "~2.4.1", "on-headers": "~1.1.0" }, "engines": { "node": ">= 0.8.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/morgan/node_modules/debug": { @@ -6028,19 +5418,6 @@ "dev": true, "license": "MIT" }, - "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, - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6049,9 +5426,9 @@ "license": "MIT" }, "node_modules/multer": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-2.1.1.tgz", - "integrity": "sha512-mo+QTzKlx8R7E5ylSXxWzGoXoZbOsRMpyitcht8By2KHvMbf3tjwosZ/Mu/XYU6UuJ3VZnODIrak5ZrPiPyB6A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz", + "integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6160,69 +5537,21 @@ "dev": true }, "node_modules/negotiator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "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==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">= 0.6" } }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, "engines": { "node": ">= 0.4" }, @@ -6381,9 +5710,9 @@ } }, "node_modules/path-expression-matcher": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz", - "integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.6.2.tgz", + "integrity": "sha512-enSlaiat05iasnzmgNxRj8reFdj3puY2QpNgP1aPIaVfT6nn9ICuPoFlKHk8EN22HcwewshO+mN2DGbkCEOtqQ==", "dev": true, "funding": [ { @@ -6468,16 +5797,6 @@ "node": ">=4" } }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postcss": { "version": "8.5.15", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", @@ -6570,13 +5889,14 @@ } }, "node_modules/qs": { - "version": "6.15.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", - "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -6585,35 +5905,18 @@ "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" - } - ], - "license": "MIT" - }, "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==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/raw-body": { @@ -6647,27 +5950,6 @@ "node": ">= 6" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.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", @@ -6706,17 +5988,6 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rimraf": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.2.tgz", @@ -6801,30 +6072,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -6846,24 +6093,6 @@ ], "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -6871,16 +6100,6 @@ "dev": true, "license": "MIT" }, - "node_modules/sax": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.5.0.tgz", - "integrity": "sha512-21IYA3Q5cQf089Z6tgaUTr7lDAyzoTPx5HRtbhsME8Udispad8dC/+sziTNugOEx54ilvatQ9YCzl4KQLPcRHA==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=11.0.0" - } - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -6939,40 +6158,6 @@ "url": "https://opencollective.com/express" } }, - "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, - "license": "MIT", - "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, - "license": "MIT", - "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", @@ -7002,15 +6187,15 @@ } }, "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, @@ -7022,14 +6207,14 @@ } }, "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==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" + "object-inspect": "^1.13.4" }, "engines": { "node": ">= 0.4" @@ -7095,19 +6280,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "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, - "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", @@ -7162,20 +6334,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -7306,9 +6464,9 @@ } }, "node_modules/strnum": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.3.0.tgz", - "integrity": "sha512-ums3KNd42PGyx5xaoVTO1mjU1bH3NpY4vsrVlnv9PNGqQj8wd7rJ6nEypLrJ7z5vxK5RP0yMLo6J/Gsm62DI5Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.1.tgz", + "integrity": "sha512-M9eUSMT2dCB2cTNPG7UYj6KuK7RJR2SN2+yCV/fTW3xzTCS6EaGZ5pSMgDIjB7r8zSfTGk+dvvn9rTjpVS9Mwg==", "dev": true, "funding": [ { @@ -7316,7 +6474,10 @@ "url": "https://github.com/sponsors/NaturalIntelligence" } ], - "license": "MIT" + "license": "MIT", + "dependencies": { + "anynum": "^1.0.1" + } }, "node_modules/supports-color": { "version": "7.2.0", @@ -7348,21 +6509,29 @@ } }, "node_modules/temporal-polyfill": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.3.2.tgz", - "integrity": "sha512-TzHthD/heRK947GNiSu3Y5gSPpeUDH34+LESnfsq8bqpFhsB79HFBX8+Z834IVX68P3EUyRPZK5bL/1fh437Eg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", + "integrity": "sha512-N2SoI9olnW7BUsU8RosDphZQl9s+WJ8O7PoJMFCr/e5/1rFkVI4GNOWaSeySG+UoP04foPYsnLWbJmbXOiShZg==", "dev": true, "license": "MIT", "dependencies": { - "temporal-spec": "0.3.1" + "temporal-spec": "1.0.0", + "temporal-utils": "1.0.1" } }, "node_modules/temporal-spec": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.3.1.tgz", - "integrity": "sha512-B4TUhezh9knfSIMwt7RVggApDRJZo73uZdj8AacL2mZ8RP5KtLianh2MXxL06GN9ESYiIsiuoLQhgVfwe55Yhw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-1.0.0.tgz", + "integrity": "sha512-00Ahj1e1ifaERTMOIIGpOCdOo9IEk2m6GGSMedsn9a2SIsGLdOTbmME1Htv6IM82b6VHrzSUTIVc7YHy6hdhFQ==", "dev": true, - "license": "ISC" + "license": "Apache-2.0" + }, + "node_modules/temporal-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/temporal-utils/-/temporal-utils-1.0.1.tgz", + "integrity": "sha512-HAixuesxFQIUaQk3ptX2jhfO/FsOkgVkDDMawvp6n/fkB1q6BKfs3lURw9I+pK/2e2e/q/vrLrxmeqauBoyGMQ==", + "dev": true, + "license": "MIT" }, "node_modules/test-exclude": { "version": "7.0.1", @@ -7586,18 +6755,36 @@ } }, "node_modules/type-is": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", - "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", "dev": true, "license": "MIT", "dependencies": { - "content-type": "^1.0.5", + "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/typedarray": { @@ -7652,19 +6839,6 @@ "dev": true, "license": "MIT" }, - "node_modules/unicorn-magic": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz", - "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -7904,34 +7078,37 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", + "integrity": "sha512-rfuA6T75H6m5EkbhtEPzre9pT0HPcDI2MMy4+nPFIBks5J8JBAUHD4tRYSgaBOijIEC7SRkC1kKyXTLqbmh9jw==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", - "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", + "integrity": "sha512-9gEWpXkYGXoqG7pBnE8O8hx/yP7+Aabn4+peQ3KDicQv6qunHSWyLTud3OF0w4S2+HfDD+5HqYKiXQW9HAU6mA==", "dev": true, + "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.17.5" + "vscode-languageserver-protocol": "3.18.2" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", + "integrity": "sha512-XRyDbT0Pp3sSNti3JmxVEUMySWCSi1hhM+/KUlCy1hV1zmrqpM1OwO12EAki8blhmLuIMpaJrYbo0OzGVfK2Qg==", "dev": true, + "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "9.0.1", + "vscode-languageserver-types": "3.18.0" } }, "node_modules/vscode-languageserver-textdocument": { @@ -7941,10 +7118,11 @@ "dev": true }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", - "dev": true + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha512-8TsGPNMIMiiBdkORgRSvLjuiEIiAFtO+KssmYWxQ+uSVvlf7RjK8YKCOjPzZ+YA04jXEV7+7LvkSmHkhpNS99g==", + "dev": true, + "license": "MIT" }, "node_modules/which": { "version": "2.0.2", @@ -7961,67 +7139,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "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, - "license": "MIT", - "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.20", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", - "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "for-each": "^0.3.5", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "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", @@ -8208,9 +7325,9 @@ } }, "node_modules/xml-naming": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz", - "integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.3.0.tgz", + "integrity": "sha512-ghig2TBE/H11aOVgmahA3MhimvkBr6JIYknH/Dhdk10nXwdbIqBJsbfMxpvFPG8bAw77gN29aQWvKpmVoPlvPQ==", "dev": true, "funding": [ { @@ -8223,30 +7340,6 @@ "node": ">=16.0.0" } }, - "node_modules/xml2js": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", - "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index d220de9eb89..ebda90de88d 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.34.1", + "version": "0.34.2", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://typespec.io", @@ -64,20 +64,20 @@ "emitter" ], "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.1 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/events": ">=0.83.0 <1.0.0", - "@typespec/sse": ">=0.83.0 <1.0.0", - "@typespec/streams": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.70.0 <1.0.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": ">=0.84.0 <1.0.0", + "@typespec/versioning": ">=0.84.0 <1.0.0", + "@typespec/events": ">=0.84.0 <1.0.0", + "@typespec/sse": ">=0.84.0 <1.0.0", + "@typespec/streams": ">=0.84.0 <1.0.0", + "@typespec/xml": ">=0.84.0 <1.0.0" }, "playgroundConfig": { "assets": [ @@ -102,24 +102,24 @@ "tsx": "^4.21.0" }, "devDependencies": { - "@azure-tools/typespec-autorest": "~0.69.1", - "@azure-tools/typespec-azure-core": "~0.69.0", - "@azure-tools/typespec-azure-resource-manager": "~0.69.1", - "@azure-tools/typespec-azure-rulesets": "~0.69.1", - "@azure-tools/typespec-client-generator-core": "~0.69.1", - "@azure-tools/azure-http-specs": "0.1.0-alpha.42", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "~0.83.0", - "@typespec/versioning": "~0.83.0", - "@typespec/events": "~0.83.0", - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/spec-api": "0.1.0-alpha.14", - "@typespec/sse": "~0.83.0", - "@typespec/streams": "~0.83.0", - "@typespec/xml": "~0.83.0", - "@typespec/http-specs": "0.1.0-alpha.39-dev.2", + "@azure-tools/typespec-autorest": "~0.70.0", + "@azure-tools/typespec-azure-core": "~0.70.0", + "@azure-tools/typespec-azure-resource-manager": "~0.70.0", + "@azure-tools/typespec-azure-rulesets": "~0.70.0", + "@azure-tools/typespec-client-generator-core": "~0.70.0", + "@azure-tools/azure-http-specs": "0.1.0-alpha.43", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "~0.84.0", + "@typespec/versioning": "~0.84.0", + "@typespec/events": "~0.84.0", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/spec-api": "0.1.0-alpha.15", + "@typespec/sse": "~0.84.0", + "@typespec/streams": "~0.84.0", + "@typespec/xml": "~0.84.0", + "@typespec/http-specs": "0.1.0-alpha.39", "@types/js-yaml": "~4.0.5", "@types/node": "~25.0.2", "@types/semver": "7.5.8", From 4751383fd59eb64f1d443376c5db7948cfe974eb Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:14:24 +0800 Subject: [PATCH 003/249] Update Node.js dependencies for http-client-java (#11260) The http-client-java package and its generator test projects were using outdated Node.js dependencies. - **Dependency updates** - Upgraded TypeSpec, Azure tooling, testing, TypeScript, and YAML dependencies. - Updated `peerDependencies` and test-project `overrides` to match. - Refreshed `package-lock.json`. - **Release metadata** - Added a Chronus dependency changelog entry. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: XiaofeiCao <92354331+XiaofeiCao@users.noreply.github.com> --- ...java-update-node-dependencies-2026-7-15.md | 7 + .../package.json | 34 +- .../booleannamespace/BooleanClient.java | 168 ++ .../BooleanClientBuilder.java | 235 ++ .../implementation/BooleanClientImpl.java | 79 + .../implementation/PropertiesImpl.java | 187 ++ .../implementation/package-info.java | 5 + .../encode/booleannamespace/package-info.java | 5 + .../property/BoolAsStringProperty.java | 79 + .../property/package-info.java | 5 + .../duration/DurationClientBuilder.java | 22 +- .../java/encode/duration/LossyClient.java | 98 + .../implementation/DurationClientImpl.java | 29 +- .../duration/implementation/LossiesImpl.java | 120 + .../implementation/SpecialCharsImpl.java | 6 +- .../main/java/routes/ExpandParameters.java | 101 + ...ParametersQueryExpansionExplodeClient.java | 45 +- ...yParametersQueryExpansionExplodesImpl.java | 35 +- .../encode-booleannamespace_metadata.json | 1 + .../META-INF/encode-duration_metadata.json | 2 +- .../META-INF/parameters-query_metadata.json | 2 +- .../resources/META-INF/routes_metadata.json | 2 +- .../http-client-generator-test/package.json | 34 +- .../fluent/LargeHeadersClient.java | 16 +- .../LargeHeadersClientImpl.java | 38 +- .../largeheader/models/LargeHeaders.java | 8 +- .../fluent/LroPagingsClient.java | 8 +- .../fluent/LroesClient.java | 40 +- .../implementation/LroPagingsClientImpl.java | 32 +- .../implementation/LroesClientImpl.java | 92 +- .../operationtemplates/models/LroPagings.java | 8 +- .../operationtemplates/models/Lroes.java | 22 +- .../operationtemplates/models/Order.java | 42 +- .../booleannamespace/BooleanAsyncClient.java | 268 ++ .../booleannamespace/BooleanClient.java | 266 ++ .../BooleanClientBuilder.java | 287 ++ .../implementation/BooleanClientImpl.java | 107 + .../implementation/PropertiesImpl.java | 445 +++ .../implementation/package-info.java | 11 + .../encode/booleannamespace/package-info.java | 11 + .../property/models/BoolAsStringProperty.java | 83 + .../property/models/package-info.java | 11 + .../duration/DurationClientBuilder.java | 40 +- .../encode/duration/LossyAsyncClient.java | 113 + .../java/encode/duration/LossyClient.java | 109 + .../implementation/DurationClientImpl.java | 33 +- .../duration/implementation/LossiesImpl.java | 165 ++ .../implementation/SpecialCharsImpl.java | 10 +- ...etersQueryExpansionExplodeAsyncClient.java | 52 +- ...ParametersQueryExpansionExplodeClient.java | 51 +- ...yParametersQueryExpansionExplodesImpl.java | 66 +- .../java/routes/models/ExpandParameters.java | 105 + .../main/java/routes/models/package-info.java | 11 + .../ChildResourcesInterfacesClient.java | 78 +- .../fluent/LroNoBodiesClient.java | 42 +- .../TopLevelArmResourceInterfacesClient.java | 92 +- .../ChildResourcesInterfacesClientImpl.java | 108 +- .../implementation/LroNoBodiesClientImpl.java | 56 +- ...pLevelArmResourceInterfacesClientImpl.java | 134 +- .../models/ChildResource.java | 54 +- .../models/ChildResourcesInterfaces.java | 30 +- .../models/LroNoBodies.java | 12 +- .../models/TopLevelArmResource.java | 84 +- .../models/TopLevelArmResourceInterfaces.java | 38 +- .../encode-booleannamespace_metadata.json | 1 + .../META-INF/encode-duration_metadata.json | 2 +- .../META-INF/parameters-query_metadata.json | 2 +- .../resources/META-INF/routes_metadata.json | 2 +- .../encode-booleannamespace.properties | 2 + .../generated/BooleanClientTestBase.java | 34 + .../generated/DurationClientTestBase.java | 12 + packages/http-client-java/package-lock.json | 2397 ++++++----------- packages/http-client-java/package.json | 68 +- 73 files changed, 4917 insertions(+), 2182 deletions(-) create mode 100644 .chronus/changes/http-client-java-update-node-dependencies-2026-7-15.md create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/BoolAsStringProperty.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/LossyClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/LossiesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/ExpandParameters.java create mode 100644 packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/BoolAsStringProperty.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/ExpandParameters.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/encode-booleannamespace.properties create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/generated/BooleanClientTestBase.java diff --git a/.chronus/changes/http-client-java-update-node-dependencies-2026-7-15.md b/.chronus/changes/http-client-java-update-node-dependencies-2026-7-15.md new file mode 100644 index 00000000000..70f3ab4d717 --- /dev/null +++ b/.chronus/changes/http-client-java-update-node-dependencies-2026-7-15.md @@ -0,0 +1,7 @@ +--- +changeKind: dependencies +packages: + - "@typespec/http-client-java" +--- + +Update Node.js dependencies diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/package.json b/packages/http-client-java/generator/http-client-generator-clientcore-test/package.json index aeb95b61b8f..7f93f9e7afd 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/package.json +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/package.json @@ -12,27 +12,27 @@ "spector-stop": "tsp-spector server stop" }, "dependencies": { - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/spec-api": "0.1.0-alpha.14", - "@typespec/http-specs": "0.1.0-alpha.38", - "@typespec/json-schema": "1.13.0", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/spec-api": "0.1.0-alpha.15", + "@typespec/http-specs": "0.1.0-alpha.39", + "@typespec/json-schema": "1.14.0", "@typespec/http-client-java": "file:../../typespec-http-client-java-0.9.0.tgz", "@typespec/http-client-java-tests": "file:" }, "overrides": { - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/openapi": "1.13.0", - "@typespec/xml": "0.83.0", - "@typespec/events": "0.83.0", - "@typespec/sse": "0.83.0", - "@typespec/streams": "0.83.0", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-client-generator-core": "0.69.2", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-autorest": "0.69.1" + "@typespec/compiler": "1.14.0", + "@typespec/http": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/openapi": "1.14.0", + "@typespec/xml": "0.84.0", + "@typespec/events": "0.84.0", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-autorest": "0.70.0" }, "private": true } diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClient.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClient.java new file mode 100644 index 00000000000..e941d67548d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClient.java @@ -0,0 +1,168 @@ +package encode.booleannamespace; + +import encode.booleannamespace.implementation.PropertiesImpl; +import encode.booleannamespace.property.BoolAsStringProperty; +import io.clientcore.core.annotations.Metadata; +import io.clientcore.core.annotations.MetadataProperties; +import io.clientcore.core.annotations.ReturnType; +import io.clientcore.core.annotations.ServiceClient; +import io.clientcore.core.annotations.ServiceMethod; +import io.clientcore.core.http.models.HttpResponseException; +import io.clientcore.core.http.models.RequestContext; +import io.clientcore.core.http.models.Response; +import io.clientcore.core.instrumentation.Instrumentation; + +/** + * Initializes a new instance of the synchronous BooleanClient type. + */ +@ServiceClient(builder = BooleanClientBuilder.class) +public final class BooleanClient { + @Metadata(properties = { MetadataProperties.GENERATED }) + private final PropertiesImpl serviceClient; + + private final Instrumentation instrumentation; + + /** + * Initializes an instance of BooleanClient class. + * + * @param serviceClient the service client implementation. + * @param instrumentation the instrumentation instance. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + BooleanClient(PropertiesImpl serviceClient, Instrumentation instrumentation) { + this.serviceClient = serviceClient; + this.instrumentation = instrumentation; + } + + /** + * The trueLower operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trueLowerWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.trueLower", requestContext, + updatedContext -> this.serviceClient.trueLowerWithResponse(value, updatedContext)); + } + + /** + * The trueLower operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty trueLower(BoolAsStringProperty value) { + return trueLowerWithResponse(value, RequestContext.none()).getValue(); + } + + /** + * The falseLower operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response falseLowerWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.falseLower", requestContext, + updatedContext -> this.serviceClient.falseLowerWithResponse(value, updatedContext)); + } + + /** + * The falseLower operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty falseLower(BoolAsStringProperty value) { + return falseLowerWithResponse(value, RequestContext.none()).getValue(); + } + + /** + * The trueUpper operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trueUpperWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.trueUpper", requestContext, + updatedContext -> this.serviceClient.trueUpperWithResponse(value, updatedContext)); + } + + /** + * The trueUpper operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty trueUpper(BoolAsStringProperty value) { + return trueUpperWithResponse(value, RequestContext.none()).getValue(); + } + + /** + * The falseMixed operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response falseMixedWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.falseMixed", requestContext, + updatedContext -> this.serviceClient.falseMixedWithResponse(value, updatedContext)); + } + + /** + * The falseMixed operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty falseMixed(BoolAsStringProperty value) { + return falseMixedWithResponse(value, RequestContext.none()).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java new file mode 100644 index 00000000000..a8f62b1b777 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java @@ -0,0 +1,235 @@ +package encode.booleannamespace; + +import encode.booleannamespace.implementation.BooleanClientImpl; +import io.clientcore.core.annotations.Metadata; +import io.clientcore.core.annotations.MetadataProperties; +import io.clientcore.core.annotations.ServiceClientBuilder; +import io.clientcore.core.http.client.HttpClient; +import io.clientcore.core.http.models.ProxyOptions; +import io.clientcore.core.http.pipeline.HttpInstrumentationOptions; +import io.clientcore.core.http.pipeline.HttpInstrumentationPolicy; +import io.clientcore.core.http.pipeline.HttpPipeline; +import io.clientcore.core.http.pipeline.HttpPipelineBuilder; +import io.clientcore.core.http.pipeline.HttpPipelinePolicy; +import io.clientcore.core.http.pipeline.HttpRedirectOptions; +import io.clientcore.core.http.pipeline.HttpRedirectPolicy; +import io.clientcore.core.http.pipeline.HttpRetryOptions; +import io.clientcore.core.http.pipeline.HttpRetryPolicy; +import io.clientcore.core.instrumentation.Instrumentation; +import io.clientcore.core.instrumentation.SdkInstrumentationOptions; +import io.clientcore.core.traits.ConfigurationTrait; +import io.clientcore.core.traits.EndpointTrait; +import io.clientcore.core.traits.HttpTrait; +import io.clientcore.core.traits.ProxyTrait; +import io.clientcore.core.utils.CoreUtils; +import io.clientcore.core.utils.configuration.Configuration; +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 BooleanClient type. + */ +@ServiceClientBuilder(serviceClients = { BooleanClient.class }) +public final class BooleanClientBuilder implements HttpTrait, ProxyTrait, + ConfigurationTrait, EndpointTrait { + @Metadata(properties = { MetadataProperties.GENERATED }) + private static final String SDK_NAME = "name"; + + @Metadata(properties = { MetadataProperties.GENERATED }) + private static final String SDK_VERSION = "version"; + + @Metadata(properties = { MetadataProperties.GENERATED }) + private static final Map PROPERTIES = CoreUtils.getProperties("encode-booleannamespace.properties"); + + @Metadata(properties = { MetadataProperties.GENERATED }) + private final List pipelinePolicies; + + /** + * Create an instance of the BooleanClientBuilder. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public BooleanClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private HttpRetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder httpRetryOptions(HttpRetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder addHttpPipelinePolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The redirect options to configure redirect policy + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private HttpRedirectOptions redirectOptions; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder httpRedirectOptions(HttpRedirectOptions redirectOptions) { + this.redirectOptions = redirectOptions; + return this; + } + + /* + * The instrumentation configuration for HTTP requests and responses. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private HttpInstrumentationOptions httpInstrumentationOptions; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder httpInstrumentationOptions(HttpInstrumentationOptions httpInstrumentationOptions) { + this.httpInstrumentationOptions = httpInstrumentationOptions; + return this; + } + + /* + * The proxy options used during construction of the service client. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private ProxyOptions proxyOptions; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder proxyOptions(ProxyOptions proxyOptions) { + this.proxyOptions = proxyOptions; + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public BooleanClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Builds an instance of BooleanClientImpl with the provided parameters. + * + * @return an instance of BooleanClientImpl. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private BooleanClientImpl buildInnerClient() { + this.validateClient(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null + ? new HttpInstrumentationOptions() + : this.httpInstrumentationOptions; + SdkInstrumentationOptions sdkInstrumentationOptions + = new SdkInstrumentationOptions(PROPERTIES.getOrDefault(SDK_NAME, "UnknownName")) + .setSdkVersion(PROPERTIES.get(SDK_VERSION)) + .setEndpoint(localEndpoint); + Instrumentation instrumentation + = Instrumentation.create(localHttpInstrumentationOptions, sdkInstrumentationOptions); + BooleanClientImpl client = new BooleanClientImpl(createHttpPipeline(), instrumentation, localEndpoint); + return client; + } + + @Metadata(properties = { MetadataProperties.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. + } + + @Metadata(properties = { MetadataProperties.GENERATED }) + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null + ? new HttpInstrumentationOptions() + : this.httpInstrumentationOptions; + HttpPipelineBuilder httpPipelineBuilder = new HttpPipelineBuilder(); + List policies = new ArrayList<>(); + policies.add(redirectOptions == null ? new HttpRedirectPolicy() : new HttpRedirectPolicy(redirectOptions)); + policies.add(retryOptions == null ? new HttpRetryPolicy() : new HttpRetryPolicy(retryOptions)); + this.pipelinePolicies.stream().forEach(p -> policies.add(p)); + policies.add(new HttpInstrumentationPolicy(localHttpInstrumentationOptions)); + policies.forEach(httpPipelineBuilder::addPolicy); + return httpPipelineBuilder.httpClient(httpClient).build(); + } + + /** + * Builds an instance of BooleanClient class. + * + * @return an instance of BooleanClient. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public BooleanClient buildBooleanClient() { + BooleanClientImpl innerClient = buildInnerClient(); + return new BooleanClient(innerClient.getProperties(), innerClient.getInstrumentation()); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java new file mode 100644 index 00000000000..7ec849704c9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java @@ -0,0 +1,79 @@ +package encode.booleannamespace.implementation; + +import io.clientcore.core.http.pipeline.HttpPipeline; +import io.clientcore.core.instrumentation.Instrumentation; + +/** + * Initializes a new instance of the BooleanClient type. + */ +public final class BooleanClientImpl { + /** + * 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 instance of instrumentation to report telemetry. + */ + private final Instrumentation instrumentation; + + /** + * Gets The instance of instrumentation to report telemetry. + * + * @return the instrumentation value. + */ + public Instrumentation getInstrumentation() { + return this.instrumentation; + } + + /** + * The PropertiesImpl object to access its operations. + */ + private final PropertiesImpl properties; + + /** + * Gets the PropertiesImpl object to access its operations. + * + * @return the PropertiesImpl object. + */ + public PropertiesImpl getProperties() { + return this.properties; + } + + /** + * Initializes an instance of BooleanClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param instrumentation The instance of instrumentation to report telemetry. + * @param endpoint Service host. + */ + public BooleanClientImpl(HttpPipeline httpPipeline, Instrumentation instrumentation, String endpoint) { + this.httpPipeline = httpPipeline; + this.instrumentation = instrumentation; + this.endpoint = endpoint; + this.properties = new PropertiesImpl(this); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java new file mode 100644 index 00000000000..b9488a092de --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java @@ -0,0 +1,187 @@ +package encode.booleannamespace.implementation; + +import encode.booleannamespace.property.BoolAsStringProperty; +import io.clientcore.core.annotations.ReturnType; +import io.clientcore.core.annotations.ServiceInterface; +import io.clientcore.core.annotations.ServiceMethod; +import io.clientcore.core.http.annotations.BodyParam; +import io.clientcore.core.http.annotations.HeaderParam; +import io.clientcore.core.http.annotations.HostParam; +import io.clientcore.core.http.annotations.HttpRequestInformation; +import io.clientcore.core.http.annotations.UnexpectedResponseExceptionDetail; +import io.clientcore.core.http.models.HttpMethod; +import io.clientcore.core.http.models.HttpResponseException; +import io.clientcore.core.http.models.RequestContext; +import io.clientcore.core.http.models.Response; +import io.clientcore.core.http.pipeline.HttpPipeline; +import io.clientcore.core.instrumentation.Instrumentation; +import java.lang.reflect.InvocationTargetException; + +/** + * An instance of this class provides access to all the operations defined in Properties. + */ +public final class PropertiesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PropertiesService service; + + /** + * The service client containing this operation class. + */ + private final BooleanClientImpl client; + + /** + * The instance of instrumentation to report telemetry. + */ + private final Instrumentation instrumentation; + + /** + * Initializes an instance of PropertiesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PropertiesImpl(BooleanClientImpl client) { + this.service = PropertiesService.getNewInstance(client.getHttpPipeline()); + this.client = client; + this.instrumentation = client.getInstrumentation(); + } + + /** + * The interface defining all the services for BooleanClientProperties to be used by the proxy service to perform + * REST calls. + */ + @ServiceInterface(name = "BooleanClientProperties", host = "{endpoint}") + public interface PropertiesService { + static PropertiesService getNewInstance(HttpPipeline pipeline) { + try { + Class clazz = Class.forName("encode.booleannamespace.implementation.PropertiesServiceImpl"); + return (PropertiesService) clazz.getMethod("getNewInstance", HttpPipeline.class).invoke(null, pipeline); + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException + | InvocationTargetException e) { + throw new RuntimeException(e); + } + + } + + @HttpRequestInformation( + method = HttpMethod.POST, + path = "/encode/boolean/property/true-lower", + expectedStatusCodes = { 200 }) + @UnexpectedResponseExceptionDetail + Response trueLower(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BoolAsStringProperty value, RequestContext requestContext); + + @HttpRequestInformation( + method = HttpMethod.POST, + path = "/encode/boolean/property/false-lower", + expectedStatusCodes = { 200 }) + @UnexpectedResponseExceptionDetail + Response falseLower(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BoolAsStringProperty value, RequestContext requestContext); + + @HttpRequestInformation( + method = HttpMethod.POST, + path = "/encode/boolean/property/true-upper", + expectedStatusCodes = { 200 }) + @UnexpectedResponseExceptionDetail + Response trueUpper(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BoolAsStringProperty value, RequestContext requestContext); + + @HttpRequestInformation( + method = HttpMethod.POST, + path = "/encode/boolean/property/false-mixed", + expectedStatusCodes = { 200 }) + @UnexpectedResponseExceptionDetail + Response falseMixed(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BoolAsStringProperty value, RequestContext requestContext); + } + + /** + * The trueLower operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trueLowerWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.trueLower", requestContext, + updatedContext -> { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.trueLower(this.client.getEndpoint(), contentType, accept, value, updatedContext); + }); + } + + /** + * The falseLower operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response falseLowerWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.falseLower", requestContext, + updatedContext -> { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.falseLower(this.client.getEndpoint(), contentType, accept, value, updatedContext); + }); + } + + /** + * The trueUpper operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trueUpperWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.trueUpper", requestContext, + updatedContext -> { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.trueUpper(this.client.getEndpoint(), contentType, accept, value, updatedContext); + }); + } + + /** + * The falseMixed operation. + * + * @param value The value parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response falseMixedWithResponse(BoolAsStringProperty value, + RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Boolean.Property.falseMixed", requestContext, + updatedContext -> { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.falseMixed(this.client.getEndpoint(), contentType, accept, value, updatedContext); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/package-info.java new file mode 100644 index 00000000000..e9b2cc8969d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/implementation/package-info.java @@ -0,0 +1,5 @@ +/** + * Package containing the implementations for BooleanModel. + * Test for encode decorator on boolean. + */ +package encode.booleannamespace.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/package-info.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/package-info.java new file mode 100644 index 00000000000..adbb0c39209 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/package-info.java @@ -0,0 +1,5 @@ +/** + * Package containing the classes for BooleanModel. + * Test for encode decorator on boolean. + */ +package encode.booleannamespace; diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/BoolAsStringProperty.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/BoolAsStringProperty.java new file mode 100644 index 00000000000..5501a3d45b4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/BoolAsStringProperty.java @@ -0,0 +1,79 @@ +package encode.booleannamespace.property; + +import io.clientcore.core.annotations.Metadata; +import io.clientcore.core.annotations.MetadataProperties; +import io.clientcore.core.serialization.json.JsonReader; +import io.clientcore.core.serialization.json.JsonSerializable; +import io.clientcore.core.serialization.json.JsonToken; +import io.clientcore.core.serialization.json.JsonWriter; +import java.io.IOException; + +/** + * The BoolAsStringProperty model. + */ +@Metadata(properties = { MetadataProperties.IMMUTABLE }) +public final class BoolAsStringProperty implements JsonSerializable { + /* + * The value property. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private final boolean value; + + /** + * Creates an instance of BoolAsStringProperty class. + * + * @param value the value value to set. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public BoolAsStringProperty(boolean value) { + this.value = value; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public boolean isValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BoolAsStringProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BoolAsStringProperty 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 BoolAsStringProperty. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public static BoolAsStringProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean value = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new BoolAsStringProperty(value); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/package-info.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/package-info.java new file mode 100644 index 00000000000..7d1030a9196 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/booleannamespace/property/package-info.java @@ -0,0 +1,5 @@ +/** + * Package containing the data models for BooleanModel. + * Test for encode decorator on boolean. + */ +package encode.booleannamespace.property; diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/DurationClientBuilder.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/DurationClientBuilder.java index 2ed88ccab36..4f2f7a48f49 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/DurationClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/DurationClientBuilder.java @@ -31,7 +31,8 @@ /** * A builder for creating a new instance of the DurationClient type. */ -@ServiceClientBuilder(serviceClients = { QueryClient.class, PropertyClient.class, HeaderClient.class }) +@ServiceClientBuilder( + serviceClients = { QueryClient.class, PropertyClient.class, HeaderClient.class, LossyClient.class }) public final class DurationClientBuilder implements HttpTrait, ProxyTrait, ConfigurationTrait, EndpointTrait { @Metadata(properties = { MetadataProperties.GENERATED }) @@ -179,7 +180,7 @@ public DurationClientBuilder endpoint(String endpoint) { /** * Builds an instance of DurationClientImpl with the provided parameters. - * + * * @return an instance of DurationClientImpl. */ @Metadata(properties = { MetadataProperties.GENERATED }) @@ -224,7 +225,7 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of QueryClient class. - * + * * @return an instance of QueryClient. */ @Metadata(properties = { MetadataProperties.GENERATED }) @@ -235,7 +236,7 @@ public QueryClient buildQueryClient() { /** * Builds an instance of PropertyClient class. - * + * * @return an instance of PropertyClient. */ @Metadata(properties = { MetadataProperties.GENERATED }) @@ -246,7 +247,7 @@ public PropertyClient buildPropertyClient() { /** * Builds an instance of HeaderClient class. - * + * * @return an instance of HeaderClient. */ @Metadata(properties = { MetadataProperties.GENERATED }) @@ -254,4 +255,15 @@ public HeaderClient buildHeaderClient() { DurationClientImpl innerClient = buildInnerClient(); return new HeaderClient(innerClient.getHeaders(), innerClient.getInstrumentation()); } + + /** + * Builds an instance of LossyClient class. + * + * @return an instance of LossyClient. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public LossyClient buildLossyClient() { + DurationClientImpl innerClient = buildInnerClient(); + return new LossyClient(innerClient.getLossies(), innerClient.getInstrumentation()); + } } diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/LossyClient.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/LossyClient.java new file mode 100644 index 00000000000..9f1b3a94329 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/LossyClient.java @@ -0,0 +1,98 @@ +package encode.duration; + +import encode.duration.implementation.LossiesImpl; +import io.clientcore.core.annotations.Metadata; +import io.clientcore.core.annotations.MetadataProperties; +import io.clientcore.core.annotations.ReturnType; +import io.clientcore.core.annotations.ServiceClient; +import io.clientcore.core.annotations.ServiceMethod; +import io.clientcore.core.http.models.HttpResponseException; +import io.clientcore.core.http.models.RequestContext; +import io.clientcore.core.http.models.Response; +import io.clientcore.core.instrumentation.Instrumentation; +import java.time.Duration; + +/** + * Initializes a new instance of the synchronous DurationClient type. + */ +@ServiceClient(builder = DurationClientBuilder.class) +public final class LossyClient { + @Metadata(properties = { MetadataProperties.GENERATED }) + private final LossiesImpl serviceClient; + + private final Instrumentation instrumentation; + + /** + * Initializes an instance of LossyClient class. + * + * @param serviceClient the service client implementation. + * @param instrumentation the instrumentation instance. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + LossyClient(LossiesImpl serviceClient, Instrumentation instrumentation) { + this.serviceClient = serviceClient; + this.instrumentation = instrumentation; + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intSecondsWithResponse(Duration input, RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Duration.Lossy.intSeconds", requestContext, + updatedContext -> this.serviceClient.intSecondsWithResponse(input, updatedContext)); + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public void intSeconds(Duration input) { + intSecondsWithResponse(input, RequestContext.none()); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intMillisecondsWithResponse(Duration input, RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Duration.Lossy.intMilliseconds", requestContext, + updatedContext -> this.serviceClient.intMillisecondsWithResponse(input, updatedContext)); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public void intMilliseconds(Duration input) { + intMillisecondsWithResponse(input, RequestContext.none()); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/DurationClientImpl.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/DurationClientImpl.java index 1d17d1a1d86..c32de17513d 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/DurationClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/DurationClientImpl.java @@ -14,7 +14,7 @@ public final class DurationClientImpl { /** * Gets Service host. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -28,7 +28,7 @@ public String getEndpoint() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -42,7 +42,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The instance of instrumentation to report telemetry. - * + * * @return the instrumentation value. */ public Instrumentation getInstrumentation() { @@ -56,7 +56,7 @@ public Instrumentation getInstrumentation() { /** * Gets the QueriesImpl object to access its operations. - * + * * @return the QueriesImpl object. */ public QueriesImpl getQueries() { @@ -70,7 +70,7 @@ public QueriesImpl getQueries() { /** * Gets the PropertiesImpl object to access its operations. - * + * * @return the PropertiesImpl object. */ public PropertiesImpl getProperties() { @@ -84,16 +84,30 @@ public PropertiesImpl getProperties() { /** * Gets the HeadersImpl object to access its operations. - * + * * @return the HeadersImpl object. */ public HeadersImpl getHeaders() { return this.headers; } + /** + * The LossiesImpl object to access its operations. + */ + private final LossiesImpl lossies; + + /** + * Gets the LossiesImpl object to access its operations. + * + * @return the LossiesImpl object. + */ + public LossiesImpl getLossies() { + return this.lossies; + } + /** * Initializes an instance of DurationClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param instrumentation The instance of instrumentation to report telemetry. * @param endpoint Service host. @@ -105,5 +119,6 @@ public DurationClientImpl(HttpPipeline httpPipeline, Instrumentation instrumenta this.queries = new QueriesImpl(this); this.properties = new PropertiesImpl(this); this.headers = new HeadersImpl(this); + this.lossies = new LossiesImpl(this); } } diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/LossiesImpl.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/LossiesImpl.java new file mode 100644 index 00000000000..cb208f5cdf5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/duration/implementation/LossiesImpl.java @@ -0,0 +1,120 @@ +package encode.duration.implementation; + +import io.clientcore.core.annotations.ReturnType; +import io.clientcore.core.annotations.ServiceInterface; +import io.clientcore.core.annotations.ServiceMethod; +import io.clientcore.core.http.annotations.HostParam; +import io.clientcore.core.http.annotations.HttpRequestInformation; +import io.clientcore.core.http.annotations.QueryParam; +import io.clientcore.core.http.annotations.UnexpectedResponseExceptionDetail; +import io.clientcore.core.http.models.HttpMethod; +import io.clientcore.core.http.models.HttpResponseException; +import io.clientcore.core.http.models.RequestContext; +import io.clientcore.core.http.models.Response; +import io.clientcore.core.http.pipeline.HttpPipeline; +import io.clientcore.core.instrumentation.Instrumentation; +import java.lang.reflect.InvocationTargetException; +import java.time.Duration; + +/** + * An instance of this class provides access to all the operations defined in Lossies. + */ +public final class LossiesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final LossiesService service; + + /** + * The service client containing this operation class. + */ + private final DurationClientImpl client; + + /** + * The instance of instrumentation to report telemetry. + */ + private final Instrumentation instrumentation; + + /** + * Initializes an instance of LossiesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LossiesImpl(DurationClientImpl client) { + this.service = LossiesService.getNewInstance(client.getHttpPipeline()); + this.client = client; + this.instrumentation = client.getInstrumentation(); + } + + /** + * The interface defining all the services for DurationClientLossies to be used by the proxy service to perform REST + * calls. + */ + @ServiceInterface(name = "DurationClientLossies", host = "{endpoint}") + public interface LossiesService { + static LossiesService getNewInstance(HttpPipeline pipeline) { + try { + Class clazz = Class.forName("encode.duration.implementation.LossiesServiceImpl"); + return (LossiesService) clazz.getMethod("getNewInstance", HttpPipeline.class).invoke(null, pipeline); + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException + | InvocationTargetException e) { + throw new RuntimeException(e); + } + + } + + @HttpRequestInformation( + method = HttpMethod.GET, + path = "/encode/duration/lossy/int32-seconds", + expectedStatusCodes = { 204 }) + @UnexpectedResponseExceptionDetail + Response intSeconds(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestContext requestContext); + + @HttpRequestInformation( + method = HttpMethod.GET, + path = "/encode/duration/lossy/int32-milliseconds", + expectedStatusCodes = { 204 }) + @UnexpectedResponseExceptionDetail + Response intMilliseconds(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestContext requestContext); + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intSecondsWithResponse(Duration input, RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Duration.Lossy.intSeconds", requestContext, + updatedContext -> { + long inputConverted = input.getSeconds(); + return service.intSeconds(this.client.getEndpoint(), inputConverted, updatedContext); + }); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intMillisecondsWithResponse(Duration input, RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Encode.Duration.Lossy.intMilliseconds", requestContext, + updatedContext -> { + long inputConverted = input.toMillis(); + return service.intMilliseconds(this.client.getEndpoint(), inputConverted, updatedContext); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java index 59303f3f77c..125617cfc83 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java @@ -36,7 +36,7 @@ public final class SpecialCharsImpl { /** * Initializes an instance of SpecialCharsImpl. - * + * * @param client the instance of the service client containing this operation class. */ SpecialCharsImpl(QueryClientImpl client) { @@ -65,7 +65,7 @@ static SpecialCharsService getNewInstance(HttpPipeline pipeline) { @HttpRequestInformation( method = HttpMethod.GET, - path = "/parameters/query/special-char/dollarSign", + path = "/parameters/query/special-char/dollar-sign", expectedStatusCodes = { 204 }) @UnexpectedResponseExceptionDetail Response dollarSign(@HostParam("endpoint") String endpoint, @QueryParam("$filter") String filter, @@ -74,7 +74,7 @@ Response dollarSign(@HostParam("endpoint") String endpoint, @QueryParam("$ /** * The dollarSign operation. - * + * * @param filter The filter parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/ExpandParameters.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/ExpandParameters.java new file mode 100644 index 00000000000..22cb7c36112 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/ExpandParameters.java @@ -0,0 +1,101 @@ +package routes; + +import io.clientcore.core.annotations.Metadata; +import io.clientcore.core.annotations.MetadataProperties; +import io.clientcore.core.serialization.json.JsonReader; +import io.clientcore.core.serialization.json.JsonSerializable; +import io.clientcore.core.serialization.json.JsonToken; +import io.clientcore.core.serialization.json.JsonWriter; +import java.io.IOException; + +/** + * A named model used to verify explode expansion of a model-valued query parameter. + */ +@Metadata(properties = { MetadataProperties.IMMUTABLE }) +public final class ExpandParameters implements JsonSerializable { + /* + * The field property. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private final String field; + + /* + * The value property. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + private final String value; + + /** + * Creates an instance of ExpandParameters class. + * + * @param field the field value to set. + * @param value the value value to set. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public ExpandParameters(String field, String value) { + this.field = field; + this.value = value; + } + + /** + * Get the field property: The field property. + * + * @return the field value. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public String getField() { + return this.field; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public String getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpandParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpandParameters 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 ExpandParameters. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + public static ExpandParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String field = null; + String value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("field".equals(fieldName)) { + field = reader.getString(); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ExpandParameters(field, value); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java index e0bdee5404d..c173ec97fbd 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java @@ -25,7 +25,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeClient class. - * + * * @param serviceClient the service client implementation. * @param instrumentation the instrumentation instance. */ @@ -38,7 +38,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * The primitive operation. - * + * * @param param The param parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,7 +55,7 @@ public Response primitiveWithResponse(String param, RequestContext request /** * The primitive operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the service returns an error. @@ -69,7 +69,7 @@ public void primitive(String param) { /** * The array operation. - * + * * @param param The param parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -86,7 +86,7 @@ public Response arrayWithResponse(List param, RequestContext reque /** * The array operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the service returns an error. @@ -100,7 +100,7 @@ public void array(List param) { /** * The record operation. - * + * * @param param The param parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,7 +117,7 @@ public Response recordWithResponse(Map param, RequestCont /** * The record operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the service returns an error. @@ -128,4 +128,35 @@ public Response recordWithResponse(Map param, RequestCont public void record(Map param) { recordWithResponse(param, RequestContext.none()); } + + /** + * The model operation. + * + * @param param The param parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public Response modelWithResponse(ExpandParameters param, RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Routes.QueryParameters.QueryExpansion.Explode.model", + requestContext, updatedContext -> this.serviceClient.modelWithResponse(param, updatedContext)); + } + + /** + * The model operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Metadata(properties = { MetadataProperties.GENERATED }) + @ServiceMethod(returns = ReturnType.SINGLE) + public void model(ExpandParameters param) { + modelWithResponse(param, RequestContext.none()); + } } diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java index c28681baf1a..72d46e9ea00 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java @@ -18,6 +18,7 @@ import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; +import routes.ExpandParameters; /** * An instance of this class provides access to all the operations defined in QueryParametersQueryExpansionExplodes. @@ -40,7 +41,7 @@ public final class QueryParametersQueryExpansionExplodesImpl { /** * Initializes an instance of QueryParametersQueryExpansionExplodesImpl. - * + * * @param client the instance of the service client containing this operation class. */ QueryParametersQueryExpansionExplodesImpl(RoutesClientImpl client) { @@ -92,11 +93,19 @@ Response array(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionDetail Response record(@HostParam("endpoint") String endpoint, @QueryParam("param") Map param, RequestContext requestContext); + + @HttpRequestInformation( + method = HttpMethod.GET, + path = "/routes/query/query-expansion/explode/model", + expectedStatusCodes = { 204 }) + @UnexpectedResponseExceptionDetail + Response model(@HostParam("endpoint") String endpoint, @QueryParam("param") ExpandParameters param, + RequestContext requestContext); } /** * The primitive operation. - * + * * @param param The param parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -114,7 +123,7 @@ public Response primitiveWithResponse(String param, RequestContext request /** * The array operation. - * + * * @param param The param parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -134,7 +143,7 @@ public Response arrayWithResponse(List param, RequestContext reque /** * The record operation. - * + * * @param param The param parameter. * @param requestContext The context to configure the HTTP request before HTTP client sends it. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -149,4 +158,22 @@ public Response recordWithResponse(Map param, RequestCont return service.record(this.client.getEndpoint(), param, updatedContext); }); } + + /** + * The model operation. + * + * @param param The param parameter. + * @param requestContext The context to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the service returns an error. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response modelWithResponse(ExpandParameters param, RequestContext requestContext) { + return this.instrumentation.instrumentWithResponse("Routes.QueryParameters.QueryExpansion.Explode.model", + requestContext, updatedContext -> { + return service.model(this.client.getEndpoint(), param, updatedContext); + }); + } } diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json new file mode 100644 index 00000000000..2426d3497d0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json @@ -0,0 +1 @@ +{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Encode.Boolean","crossLanguageVersion":"774ecf75d81f","crossLanguageDefinitions":{"encode.booleannamespace.BooleanClient":"Encode.Boolean.Property","encode.booleannamespace.BooleanClientBuilder":"Encode.Boolean","encode.booleannamespace.property.BoolAsStringProperty":"Encode.Boolean.Property.BoolAsStringProperty"},"generatedFiles":["src/main/java/encode/booleannamespace/BooleanClient.java","src/main/java/encode/booleannamespace/BooleanClientBuilder.java","src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java","src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java","src/main/java/encode/booleannamespace/implementation/package-info.java","src/main/java/encode/booleannamespace/package-info.java","src/main/java/encode/booleannamespace/property/BoolAsStringProperty.java","src/main/java/encode/booleannamespace/property/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-duration_metadata.json b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-duration_metadata.json index 37c266069b8..774e8d7c24a 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-duration_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/encode-duration_metadata.json @@ -1 +1 @@ -{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Encode.Duration","crossLanguageVersion":"59d442353391","crossLanguageDefinitions":{"encode.duration.DurationClientBuilder":"Encode.Duration","encode.duration.HeaderClient":"Encode.Duration.Header","encode.duration.PropertyClient":"Encode.Duration.Property","encode.duration.QueryClient":"Encode.Duration.Query","encode.duration.property.DefaultDurationProperty":"Encode.Duration.Property.DefaultDurationProperty","encode.duration.property.Float64MillisecondsDurationProperty":"Encode.Duration.Property.Float64MillisecondsDurationProperty","encode.duration.property.Float64SecondsDurationProperty":"Encode.Duration.Property.Float64SecondsDurationProperty","encode.duration.property.FloatMillisecondsDurationArrayProperty":"Encode.Duration.Property.FloatMillisecondsDurationArrayProperty","encode.duration.property.FloatMillisecondsDurationProperty":"Encode.Duration.Property.FloatMillisecondsDurationProperty","encode.duration.property.FloatMillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatMillisecondsLargerUnitDurationProperty","encode.duration.property.FloatSecondsDurationArrayProperty":"Encode.Duration.Property.FloatSecondsDurationArrayProperty","encode.duration.property.FloatSecondsDurationProperty":"Encode.Duration.Property.FloatSecondsDurationProperty","encode.duration.property.FloatSecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatSecondsLargerUnitDurationProperty","encode.duration.property.ISO8601DurationProperty":"Encode.Duration.Property.ISO8601DurationProperty","encode.duration.property.Int32MillisecondsDurationProperty":"Encode.Duration.Property.Int32MillisecondsDurationProperty","encode.duration.property.Int32MillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32MillisecondsLargerUnitDurationProperty","encode.duration.property.Int32SecondsDurationProperty":"Encode.Duration.Property.Int32SecondsDurationProperty","encode.duration.property.Int32SecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32SecondsLargerUnitDurationProperty"},"generatedFiles":["src/main/java/encode/duration/DurationClientBuilder.java","src/main/java/encode/duration/HeaderClient.java","src/main/java/encode/duration/PropertyClient.java","src/main/java/encode/duration/QueryClient.java","src/main/java/encode/duration/implementation/DurationClientImpl.java","src/main/java/encode/duration/implementation/HeadersImpl.java","src/main/java/encode/duration/implementation/PropertiesImpl.java","src/main/java/encode/duration/implementation/QueriesImpl.java","src/main/java/encode/duration/implementation/package-info.java","src/main/java/encode/duration/package-info.java","src/main/java/encode/duration/property/DefaultDurationProperty.java","src/main/java/encode/duration/property/Float64MillisecondsDurationProperty.java","src/main/java/encode/duration/property/Float64SecondsDurationProperty.java","src/main/java/encode/duration/property/FloatMillisecondsDurationArrayProperty.java","src/main/java/encode/duration/property/FloatMillisecondsDurationProperty.java","src/main/java/encode/duration/property/FloatMillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/FloatSecondsDurationArrayProperty.java","src/main/java/encode/duration/property/FloatSecondsDurationProperty.java","src/main/java/encode/duration/property/FloatSecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/ISO8601DurationProperty.java","src/main/java/encode/duration/property/Int32MillisecondsDurationProperty.java","src/main/java/encode/duration/property/Int32MillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/Int32SecondsDurationProperty.java","src/main/java/encode/duration/property/Int32SecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Encode.Duration","crossLanguageVersion":"1d6dc20e6d13","crossLanguageDefinitions":{"encode.duration.DurationClientBuilder":"Encode.Duration","encode.duration.HeaderClient":"Encode.Duration.Header","encode.duration.LossyClient":"Encode.Duration.Lossy","encode.duration.PropertyClient":"Encode.Duration.Property","encode.duration.QueryClient":"Encode.Duration.Query","encode.duration.property.DefaultDurationProperty":"Encode.Duration.Property.DefaultDurationProperty","encode.duration.property.Float64MillisecondsDurationProperty":"Encode.Duration.Property.Float64MillisecondsDurationProperty","encode.duration.property.Float64SecondsDurationProperty":"Encode.Duration.Property.Float64SecondsDurationProperty","encode.duration.property.FloatMillisecondsDurationArrayProperty":"Encode.Duration.Property.FloatMillisecondsDurationArrayProperty","encode.duration.property.FloatMillisecondsDurationProperty":"Encode.Duration.Property.FloatMillisecondsDurationProperty","encode.duration.property.FloatMillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatMillisecondsLargerUnitDurationProperty","encode.duration.property.FloatSecondsDurationArrayProperty":"Encode.Duration.Property.FloatSecondsDurationArrayProperty","encode.duration.property.FloatSecondsDurationProperty":"Encode.Duration.Property.FloatSecondsDurationProperty","encode.duration.property.FloatSecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatSecondsLargerUnitDurationProperty","encode.duration.property.ISO8601DurationProperty":"Encode.Duration.Property.ISO8601DurationProperty","encode.duration.property.Int32MillisecondsDurationProperty":"Encode.Duration.Property.Int32MillisecondsDurationProperty","encode.duration.property.Int32MillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32MillisecondsLargerUnitDurationProperty","encode.duration.property.Int32SecondsDurationProperty":"Encode.Duration.Property.Int32SecondsDurationProperty","encode.duration.property.Int32SecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32SecondsLargerUnitDurationProperty"},"generatedFiles":["src/main/java/encode/duration/DurationClientBuilder.java","src/main/java/encode/duration/HeaderClient.java","src/main/java/encode/duration/LossyClient.java","src/main/java/encode/duration/PropertyClient.java","src/main/java/encode/duration/QueryClient.java","src/main/java/encode/duration/implementation/DurationClientImpl.java","src/main/java/encode/duration/implementation/HeadersImpl.java","src/main/java/encode/duration/implementation/LossiesImpl.java","src/main/java/encode/duration/implementation/PropertiesImpl.java","src/main/java/encode/duration/implementation/QueriesImpl.java","src/main/java/encode/duration/implementation/package-info.java","src/main/java/encode/duration/package-info.java","src/main/java/encode/duration/property/DefaultDurationProperty.java","src/main/java/encode/duration/property/Float64MillisecondsDurationProperty.java","src/main/java/encode/duration/property/Float64SecondsDurationProperty.java","src/main/java/encode/duration/property/FloatMillisecondsDurationArrayProperty.java","src/main/java/encode/duration/property/FloatMillisecondsDurationProperty.java","src/main/java/encode/duration/property/FloatMillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/FloatSecondsDurationArrayProperty.java","src/main/java/encode/duration/property/FloatSecondsDurationProperty.java","src/main/java/encode/duration/property/FloatSecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/ISO8601DurationProperty.java","src/main/java/encode/duration/property/Int32MillisecondsDurationProperty.java","src/main/java/encode/duration/property/Int32MillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/Int32SecondsDurationProperty.java","src/main/java/encode/duration/property/Int32SecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/parameters-query_metadata.json b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/parameters-query_metadata.json index d491ee294d3..dc130bc05cc 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/parameters-query_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/parameters-query_metadata.json @@ -1 +1 @@ -{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Parameters.Query","crossLanguageVersion":"d221aa20c419","crossLanguageDefinitions":{"parameters.query.ConstantClient":"Parameters.Query.Constant","parameters.query.QueryClientBuilder":"Parameters.Query","parameters.query.SpecialCharClient":"Parameters.Query.SpecialChar"},"generatedFiles":["src/main/java/module-info.java","src/main/java/parameters/query/ConstantClient.java","src/main/java/parameters/query/QueryClientBuilder.java","src/main/java/parameters/query/SpecialCharClient.java","src/main/java/parameters/query/implementation/ConstantsImpl.java","src/main/java/parameters/query/implementation/QueryClientImpl.java","src/main/java/parameters/query/implementation/SpecialCharsImpl.java","src/main/java/parameters/query/implementation/package-info.java","src/main/java/parameters/query/package-info.java"]} \ No newline at end of file +{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Parameters.Query","crossLanguageVersion":"8e99b5930726","crossLanguageDefinitions":{"parameters.query.ConstantClient":"Parameters.Query.Constant","parameters.query.QueryClientBuilder":"Parameters.Query","parameters.query.SpecialCharClient":"Parameters.Query.SpecialChar"},"generatedFiles":["src/main/java/module-info.java","src/main/java/parameters/query/ConstantClient.java","src/main/java/parameters/query/QueryClientBuilder.java","src/main/java/parameters/query/SpecialCharClient.java","src/main/java/parameters/query/implementation/ConstantsImpl.java","src/main/java/parameters/query/implementation/QueryClientImpl.java","src/main/java/parameters/query/implementation/SpecialCharsImpl.java","src/main/java/parameters/query/implementation/package-info.java","src/main/java/parameters/query/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/routes_metadata.json b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/routes_metadata.json index b05e1d935f9..1790467ca85 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/routes_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/resources/META-INF/routes_metadata.json @@ -1 +1 @@ -{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Routes","crossLanguageVersion":"61e0326a00d1","crossLanguageDefinitions":{"routes.InInterfaceClient":"Routes.InInterface","routes.PathParametersClient":"Routes.PathParameters","routes.PathParametersLabelExpansionExplodeClient":"Routes.PathParameters.LabelExpansion.Explode","routes.PathParametersLabelExpansionStandardClient":"Routes.PathParameters.LabelExpansion.Standard","routes.PathParametersMatrixExpansionExplodeClient":"Routes.PathParameters.MatrixExpansion.Explode","routes.PathParametersMatrixExpansionStandardClient":"Routes.PathParameters.MatrixExpansion.Standard","routes.PathParametersPathExpansionExplodeClient":"Routes.PathParameters.PathExpansion.Explode","routes.PathParametersPathExpansionStandardClient":"Routes.PathParameters.PathExpansion.Standard","routes.PathParametersReservedExpansionClient":"Routes.PathParameters.ReservedExpansion","routes.PathParametersSimpleExpansionExplodeClient":"Routes.PathParameters.SimpleExpansion.Explode","routes.PathParametersSimpleExpansionStandardClient":"Routes.PathParameters.SimpleExpansion.Standard","routes.QueryParametersClient":"Routes.QueryParameters","routes.QueryParametersQueryContinuationExplodeClient":"Routes.QueryParameters.QueryContinuation.Explode","routes.QueryParametersQueryContinuationStandardClient":"Routes.QueryParameters.QueryContinuation.Standard","routes.QueryParametersQueryExpansionExplodeClient":"Routes.QueryParameters.QueryExpansion.Explode","routes.QueryParametersQueryExpansionStandardClient":"Routes.QueryParameters.QueryExpansion.Standard","routes.RoutesClient":"Routes","routes.RoutesClientBuilder":"Routes"},"generatedFiles":["src/main/java/module-info.java","src/main/java/routes/InInterfaceClient.java","src/main/java/routes/PathParametersClient.java","src/main/java/routes/PathParametersLabelExpansionExplodeClient.java","src/main/java/routes/PathParametersLabelExpansionStandardClient.java","src/main/java/routes/PathParametersMatrixExpansionExplodeClient.java","src/main/java/routes/PathParametersMatrixExpansionStandardClient.java","src/main/java/routes/PathParametersPathExpansionExplodeClient.java","src/main/java/routes/PathParametersPathExpansionStandardClient.java","src/main/java/routes/PathParametersReservedExpansionClient.java","src/main/java/routes/PathParametersSimpleExpansionExplodeClient.java","src/main/java/routes/PathParametersSimpleExpansionStandardClient.java","src/main/java/routes/QueryParametersClient.java","src/main/java/routes/QueryParametersQueryContinuationExplodeClient.java","src/main/java/routes/QueryParametersQueryContinuationStandardClient.java","src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java","src/main/java/routes/QueryParametersQueryExpansionStandardClient.java","src/main/java/routes/RoutesClient.java","src/main/java/routes/RoutesClientBuilder.java","src/main/java/routes/implementation/InInterfacesImpl.java","src/main/java/routes/implementation/PathParametersImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersReservedExpansionsImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java","src/main/java/routes/implementation/QueryParametersImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java","src/main/java/routes/implementation/RoutesClientImpl.java","src/main/java/routes/implementation/package-info.java","src/main/java/routes/package-info.java"]} \ No newline at end of file +{"flavor":"generic","apiVersions":{},"crossLanguagePackageId":"Routes","crossLanguageVersion":"c6a64c6e889c","crossLanguageDefinitions":{"routes.ExpandParameters":"Routes.ExpandParameters","routes.InInterfaceClient":"Routes.InInterface","routes.PathParametersClient":"Routes.PathParameters","routes.PathParametersLabelExpansionExplodeClient":"Routes.PathParameters.LabelExpansion.Explode","routes.PathParametersLabelExpansionStandardClient":"Routes.PathParameters.LabelExpansion.Standard","routes.PathParametersMatrixExpansionExplodeClient":"Routes.PathParameters.MatrixExpansion.Explode","routes.PathParametersMatrixExpansionStandardClient":"Routes.PathParameters.MatrixExpansion.Standard","routes.PathParametersPathExpansionExplodeClient":"Routes.PathParameters.PathExpansion.Explode","routes.PathParametersPathExpansionStandardClient":"Routes.PathParameters.PathExpansion.Standard","routes.PathParametersReservedExpansionClient":"Routes.PathParameters.ReservedExpansion","routes.PathParametersSimpleExpansionExplodeClient":"Routes.PathParameters.SimpleExpansion.Explode","routes.PathParametersSimpleExpansionStandardClient":"Routes.PathParameters.SimpleExpansion.Standard","routes.QueryParametersClient":"Routes.QueryParameters","routes.QueryParametersQueryContinuationExplodeClient":"Routes.QueryParameters.QueryContinuation.Explode","routes.QueryParametersQueryContinuationStandardClient":"Routes.QueryParameters.QueryContinuation.Standard","routes.QueryParametersQueryExpansionExplodeClient":"Routes.QueryParameters.QueryExpansion.Explode","routes.QueryParametersQueryExpansionStandardClient":"Routes.QueryParameters.QueryExpansion.Standard","routes.RoutesClient":"Routes","routes.RoutesClientBuilder":"Routes"},"generatedFiles":["src/main/java/module-info.java","src/main/java/routes/ExpandParameters.java","src/main/java/routes/InInterfaceClient.java","src/main/java/routes/PathParametersClient.java","src/main/java/routes/PathParametersLabelExpansionExplodeClient.java","src/main/java/routes/PathParametersLabelExpansionStandardClient.java","src/main/java/routes/PathParametersMatrixExpansionExplodeClient.java","src/main/java/routes/PathParametersMatrixExpansionStandardClient.java","src/main/java/routes/PathParametersPathExpansionExplodeClient.java","src/main/java/routes/PathParametersPathExpansionStandardClient.java","src/main/java/routes/PathParametersReservedExpansionClient.java","src/main/java/routes/PathParametersSimpleExpansionExplodeClient.java","src/main/java/routes/PathParametersSimpleExpansionStandardClient.java","src/main/java/routes/QueryParametersClient.java","src/main/java/routes/QueryParametersQueryContinuationExplodeClient.java","src/main/java/routes/QueryParametersQueryContinuationStandardClient.java","src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java","src/main/java/routes/QueryParametersQueryExpansionStandardClient.java","src/main/java/routes/RoutesClient.java","src/main/java/routes/RoutesClientBuilder.java","src/main/java/routes/implementation/InInterfacesImpl.java","src/main/java/routes/implementation/PathParametersImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersReservedExpansionsImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java","src/main/java/routes/implementation/QueryParametersImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java","src/main/java/routes/implementation/RoutesClientImpl.java","src/main/java/routes/implementation/package-info.java","src/main/java/routes/package-info.java"]} \ No newline at end of file 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 7336530b5ae..49406e6d557 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,27 +12,27 @@ "spector-stop": "tsp-spector server stop" }, "dependencies": { - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/spec-api": "0.1.0-alpha.14", - "@typespec/http-specs": "0.1.0-alpha.38", - "@azure-tools/azure-http-specs": "0.1.0-alpha.42", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/spec-api": "0.1.0-alpha.15", + "@typespec/http-specs": "0.1.0-alpha.39", + "@azure-tools/azure-http-specs": "0.1.0-alpha.43", "@typespec/http-client-java": "file:../../typespec-http-client-java-0.9.0.tgz", "@typespec/http-client-java-tests": "file:" }, "overrides": { - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/openapi": "1.13.0", - "@typespec/xml": "0.83.0", - "@typespec/events": "0.83.0", - "@typespec/sse": "0.83.0", - "@typespec/streams": "0.83.0", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-client-generator-core": "0.69.2", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-autorest": "0.69.1" + "@typespec/compiler": "1.14.0", + "@typespec/http": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/openapi": "1.14.0", + "@typespec/xml": "0.84.0", + "@typespec/events": "0.84.0", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-autorest": "0.70.0" }, "private": true } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java index 6ef5879917e..0643f9b4f58 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java @@ -16,8 +16,8 @@ */ public interface LargeHeadersClient { /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,8 +30,8 @@ SyncPoller, CancelResultInner> beginTwo6k(String r String largeHeaderName); /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -45,8 +45,8 @@ SyncPoller, CancelResultInner> beginTwo6k(String r String largeHeaderName, Context context); /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -58,8 +58,8 @@ SyncPoller, CancelResultInner> beginTwo6k(String r CancelResultInner two6k(String resourceGroupName, String largeHeaderName); /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java index c5df0d843e6..64190f72e4c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java @@ -47,7 +47,7 @@ public final class LargeHeadersClientImpl implements LargeHeadersClient { /** * Initializes an instance of LargeHeadersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LargeHeadersClientImpl(LargeHeaderClientImpl client) { @@ -85,8 +85,8 @@ Response two6kSync(@HostParam("endpoint") String endpoint, } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,8 +104,8 @@ private Mono>> two6kWithResponseAsync(String resourceG } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -121,8 +121,8 @@ private Response two6kWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -139,8 +139,8 @@ private Response two6kWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,8 +157,8 @@ private PollerFlux, CancelResultInner> beginTwo6kA } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -175,8 +175,8 @@ public SyncPoller, CancelResultInner> beginTwo6k(S } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -194,8 +194,8 @@ public SyncPoller, CancelResultInner> beginTwo6k(S } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -210,8 +210,8 @@ private Mono two6kAsync(String resourceGroupName, String larg } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -225,8 +225,8 @@ public CancelResultInner two6k(String resourceGroupName, String largeHeaderName) } /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java index 99ac162675d..b07c442552f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java @@ -11,8 +11,8 @@ */ public interface LargeHeaders { /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -23,8 +23,8 @@ public interface LargeHeaders { CancelResult two6k(String resourceGroupName, String largeHeaderName); /** - * A long-running resource action. - * + * The two6k operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java index 6e8e3ac2618..0c3baa5636a 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java @@ -15,8 +15,8 @@ */ public interface LroPagingsClient { /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,8 +28,8 @@ public interface LroPagingsClient { PagedIterable postPagingLro(String resourceGroupName, String productName); /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. 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 index 25550dca7a5..039f5a4ce6d 100644 --- 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 @@ -20,7 +20,7 @@ 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. @@ -36,7 +36,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * 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. @@ -53,7 +53,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * 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. @@ -67,7 +67,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * 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. @@ -81,8 +81,8 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou OrderInner createOrReplace(String resourceGroupName, String orderName, OrderInner resource, Context context); /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -96,8 +96,8 @@ SyncPoller, ExportResultInner> beginExport(String ExportRequest body); /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -112,8 +112,8 @@ SyncPoller, ExportResultInner> beginExport(String ExportRequest body, Context context); /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -126,8 +126,8 @@ SyncPoller, ExportResultInner> beginExport(String ExportResultInner export(String resourceGroupName, String orderName, ExportRequest body); /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -142,7 +142,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -155,7 +155,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -169,7 +169,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -181,7 +181,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -194,7 +194,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -206,7 +206,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -220,7 +220,7 @@ SyncPoller>, List> beginEx /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -232,7 +232,7 @@ SyncPoller>, List> beginEx /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java index e4beba13bb4..7e2f603bb65 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java @@ -50,7 +50,7 @@ public final class LroPagingsClientImpl implements LroPagingsClient { /** * Initializes an instance of LroPagingsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroPagingsClientImpl(OperationTemplatesClientImpl client) { @@ -102,8 +102,8 @@ Response postPagingLroNextSync( } /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -136,8 +136,8 @@ private Mono> postPagingLroSinglePageAsync(String re } /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -152,8 +152,8 @@ private PagedFlux postPagingLroAsync(String resourceGroupName, Str } /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -175,8 +175,8 @@ private PagedResponse postPagingLroSinglePage(String resourceGroup } /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. @@ -200,8 +200,8 @@ private PagedResponse postPagingLroSinglePage(String resourceGroup } /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,8 +216,8 @@ public PagedIterable postPagingLro(String resourceGroupName, Strin } /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. @@ -234,7 +234,7 @@ public PagedIterable postPagingLro(String resourceGroupName, Strin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -254,7 +254,7 @@ private Mono> postPagingLroNextSinglePageAsync(Strin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -272,7 +272,7 @@ private PagedResponse postPagingLroNextSinglePage(String nextLink) /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index c9de25e34a7..52d40164eaa 100644 --- 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 @@ -54,7 +54,7 @@ public final class LroesClientImpl implements LroesClient { /** * Initializes an instance of LroesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroesClientImpl(OperationTemplatesClientImpl client) { @@ -142,7 +142,7 @@ Response exportArraySync(@HostParam("endpoint") String endpoint, /** * 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. @@ -165,7 +165,7 @@ private Mono>> createOrReplaceWithResponseAsync(String /** * 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. @@ -186,7 +186,7 @@ private Response createOrReplaceWithResponse(String resourceGroupNam /** * 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. @@ -208,7 +208,7 @@ private Response createOrReplaceWithResponse(String resourceGroupNam /** * 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. @@ -229,7 +229,7 @@ private PollerFlux, OrderInner> beginCreateOrReplaceAsync /** * 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. @@ -249,7 +249,7 @@ public SyncPoller, OrderInner> beginCreateOrReplace(Strin /** * 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. @@ -269,7 +269,7 @@ public SyncPoller, OrderInner> beginCreateOrReplace(Strin /** * 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. @@ -287,7 +287,7 @@ private Mono createOrReplaceAsync(String resourceGroupName, String o /** * 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. @@ -303,7 +303,7 @@ public OrderInner createOrReplace(String resourceGroupName, String orderName, Or /** * 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. @@ -320,8 +320,8 @@ public OrderInner createOrReplace(String resourceGroupName, String orderName, Or } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -342,8 +342,8 @@ private Mono>> exportWithResponseAsync(String resource } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -361,8 +361,8 @@ private Response exportWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -382,8 +382,8 @@ private Response exportWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -401,8 +401,8 @@ private PollerFlux, ExportResultInner> beginExport } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -420,8 +420,8 @@ public SyncPoller, ExportResultInner> beginExport( } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -440,8 +440,8 @@ public SyncPoller, ExportResultInner> beginExport( } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -457,8 +457,8 @@ private Mono exportAsync(String resourceGroupName, String ord } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -473,8 +473,8 @@ public ExportResultInner export(String resourceGroupName, String orderName, Expo } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -491,7 +491,7 @@ public ExportResultInner export(String resourceGroupName, String orderName, Expo /** * 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. @@ -509,7 +509,7 @@ private Mono>> deleteWithResponseAsync(String resource /** * 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. @@ -525,7 +525,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * 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. @@ -542,7 +542,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * 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. @@ -559,7 +559,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * 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. @@ -575,7 +575,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -592,7 +592,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -607,7 +607,7 @@ private Mono deleteAsync(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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -621,7 +621,7 @@ public 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. @@ -636,7 +636,7 @@ public void delete(String resourceGroupName, String orderName, Context context) /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -655,7 +655,7 @@ private Mono>> exportArrayWithResponseAsync(ExportRequ /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -672,7 +672,7 @@ private Response exportArrayWithResponse(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -690,7 +690,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -709,7 +709,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -728,7 +728,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -748,7 +748,7 @@ public SyncPoller>, List> /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -762,7 +762,7 @@ private Mono> exportArrayAsync(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -776,7 +776,7 @@ public List exportArray(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java index 586542437d4..1aee18a2904 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java @@ -12,8 +12,8 @@ */ public interface LroPagings { /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,8 +24,8 @@ public interface LroPagings { PagedIterable postPagingLro(String resourceGroupName, String productName); /** - * A long-running resource action. - * + * The postPagingLro operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. 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 index 6ec7337eed6..b7806be61da 100644 --- 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 @@ -12,8 +12,8 @@ */ public interface Lroes { /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -25,8 +25,8 @@ public interface Lroes { ExportResult export(String resourceGroupName, String orderName, ExportRequest body); /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -40,7 +40,7 @@ public interface Lroes { /** * 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. @@ -51,7 +51,7 @@ public interface Lroes { /** * 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. @@ -63,7 +63,7 @@ public interface Lroes { /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -74,7 +74,7 @@ public interface Lroes { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -86,7 +86,7 @@ public interface Lroes { /** * 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. @@ -96,7 +96,7 @@ public interface Lroes { /** * 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. @@ -107,7 +107,7 @@ public interface Lroes { /** * Begins definition for a new Order resource. - * + * * @param name resource name. * @return the first stage of the new Order definition. */ 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 index 9155502b9e3..26cc9f8300a 100644 --- 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 @@ -16,70 +16,70 @@ 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(); @@ -107,7 +107,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -115,7 +115,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -128,7 +128,7 @@ interface WithLocation { interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -142,14 +142,14 @@ interface WithResourceGroup { 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. */ @@ -162,7 +162,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -175,7 +175,7 @@ interface WithTags { 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. */ @@ -184,8 +184,8 @@ interface WithProperties { } /** - * A long-running resource action. - * + * The export operation. + * * @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. @@ -195,8 +195,8 @@ interface WithProperties { ExportResult export(ExportRequest body); /** - * A long-running resource action. - * + * The export operation. + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanAsyncClient.java new file mode 100644 index 00000000000..30ba1960214 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanAsyncClient.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.booleannamespace; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import encode.booleannamespace.implementation.PropertiesImpl; +import encode.booleannamespace.property.models.BoolAsStringProperty; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous BooleanClient type. + */ +@ServiceClient(builder = BooleanClientBuilder.class, isAsync = true) +public final class BooleanAsyncClient { + @Generated + private final PropertiesImpl serviceClient; + + /** + * Initializes an instance of BooleanAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + BooleanAsyncClient(PropertiesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The trueLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> trueLowerWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.trueLowerWithResponseAsync(value, requestOptions); + } + + /** + * The falseLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> falseLowerWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.falseLowerWithResponseAsync(value, requestOptions); + } + + /** + * The trueUpper operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> trueUpperWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.trueUpperWithResponseAsync(value, requestOptions); + } + + /** + * The falseMixed operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> falseMixedWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.falseMixedWithResponseAsync(value, requestOptions); + } + + /** + * The trueLower operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono trueLower(BoolAsStringProperty value) { + // Generated convenience method for trueLowerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return trueLowerWithResponse(BinaryData.fromObject(value), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BoolAsStringProperty.class)); + } + + /** + * The falseLower operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono falseLower(BoolAsStringProperty value) { + // Generated convenience method for falseLowerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return falseLowerWithResponse(BinaryData.fromObject(value), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BoolAsStringProperty.class)); + } + + /** + * The trueUpper operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono trueUpper(BoolAsStringProperty value) { + // Generated convenience method for trueUpperWithResponse + RequestOptions requestOptions = new RequestOptions(); + return trueUpperWithResponse(BinaryData.fromObject(value), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BoolAsStringProperty.class)); + } + + /** + * The falseMixed operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono falseMixed(BoolAsStringProperty value) { + // Generated convenience method for falseMixedWithResponse + RequestOptions requestOptions = new RequestOptions(); + return falseMixedWithResponse(BinaryData.fromObject(value), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(BoolAsStringProperty.class)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClient.java new file mode 100644 index 00000000000..772ce69914b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClient.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.booleannamespace; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import encode.booleannamespace.implementation.PropertiesImpl; +import encode.booleannamespace.property.models.BoolAsStringProperty; + +/** + * Initializes a new instance of the synchronous BooleanClient type. + */ +@ServiceClient(builder = BooleanClientBuilder.class) +public final class BooleanClient { + @Generated + private final PropertiesImpl serviceClient; + + /** + * Initializes an instance of BooleanClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + BooleanClient(PropertiesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The trueLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trueLowerWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.trueLowerWithResponse(value, requestOptions); + } + + /** + * The falseLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response falseLowerWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.falseLowerWithResponse(value, requestOptions); + } + + /** + * The trueUpper operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response trueUpperWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.trueUpperWithResponse(value, requestOptions); + } + + /** + * The falseMixed operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response falseMixedWithResponse(BinaryData value, RequestOptions requestOptions) { + return this.serviceClient.falseMixedWithResponse(value, requestOptions); + } + + /** + * The trueLower operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty trueLower(BoolAsStringProperty value) { + // Generated convenience method for trueLowerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return trueLowerWithResponse(BinaryData.fromObject(value), requestOptions).getValue() + .toObject(BoolAsStringProperty.class); + } + + /** + * The falseLower operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty falseLower(BoolAsStringProperty value) { + // Generated convenience method for falseLowerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return falseLowerWithResponse(BinaryData.fromObject(value), requestOptions).getValue() + .toObject(BoolAsStringProperty.class); + } + + /** + * The trueUpper operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty trueUpper(BoolAsStringProperty value) { + // Generated convenience method for trueUpperWithResponse + RequestOptions requestOptions = new RequestOptions(); + return trueUpperWithResponse(BinaryData.fromObject(value), requestOptions).getValue() + .toObject(BoolAsStringProperty.class); + } + + /** + * The falseMixed operation. + * + * @param value The value parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BoolAsStringProperty falseMixed(BoolAsStringProperty value) { + // Generated convenience method for falseMixedWithResponse + RequestOptions requestOptions = new RequestOptions(); + return falseMixedWithResponse(BinaryData.fromObject(value), requestOptions).getValue() + .toObject(BoolAsStringProperty.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.java new file mode 100644 index 00000000000..41dba09f430 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/BooleanClientBuilder.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 encode.booleannamespace; + +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 encode.booleannamespace.implementation.BooleanClientImpl; +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 BooleanClient type. + */ +@ServiceClientBuilder(serviceClients = { BooleanClient.class, BooleanAsyncClient.class }) +public final class BooleanClientBuilder 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("encode-booleannamespace.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the BooleanClientBuilder. + */ + @Generated + public BooleanClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BooleanClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BooleanClientBuilder 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 logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BooleanClientBuilder 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 BooleanClientBuilder 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 BooleanClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BooleanClientBuilder 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 BooleanClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BooleanClientBuilder 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 BooleanClientBuilder. + */ + @Generated + public BooleanClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of BooleanClientImpl with the provided parameters. + * + * @return an instance of BooleanClientImpl. + */ + @Generated + private BooleanClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + BooleanClientImpl client + = new BooleanClientImpl(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 BooleanAsyncClient class. + * + * @return an instance of BooleanAsyncClient. + */ + @Generated + public BooleanAsyncClient buildAsyncClient() { + return new BooleanAsyncClient(buildInnerClient().getProperties()); + } + + /** + * Builds an instance of BooleanClient class. + * + * @return an instance of BooleanClient. + */ + @Generated + public BooleanClient buildClient() { + return new BooleanClient(buildInnerClient().getProperties()); + } + + private static final ClientLogger LOGGER = new ClientLogger(BooleanClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java new file mode 100644 index 00000000000..d84bceb1f41 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.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 encode.booleannamespace.implementation; + +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.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; + +/** + * Initializes a new instance of the BooleanClient type. + */ +public final class BooleanClientImpl { + /** + * 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; + } + + /** + * The PropertiesImpl object to access its operations. + */ + private final PropertiesImpl properties; + + /** + * Gets the PropertiesImpl object to access its operations. + * + * @return the PropertiesImpl object. + */ + public PropertiesImpl getProperties() { + return this.properties; + } + + /** + * Initializes an instance of BooleanClient client. + * + * @param endpoint Service host. + */ + public BooleanClientImpl(String endpoint) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of BooleanClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + */ + public BooleanClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of BooleanClient 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 BooleanClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.properties = new PropertiesImpl(this); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java new file mode 100644 index 00000000000..71968c5b18b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.booleannamespace.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +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 Properties. + */ +public final class PropertiesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PropertiesService service; + + /** + * The service client containing this operation class. + */ + private final BooleanClientImpl client; + + /** + * Initializes an instance of PropertiesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PropertiesImpl(BooleanClientImpl client) { + this.service + = RestProxy.create(PropertiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BooleanClientProperties to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "BooleanClientProperties") + public interface PropertiesService { + @Post("/encode/boolean/property/true-lower") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> trueLower(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/true-lower") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trueLowerSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/false-lower") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> falseLower(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/false-lower") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response falseLowerSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/true-upper") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> trueUpper(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/true-upper") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trueUpperSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/false-mixed") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> falseMixed(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + + @Post("/encode/boolean/property/false-mixed") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response falseMixedSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData value, RequestOptions requestOptions, Context context); + } + + /** + * The trueLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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> trueLowerWithResponseAsync(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.trueLower(this.client.getEndpoint(), contentType, accept, value, + requestOptions, context)); + } + + /** + * The trueLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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 trueLowerWithResponse(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.trueLowerSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, + Context.NONE); + } + + /** + * The falseLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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> falseLowerWithResponseAsync(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.falseLower(this.client.getEndpoint(), contentType, accept, value, + requestOptions, context)); + } + + /** + * The falseLower operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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 falseLowerWithResponse(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.falseLowerSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, + Context.NONE); + } + + /** + * The trueUpper operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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> trueUpperWithResponseAsync(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.trueUpper(this.client.getEndpoint(), contentType, accept, value, + requestOptions, context)); + } + + /** + * The trueUpper operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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 trueUpperWithResponse(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.trueUpperSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, + Context.NONE); + } + + /** + * The falseMixed operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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> falseMixedWithResponseAsync(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.falseMixed(this.client.getEndpoint(), contentType, accept, value, + requestOptions, context)); + } + + /** + * The falseMixed operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param value The value parameter. + * @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 falseMixedWithResponse(BinaryData value, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.falseMixedSync(this.client.getEndpoint(), contentType, accept, value, requestOptions, + Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/implementation/package-info.java new file mode 100644 index 00000000000..3372f7c6f22 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/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 BooleanModel. + * Test for encode decorator on boolean. + * + */ +package encode.booleannamespace.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/package-info.java new file mode 100644 index 00000000000..7b68906f914 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/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 BooleanModel. + * Test for encode decorator on boolean. + * + */ +package encode.booleannamespace; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/BoolAsStringProperty.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/BoolAsStringProperty.java new file mode 100644 index 00000000000..74de0121c59 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/BoolAsStringProperty.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.booleannamespace.property.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 BoolAsStringProperty model. + */ +@Immutable +public final class BoolAsStringProperty implements JsonSerializable { + /* + * The value property. + */ + @Generated + private final boolean value; + + /** + * Creates an instance of BoolAsStringProperty class. + * + * @param value the value value to set. + */ + @Generated + public BoolAsStringProperty(boolean value) { + this.value = value; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public boolean isValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BoolAsStringProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BoolAsStringProperty 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 BoolAsStringProperty. + */ + @Generated + public static BoolAsStringProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean value = false; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + return new BoolAsStringProperty(value); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/models/package-info.java new file mode 100644 index 00000000000..46e725592ce --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/booleannamespace/property/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 BooleanModel. + * Test for encode decorator on boolean. + * + */ +package encode.booleannamespace.property.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java index 13a7e3b79bc..f1903a68876 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java @@ -45,9 +45,11 @@ QueryClient.class, PropertyClient.class, HeaderClient.class, + LossyClient.class, QueryAsyncClient.class, PropertyAsyncClient.class, - HeaderAsyncClient.class }) + HeaderAsyncClient.class, + LossyAsyncClient.class }) public final class DurationClientBuilder implements HttpTrait, ConfigurationTrait, EndpointTrait { @Generated @@ -204,7 +206,7 @@ public DurationClientBuilder endpoint(String endpoint) { /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the DurationClientBuilder. */ @@ -216,7 +218,7 @@ public DurationClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of DurationClientImpl with the provided parameters. - * + * * @return an instance of DurationClientImpl. */ @Generated @@ -272,7 +274,7 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of QueryAsyncClient class. - * + * * @return an instance of QueryAsyncClient. */ @Generated @@ -282,7 +284,7 @@ public QueryAsyncClient buildQueryAsyncClient() { /** * Builds an instance of PropertyAsyncClient class. - * + * * @return an instance of PropertyAsyncClient. */ @Generated @@ -292,7 +294,7 @@ public PropertyAsyncClient buildPropertyAsyncClient() { /** * Builds an instance of HeaderAsyncClient class. - * + * * @return an instance of HeaderAsyncClient. */ @Generated @@ -300,9 +302,19 @@ public HeaderAsyncClient buildHeaderAsyncClient() { return new HeaderAsyncClient(buildInnerClient().getHeaders()); } + /** + * Builds an instance of LossyAsyncClient class. + * + * @return an instance of LossyAsyncClient. + */ + @Generated + public LossyAsyncClient buildLossyAsyncClient() { + return new LossyAsyncClient(buildInnerClient().getLossies()); + } + /** * Builds an instance of QueryClient class. - * + * * @return an instance of QueryClient. */ @Generated @@ -312,7 +324,7 @@ public QueryClient buildQueryClient() { /** * Builds an instance of PropertyClient class. - * + * * @return an instance of PropertyClient. */ @Generated @@ -322,7 +334,7 @@ public PropertyClient buildPropertyClient() { /** * Builds an instance of HeaderClient class. - * + * * @return an instance of HeaderClient. */ @Generated @@ -330,5 +342,15 @@ public HeaderClient buildHeaderClient() { return new HeaderClient(buildInnerClient().getHeaders()); } + /** + * Builds an instance of LossyClient class. + * + * @return an instance of LossyClient. + */ + @Generated + public LossyClient buildLossyClient() { + return new LossyClient(buildInnerClient().getLossies()); + } + private static final ClientLogger LOGGER = new ClientLogger(DurationClientBuilder.class); } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java new file mode 100644 index 00000000000..38e7713d7a0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.duration; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.FluxUtil; +import encode.duration.implementation.LossiesImpl; +import java.time.Duration; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous DurationClient type. + */ +@ServiceClient(builder = DurationClientBuilder.class, isAsync = true) +public final class LossyAsyncClient { + @Generated + private final LossiesImpl serviceClient; + + /** + * Initializes an instance of LossyAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + LossyAsyncClient(LossiesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> intSecondsWithResponse(Duration input, RequestOptions requestOptions) { + return this.serviceClient.intSecondsWithResponseAsync(input, requestOptions); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> intMillisecondsWithResponse(Duration input, RequestOptions requestOptions) { + return this.serviceClient.intMillisecondsWithResponseAsync(input, requestOptions); + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono intSeconds(Duration input) { + // Generated convenience method for intSecondsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return intSecondsWithResponse(input, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono intMilliseconds(Duration input) { + // Generated convenience method for intMillisecondsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return intMillisecondsWithResponse(input, requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java new file mode 100644 index 00000000000..0fc3ebb1f9a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.duration; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import encode.duration.implementation.LossiesImpl; +import java.time.Duration; + +/** + * Initializes a new instance of the synchronous DurationClient type. + */ +@ServiceClient(builder = DurationClientBuilder.class) +public final class LossyClient { + @Generated + private final LossiesImpl serviceClient; + + /** + * Initializes an instance of LossyClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + LossyClient(LossiesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intSecondsWithResponse(Duration input, RequestOptions requestOptions) { + return this.serviceClient.intSecondsWithResponse(input, requestOptions); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intMillisecondsWithResponse(Duration input, RequestOptions requestOptions) { + return this.serviceClient.intMillisecondsWithResponse(input, requestOptions); + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void intSeconds(Duration input) { + // Generated convenience method for intSecondsWithResponse + RequestOptions requestOptions = new RequestOptions(); + intSecondsWithResponse(input, requestOptions).getValue(); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void intMilliseconds(Duration input) { + // Generated convenience method for intMillisecondsWithResponse + RequestOptions requestOptions = new RequestOptions(); + intMillisecondsWithResponse(input, requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java index 64829d228e4..1910f0a3fce 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java @@ -22,7 +22,7 @@ public final class DurationClientImpl { /** * Gets Service host. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -36,7 +36,7 @@ public String getEndpoint() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -50,7 +50,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -64,7 +64,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Gets the QueriesImpl object to access its operations. - * + * * @return the QueriesImpl object. */ public QueriesImpl getQueries() { @@ -78,7 +78,7 @@ public QueriesImpl getQueries() { /** * Gets the PropertiesImpl object to access its operations. - * + * * @return the PropertiesImpl object. */ public PropertiesImpl getProperties() { @@ -92,16 +92,30 @@ public PropertiesImpl getProperties() { /** * Gets the HeadersImpl object to access its operations. - * + * * @return the HeadersImpl object. */ public HeadersImpl getHeaders() { return this.headers; } + /** + * The LossiesImpl object to access its operations. + */ + private final LossiesImpl lossies; + + /** + * Gets the LossiesImpl object to access its operations. + * + * @return the LossiesImpl object. + */ + public LossiesImpl getLossies() { + return this.lossies; + } + /** * Initializes an instance of DurationClient client. - * + * * @param endpoint Service host. */ public DurationClientImpl(String endpoint) { @@ -111,7 +125,7 @@ public DurationClientImpl(String endpoint) { /** * Initializes an instance of DurationClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service host. */ @@ -121,7 +135,7 @@ public DurationClientImpl(HttpPipeline httpPipeline, String endpoint) { /** * Initializes an instance of DurationClient 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. @@ -133,5 +147,6 @@ public DurationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serialize this.queries = new QueriesImpl(this); this.properties = new PropertiesImpl(this); this.headers = new HeadersImpl(this); + this.lossies = new LossiesImpl(this); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java new file mode 100644 index 00000000000..0d1b87ee919 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.duration.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +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.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.Context; +import com.azure.core.util.FluxUtil; +import java.time.Duration; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Lossies. + */ +public final class LossiesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final LossiesService service; + + /** + * The service client containing this operation class. + */ + private final DurationClientImpl client; + + /** + * Initializes an instance of LossiesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LossiesImpl(DurationClientImpl client) { + this.service = RestProxy.create(LossiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DurationClientLossies to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DurationClientLossies") + public interface LossiesService { + @Get("/encode/duration/lossy/int32-seconds") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> intSeconds(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestOptions requestOptions, Context context); + + @Get("/encode/duration/lossy/int32-seconds") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response intSecondsSync(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestOptions requestOptions, Context context); + + @Get("/encode/duration/lossy/int32-milliseconds") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> intMilliseconds(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestOptions requestOptions, Context context); + + @Get("/encode/duration/lossy/int32-milliseconds") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response intMillisecondsSync(@HostParam("endpoint") String endpoint, @QueryParam("input") long input, + RequestOptions requestOptions, Context context); + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> intSecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { + long inputConverted = input.getSeconds(); + return FluxUtil.withContext( + context -> service.intSeconds(this.client.getEndpoint(), inputConverted, requestOptions, context)); + } + + /** + * The intSeconds operation. + * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intSecondsWithResponse(Duration input, RequestOptions requestOptions) { + long inputConverted = input.getSeconds(); + return service.intSecondsSync(this.client.getEndpoint(), inputConverted, requestOptions, Context.NONE); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> intMillisecondsWithResponseAsync(Duration input, RequestOptions requestOptions) { + long inputConverted = input.toMillis(); + return FluxUtil.withContext( + context -> service.intMilliseconds(this.client.getEndpoint(), inputConverted, requestOptions, context)); + } + + /** + * The intMilliseconds operation. + * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response intMillisecondsWithResponse(Duration input, RequestOptions requestOptions) { + long inputConverted = input.toMillis(); + return service.intMillisecondsSync(this.client.getEndpoint(), inputConverted, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java index c3f1289ed2e..47f54069466 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java @@ -40,7 +40,7 @@ public final class SpecialCharsImpl { /** * Initializes an instance of SpecialCharsImpl. - * + * * @param client the instance of the service client containing this operation class. */ SpecialCharsImpl(QueryClientImpl client) { @@ -56,7 +56,7 @@ public final class SpecialCharsImpl { @Host("{endpoint}") @ServiceInterface(name = "QueryClientSpecialChars") public interface SpecialCharsService { - @Get("/parameters/query/special-char/dollarSign") + @Get("/parameters/query/special-char/dollar-sign") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -65,7 +65,7 @@ public interface SpecialCharsService { Mono> dollarSign(@HostParam("endpoint") String endpoint, @QueryParam("$filter") String filter, RequestOptions requestOptions, Context context); - @Get("/parameters/query/special-char/dollarSign") + @Get("/parameters/query/special-char/dollar-sign") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -77,7 +77,7 @@ Response dollarSignSync(@HostParam("endpoint") String endpoint, @QueryPara /** * The dollarSign operation. - * + * * @param filter The filter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -94,7 +94,7 @@ public Mono> dollarSignWithResponseAsync(String filter, RequestOp /** * The dollarSign operation. - * + * * @param filter The filter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java index ce1c3db069d..0db178e9812 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java @@ -19,6 +19,7 @@ import java.util.Map; import reactor.core.publisher.Mono; import routes.implementation.QueryParametersQueryExpansionExplodesImpl; +import routes.models.ExpandParameters; /** * Initializes a new instance of the asynchronous RoutesClient type. @@ -30,7 +31,7 @@ public final class QueryParametersQueryExpansionExplodeAsyncClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -40,7 +41,7 @@ public final class QueryParametersQueryExpansionExplodeAsyncClient { /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -57,7 +58,7 @@ public Mono> primitiveWithResponse(String param, RequestOptions r /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -74,7 +75,7 @@ public Mono> arrayWithResponse(List param, RequestOptions /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -89,9 +90,26 @@ public Mono> recordWithResponse(Map param, Reque return this.serviceClient.recordWithResponseAsync(param, requestOptions); } + /** + * The model operation. + * + * @param param The param parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> modelWithResponse(ExpandParameters param, RequestOptions requestOptions) { + return this.serviceClient.modelWithResponseAsync(param, requestOptions); + } + /** * The primitive operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -111,7 +129,7 @@ public Mono primitive(String param) { /** * The array operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -131,7 +149,7 @@ public Mono array(List param) { /** * The record operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -148,4 +166,24 @@ public Mono record(Map param) { RequestOptions requestOptions = new RequestOptions(); return recordWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); } + + /** + * The model operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono model(ExpandParameters param) { + // Generated convenience method for modelWithResponse + RequestOptions requestOptions = new RequestOptions(); + return modelWithResponse(param, requestOptions).flatMap(FluxUtil::toMono); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java index 267bcb6b548..93fc57f51f5 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; import routes.implementation.QueryParametersQueryExpansionExplodesImpl; +import routes.models.ExpandParameters; /** * Initializes a new instance of the synchronous RoutesClient type. @@ -28,7 +29,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -38,7 +39,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -55,7 +56,7 @@ public Response primitiveWithResponse(String param, RequestOptions request /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -72,7 +73,7 @@ public Response arrayWithResponse(List param, RequestOptions reque /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -87,9 +88,26 @@ public Response recordWithResponse(Map param, RequestOpti return this.serviceClient.recordWithResponse(param, requestOptions); } + /** + * The model operation. + * + * @param param The param parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response modelWithResponse(ExpandParameters param, RequestOptions requestOptions) { + return this.serviceClient.modelWithResponse(param, requestOptions); + } + /** * The primitive operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -108,7 +126,7 @@ public void primitive(String param) { /** * The array operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -127,7 +145,7 @@ public void array(List param) { /** * The record operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -143,4 +161,23 @@ public void record(Map param) { RequestOptions requestOptions = new RequestOptions(); recordWithResponse(param, requestOptions).getValue(); } + + /** + * The model operation. + * + * @param param The param parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void model(ExpandParameters param) { + // Generated convenience method for modelWithResponse + RequestOptions requestOptions = new RequestOptions(); + modelWithResponse(param, requestOptions).getValue(); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java index 3bc6b8391ed..40267284f41 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java @@ -27,6 +27,7 @@ import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; +import routes.models.ExpandParameters; /** * An instance of this class provides access to all the operations defined in QueryParametersQueryExpansionExplodes. @@ -44,7 +45,7 @@ public final class QueryParametersQueryExpansionExplodesImpl { /** * Initializes an instance of QueryParametersQueryExpansionExplodesImpl. - * + * * @param client the instance of the service client containing this operation class. */ QueryParametersQueryExpansionExplodesImpl(RoutesClientImpl client) { @@ -115,11 +116,29 @@ Mono> record(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response recordSync(@HostParam("endpoint") String endpoint, @QueryParam("param") Map param, RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/model") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> model(@HostParam("endpoint") String endpoint, @QueryParam("param") ExpandParameters param, + RequestOptions requestOptions, Context context); + + @Get("/routes/query/query-expansion/explode/model") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response modelSync(@HostParam("endpoint") String endpoint, @QueryParam("param") ExpandParameters param, + RequestOptions requestOptions, Context context); } /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -136,7 +155,7 @@ public Mono> primitiveWithResponseAsync(String param, RequestOpti /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -152,7 +171,7 @@ public Response primitiveWithResponse(String param, RequestOptions request /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -171,7 +190,7 @@ public Mono> arrayWithResponseAsync(List param, RequestOp /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -189,7 +208,7 @@ public Response arrayWithResponse(List param, RequestOptions reque /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -206,7 +225,7 @@ public Mono> recordWithResponseAsync(Map param, /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -219,4 +238,37 @@ public Mono> recordWithResponseAsync(Map param, public Response recordWithResponse(Map param, RequestOptions requestOptions) { return service.recordSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); } + + /** + * The model operation. + * + * @param param The param parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> modelWithResponseAsync(ExpandParameters param, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.model(this.client.getEndpoint(), param, requestOptions, context)); + } + + /** + * The model operation. + * + * @param param The param parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response modelWithResponse(ExpandParameters param, RequestOptions requestOptions) { + return service.modelSync(this.client.getEndpoint(), param, requestOptions, Context.NONE); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/ExpandParameters.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/ExpandParameters.java new file mode 100644 index 00000000000..95a33e37c2e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/ExpandParameters.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 routes.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; + +/** + * A named model used to verify explode expansion of a model-valued query parameter. + */ +@Immutable +public final class ExpandParameters implements JsonSerializable { + /* + * The field property. + */ + @Generated + private final String field; + + /* + * The value property. + */ + @Generated + private final String value; + + /** + * Creates an instance of ExpandParameters class. + * + * @param field the field value to set. + * @param value the value value to set. + */ + @Generated + public ExpandParameters(String field, String value) { + this.field = field; + this.value = value; + } + + /** + * Get the field property: The field property. + * + * @return the field value. + */ + @Generated + public String getField() { + return this.field; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpandParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpandParameters 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 ExpandParameters. + */ + @Generated + public static ExpandParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String field = null; + String value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("field".equals(fieldName)) { + field = reader.getString(); + } else if ("value".equals(fieldName)) { + value = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ExpandParameters(field, value); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/models/package-info.java new file mode 100644 index 00000000000..dea1da5e5c9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/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 Routes. + * Define scenario in building the http route/uri. + * + */ +package routes.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index f5733578b8d..42d47c981f5 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -25,7 +25,7 @@ public interface ChildResourcesInterfacesClient { /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -40,7 +40,7 @@ Mono> getWithResponseAsync(String resourceGroupName /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -55,7 +55,7 @@ Mono getAsync(String resourceGroupName, String topLevelArmRe /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -71,7 +71,7 @@ Response getWithResponse(String resourceGroupName, String to /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -85,7 +85,7 @@ Response getWithResponse(String resourceGroupName, String to /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -102,7 +102,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -118,7 +118,7 @@ PollerFlux, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -134,7 +134,7 @@ SyncPoller, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -151,7 +151,7 @@ SyncPoller, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -167,7 +167,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String to /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -183,7 +183,7 @@ ChildResourceInner createOrUpdate(String resourceGroupName, String topLevelArmRe /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -200,7 +200,7 @@ ChildResourceInner createOrUpdate(String resourceGroupName, String topLevelArmRe /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -217,7 +217,7 @@ Mono> updateWithResponseAsync(String resourceGroupN /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -233,7 +233,7 @@ Mono updateAsync(String resourceGroupName, String topLevelAr /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -250,7 +250,7 @@ Response updateWithResponse(String resourceGroupName, String /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -266,7 +266,7 @@ ChildResourceInner update(String resourceGroupName, String topLevelArmResourceNa /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -281,7 +281,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -296,7 +296,7 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -311,7 +311,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -327,7 +327,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -341,7 +341,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -354,7 +354,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -368,7 +368,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -382,7 +382,7 @@ PagedFlux listByTopLevelArmResourceAsync(String resourceGrou /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -396,7 +396,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroup /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -410,8 +410,8 @@ PagedIterable listByTopLevelArmResource(String resourceGroup String topLevelArmResourceName, Context context); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -425,8 +425,8 @@ Mono>> actionWithoutBodyWithResponseAsync(String resou String topLevelArmResourceName, String childResourceName); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -440,8 +440,8 @@ PollerFlux, Void> beginActionWithoutBodyAsync(String resourceGr String topLevelArmResourceName, String childResourceName); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -455,8 +455,8 @@ SyncPoller, Void> beginActionWithoutBody(String resourceGroupNa String childResourceName); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -471,8 +471,8 @@ SyncPoller, Void> beginActionWithoutBody(String resourceGroupNa String childResourceName, Context context); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -486,8 +486,8 @@ Mono actionWithoutBodyAsync(String resourceGroupName, String topLevelArmRe String childResourceName); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -499,8 +499,8 @@ Mono actionWithoutBodyAsync(String resourceGroupName, String topLevelArmRe void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, String childResourceName); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java index 2bdefd6ca4f..ec7042e626e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java @@ -23,7 +23,7 @@ public interface LroNoBodiesClient { /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -38,7 +38,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -53,7 +53,7 @@ PollerFlux, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -68,7 +68,7 @@ SyncPoller, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -84,7 +84,7 @@ SyncPoller, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -99,7 +99,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String res /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -114,7 +114,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -129,8 +129,8 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB Context context); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,8 +142,8 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB Mono>> actionWithResponseAsync(String resourceGroupName, String resourceLroNoBodyName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -156,8 +156,8 @@ PollerFlux, ActionFinalResult> beginActionAsync(St String resourceLroNoBodyName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -170,8 +170,8 @@ SyncPoller, ActionFinalResult> beginAction(String String resourceLroNoBodyName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -185,8 +185,8 @@ SyncPoller, ActionFinalResult> beginAction(String String resourceLroNoBodyName, Context context); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -198,8 +198,8 @@ SyncPoller, ActionFinalResult> beginAction(String Mono actionAsync(String resourceGroupName, String resourceLroNoBodyName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -211,8 +211,8 @@ SyncPoller, ActionFinalResult> beginAction(String ActionFinalResult action(String resourceGroupName, String resourceLroNoBodyName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index 92fab17d9ad..afc61cdc14e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -27,7 +27,7 @@ public interface TopLevelArmResourceInterfacesClient { /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ Mono> getByResourceGroupWithResponseAsync(Str /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -54,7 +54,7 @@ Mono> getByResourceGroupWithResponseAsync(Str /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -69,7 +69,7 @@ Response getByResourceGroupWithResponse(String resourc /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -82,7 +82,7 @@ Response getByResourceGroupWithResponse(String resourc /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -98,7 +98,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -114,7 +114,7 @@ PollerFlux, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -130,7 +130,7 @@ SyncPoller, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -147,7 +147,7 @@ SyncPoller, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -163,7 +163,7 @@ Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -178,7 +178,7 @@ TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String topLeve /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -194,7 +194,7 @@ TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String topLeve /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -210,7 +210,7 @@ Mono> updateWithResponseAsync(String resource /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -226,7 +226,7 @@ Mono updateAsync(String resourceGroupName, String topL /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -243,7 +243,7 @@ Response updateWithResponse(String resourceGroupName, /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -258,7 +258,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -271,7 +271,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -284,7 +284,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -297,7 +297,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -312,7 +312,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -325,7 +325,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,7 +337,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -350,7 +350,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -362,7 +362,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -374,7 +374,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -387,7 +387,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedFlux}. @@ -397,7 +397,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -407,7 +407,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription 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. @@ -418,8 +418,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String PagedIterable list(Context context); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -431,8 +431,8 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String Mono>> actionWithResponseAsync(String resourceGroupName, String topLevelArmResourceName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -445,8 +445,8 @@ PollerFlux, ResultInner> beginActionAsync(String resourc String topLevelArmResourceName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -459,8 +459,8 @@ SyncPoller, ResultInner> beginAction(String resourceGrou String topLevelArmResourceName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -474,8 +474,8 @@ SyncPoller, ResultInner> beginAction(String resourceGrou String topLevelArmResourceName, Context context); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -487,8 +487,8 @@ SyncPoller, ResultInner> beginAction(String resourceGrou Mono actionAsync(String resourceGroupName, String topLevelArmResourceName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -500,8 +500,8 @@ SyncPoller, ResultInner> beginAction(String resourceGrou ResultInner action(String resourceGroupName, String topLevelArmResourceName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -515,7 +515,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -528,7 +528,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -541,7 +541,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -556,7 +556,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index 89e5d362ce6..2d0813ac890 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -58,7 +58,7 @@ public final class ChildResourcesInterfacesClientImpl implements ChildResourcesI /** * Initializes an instance of ChildResourcesInterfacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ChildResourcesInterfacesClientImpl(ArmClientImpl client) { @@ -219,7 +219,7 @@ Response listByTopLevelArmResourceNextSync( /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -241,7 +241,7 @@ public Mono> getWithResponseAsync(String resourceGr /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -259,7 +259,7 @@ public Mono getAsync(String resourceGroupName, String topLev /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -279,7 +279,7 @@ public Response getWithResponse(String resourceGroupName, St /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -295,7 +295,7 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -320,7 +320,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -342,7 +342,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -365,7 +365,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -387,7 +387,7 @@ public PollerFlux, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -408,7 +408,7 @@ public SyncPoller, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -430,7 +430,7 @@ public SyncPoller, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -449,7 +449,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, St /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -468,7 +468,7 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -488,7 +488,7 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -513,7 +513,7 @@ public Mono> updateWithResponseAsync(String resourc /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -532,7 +532,7 @@ public Mono updateAsync(String resourceGroupName, String top /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -555,7 +555,7 @@ public Response updateWithResponse(String resourceGroupName, /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -574,7 +574,7 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -593,7 +593,7 @@ public Mono>> deleteWithResponseAsync(String resourceG /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -612,7 +612,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -631,7 +631,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -651,7 +651,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -670,7 +670,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -690,7 +690,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -707,7 +707,7 @@ public Mono deleteAsync(String resourceGroupName, String topLevelArmResour /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -722,7 +722,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -739,7 +739,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -763,7 +763,7 @@ private Mono> listByTopLevelArmResourceSingleP /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -781,7 +781,7 @@ public PagedFlux listByTopLevelArmResourceAsync(String resou /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -802,7 +802,7 @@ private PagedResponse listByTopLevelArmResourceSinglePage(St /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -824,7 +824,7 @@ private PagedResponse listByTopLevelArmResourceSinglePage(St /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -842,7 +842,7 @@ public PagedIterable listByTopLevelArmResource(String resour /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -860,8 +860,8 @@ public PagedIterable listByTopLevelArmResource(String resour } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -881,8 +881,8 @@ public Mono>> actionWithoutBodyWithResponseAsync(Strin } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -900,8 +900,8 @@ private Response actionWithoutBodyWithResponse(String resourceGroupN } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -919,8 +919,8 @@ private Response actionWithoutBodyWithResponse(String resourceGroupN } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -939,8 +939,8 @@ public PollerFlux, Void> beginActionWithoutBodyAsync(String res } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -958,8 +958,8 @@ public SyncPoller, Void> beginActionWithoutBody(String resource } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -978,8 +978,8 @@ public SyncPoller, Void> beginActionWithoutBody(String resource } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -996,8 +996,8 @@ public Mono actionWithoutBodyAsync(String resourceGroupName, String topLev } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -1011,8 +1011,8 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour } /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -1029,7 +1029,7 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1050,7 +1050,7 @@ private Mono> listByTopLevelArmResourceNextSin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1068,7 +1068,7 @@ private PagedResponse listByTopLevelArmResourceNextSinglePag /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java index 4c9b682e39d..6c16d9e70ec 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java @@ -50,7 +50,7 @@ public final class LroNoBodiesClientImpl implements LroNoBodiesClient { /** * Initializes an instance of LroNoBodiesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroNoBodiesClientImpl(ArmClientImpl client) { @@ -111,7 +111,7 @@ Response actionSync(@HostParam("endpoint") String endpoint, /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -133,7 +133,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -153,7 +153,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -173,7 +173,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -193,7 +193,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -212,7 +212,7 @@ public SyncPoller, ResourceLroNoBody> beginCreateO /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -233,7 +233,7 @@ public SyncPoller, ResourceLroNoBody> beginCreateO /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -251,7 +251,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -268,7 +268,7 @@ public ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourc /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -285,8 +285,8 @@ public ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourc } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -305,8 +305,8 @@ public Mono>> actionWithResponseAsync(String resourceG } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -322,8 +322,8 @@ private Response actionWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -341,8 +341,8 @@ private Response actionWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -359,8 +359,8 @@ public PollerFlux, ActionFinalResult> beginActionA } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -377,8 +377,8 @@ public SyncPoller, ActionFinalResult> beginAction( } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -396,8 +396,8 @@ public SyncPoller, ActionFinalResult> beginAction( } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -412,8 +412,8 @@ public Mono actionAsync(String resourceGroupName, String reso } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -427,8 +427,8 @@ public ActionFinalResult action(String resourceGroupName, String resourceLroNoBo } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index 35fdf5e2ab3..2f8df3c431d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -59,7 +59,7 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr /** * Initializes an instance of TopLevelArmResourceInterfacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ TopLevelArmResourceInterfacesClientImpl(ArmClientImpl client) { @@ -262,7 +262,7 @@ Response listBySubscriptionNextSync( /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -282,7 +282,7 @@ public Mono> getByResourceGroupWithResponseAs /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,7 +299,7 @@ public Mono getByResourceGroupAsync(String resourceGro /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -318,7 +318,7 @@ public Response getByResourceGroupWithResponse(String /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -333,7 +333,7 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -357,7 +357,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -379,7 +379,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -402,7 +402,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -424,7 +424,7 @@ public PollerFlux, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -445,7 +445,7 @@ public SyncPoller, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -467,7 +467,7 @@ public SyncPoller, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -486,7 +486,7 @@ public Mono createOrUpdateAsync(String resourceGroupNa /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -503,7 +503,7 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -521,7 +521,7 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -545,7 +545,7 @@ public Mono> updateWithResponseAsync(String r /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -564,7 +564,7 @@ public Mono updateAsync(String resourceGroupName, Stri /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -587,7 +587,7 @@ public Response updateWithResponse(String resourceGrou /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -604,7 +604,7 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -623,7 +623,7 @@ public Mono>> deleteWithResponseAsync(String resourceG /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -639,7 +639,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -657,7 +657,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -675,7 +675,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -691,7 +691,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -709,7 +709,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -725,7 +725,7 @@ public Mono deleteAsync(String resourceGroupName, String topLevelArmResour /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -739,7 +739,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName) { /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -754,7 +754,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -775,7 +775,7 @@ private Mono> listByResourceGroupSingleP /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -790,7 +790,7 @@ public PagedFlux listByResourceGroupAsync(String resou /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -808,7 +808,7 @@ private PagedResponse listByResourceGroupSinglePage(St /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -828,7 +828,7 @@ private PagedResponse listByResourceGroupSinglePage(St /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -843,7 +843,7 @@ public PagedIterable listByResourceGroup(String resour /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -859,7 +859,7 @@ public PagedIterable listByResourceGroup(String resour /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation along with {@link PagedResponse} on successful @@ -878,7 +878,7 @@ private Mono> listSinglePageAsync() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedFlux}. @@ -891,7 +891,7 @@ public PagedFlux listAsync() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation along with {@link PagedResponse}. @@ -907,7 +907,7 @@ private PagedResponse listSinglePage() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -925,7 +925,7 @@ private PagedResponse listSinglePage(Context context) /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -937,7 +937,7 @@ public PagedIterable list() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -951,8 +951,8 @@ public PagedIterable list(Context context) { } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -971,8 +971,8 @@ public Mono>> actionWithResponseAsync(String resourceG } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -988,8 +988,8 @@ private Response actionWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1007,8 +1007,8 @@ private Response actionWithResponse(String resourceGroupName, String } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1025,8 +1025,8 @@ public PollerFlux, ResultInner> beginActionAsync(String } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1043,8 +1043,8 @@ public SyncPoller, ResultInner> beginAction(String resou } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1062,8 +1062,8 @@ public SyncPoller, ResultInner> beginAction(String resou } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1078,8 +1078,8 @@ public Mono actionAsync(String resourceGroupName, String topLevelAr } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1093,8 +1093,8 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa } /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1110,7 +1110,7 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1130,7 +1130,7 @@ public Mono> publishXmlWithResponseAsync(String resourceGro /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1146,7 +1146,7 @@ public Mono publishXmlAsync(String resourceGroupName, String topLeve /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1165,7 +1165,7 @@ public Response publishXmlWithResponse(String resourceGroupName, Str /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1180,7 +1180,7 @@ public BinaryData publishXml(String resourceGroupName, String topLevelArmResourc /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1201,7 +1201,7 @@ private Mono> listByResourceGroupNextSin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1219,7 +1219,7 @@ private PagedResponse listByResourceGroupNextSinglePag /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1239,7 +1239,7 @@ private PagedResponse listByResourceGroupNextSinglePag /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1260,7 +1260,7 @@ private Mono> listBySubscriptionNextSing /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1278,7 +1278,7 @@ private PagedResponse listBySubscriptionNextSinglePage /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java index 5269e4cfd32..1c3094c01ba 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java @@ -16,77 +16,77 @@ public interface ChildResource { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: Provisioning State of Top Level Arm Resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * 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 name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner tsptest.armresourceprovider.fluent.models.ChildResourceInner object. - * + * * @return the inner object. */ ChildResourceInner innerModel(); @@ -114,7 +114,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -122,7 +122,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -135,7 +135,7 @@ interface WithLocation { interface WithParentResource { /** * Specifies resourceGroupName, topLevelArmResourceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @return the next definition stage. @@ -150,14 +150,14 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ ChildResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -170,7 +170,7 @@ interface WithCreate extends DefinitionStages.WithTags { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -180,7 +180,7 @@ interface WithTags { /** * Begins update for the ChildResource resource. - * + * * @return the stage of resource update. */ ChildResource.Update update(); @@ -191,14 +191,14 @@ interface WithTags { interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ ChildResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ @@ -215,7 +215,7 @@ interface UpdateStages { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -225,30 +225,30 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ChildResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ ChildResource refresh(Context context); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @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 actionWithoutBody(); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java index 94c1bca4435..b444c4076b2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java @@ -14,7 +14,7 @@ public interface ChildResourcesInterfaces { /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -29,7 +29,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -42,7 +42,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -54,7 +54,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -67,7 +67,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +79,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -92,8 +92,8 @@ PagedIterable listByTopLevelArmResource(String resourceGroupName, Context context); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -104,8 +104,8 @@ PagedIterable listByTopLevelArmResource(String resourceGroupName, void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, String childResourceName); /** - * A long-running resource action. - * + * The actionWithoutBody operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -119,7 +119,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Get a ChildResource. - * + * * @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. @@ -130,7 +130,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Get a ChildResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +142,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Delete a ChildResource. - * + * * @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. @@ -152,7 +152,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Delete a ChildResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -163,7 +163,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Begins definition for a new ChildResource resource. - * + * * @param name resource name. * @return the first stage of the new ChildResource definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java index 68f73d0a5e5..55c3b53818c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java @@ -12,7 +12,7 @@ public interface LroNoBodies { /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -26,7 +26,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -40,8 +40,8 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB Context context); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,8 +52,8 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB ActionFinalResult action(String resourceGroupName, String resourceLroNoBodyName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java index fabd6c14ab0..eb481f1e0d3 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java @@ -20,119 +20,119 @@ public interface TopLevelArmResource { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the configurationEndpoints property: Configuration Endpoints. - * + * * @return the configurationEndpoints value. */ List configurationEndpoints(); /** * Gets the userName property: The userName property. - * + * * @return the userName value. */ String userName(); /** * Gets the userNames property: The userNames property. - * + * * @return the userNames value. */ String userNames(); /** * Gets the accuserName property: The accuserName property. - * + * * @return the accuserName value. */ String accuserName(); /** * Gets the startTimeStamp property: The startTimeStamp property. - * + * * @return the startTimeStamp value. */ OffsetDateTime startTimeStamp(); /** * Gets the size property: The size property. - * + * * @return the size value. */ Float size(); /** * Gets the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * 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 name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner tsptest.armresourceprovider.fluent.models.TopLevelArmResourceInner object. - * + * * @return the inner object. */ TopLevelArmResourceInner innerModel(); @@ -160,7 +160,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -168,7 +168,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -181,7 +181,7 @@ interface WithLocation { interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -196,14 +196,14 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithUse DefinitionStages.WithUserNames, DefinitionStages.WithAccuserName, DefinitionStages.WithStartTimeStamp { /** * Executes the create request. - * + * * @return the created resource. */ TopLevelArmResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -216,7 +216,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithUse interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -229,7 +229,7 @@ interface WithTags { interface WithUserName { /** * Specifies the userName property: The userName property.. - * + * * @param userName The userName property. * @return the next definition stage. */ @@ -242,7 +242,7 @@ interface WithUserName { interface WithUserNames { /** * Specifies the userNames property: The userNames property.. - * + * * @param userNames The userNames property. * @return the next definition stage. */ @@ -255,7 +255,7 @@ interface WithUserNames { interface WithAccuserName { /** * Specifies the accuserName property: The accuserName property.. - * + * * @param accuserName The accuserName property. * @return the next definition stage. */ @@ -268,7 +268,7 @@ interface WithAccuserName { interface WithStartTimeStamp { /** * Specifies the startTimeStamp property: The startTimeStamp property.. - * + * * @param startTimeStamp The startTimeStamp property. * @return the next definition stage. */ @@ -278,7 +278,7 @@ interface WithStartTimeStamp { /** * Begins update for the TopLevelArmResource resource. - * + * * @return the stage of resource update. */ TopLevelArmResource.Update update(); @@ -290,14 +290,14 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithUserName, Updat UpdateStages.WithAccuserName { /** * Executes the update request. - * + * * @return the updated resource. */ TopLevelArmResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ @@ -314,7 +314,7 @@ interface UpdateStages { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -327,7 +327,7 @@ interface WithTags { interface WithUserName { /** * Specifies the userName property: The userName property.. - * + * * @param userName The userName property. * @return the next definition stage. */ @@ -340,7 +340,7 @@ interface WithUserName { interface WithUserNames { /** * Specifies the userNames property: The userNames property.. - * + * * @param userNames The userNames property. * @return the next definition stage. */ @@ -353,7 +353,7 @@ interface WithUserNames { interface WithAccuserName { /** * Specifies the accuserName property: The accuserName property.. - * + * * @param accuserName The accuserName property. * @return the next definition stage. */ @@ -363,22 +363,22 @@ interface WithAccuserName { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ TopLevelArmResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ TopLevelArmResource refresh(Context context); /** - * A long-running resource action. - * + * The action operation. + * * @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. @@ -386,8 +386,8 @@ interface WithAccuserName { Result action(); /** - * A long-running resource action. - * + * The action operation. + * * @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. @@ -398,7 +398,7 @@ interface WithAccuserName { /** * A synchronous resource action. - * + * * @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. @@ -409,7 +409,7 @@ interface WithAccuserName { /** * A synchronous resource action. - * + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java index 60639e2c5d9..f47c8896bcb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -15,7 +15,7 @@ public interface TopLevelArmResourceInterfaces { /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -29,7 +29,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +52,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -64,7 +64,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -75,7 +75,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -87,7 +87,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -96,7 +96,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by subscription 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. @@ -106,8 +106,8 @@ Response getByResourceGroupWithResponse(String resourceGrou PagedIterable list(Context context); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -118,8 +118,8 @@ Response getByResourceGroupWithResponse(String resourceGrou Result action(String resourceGroupName, String topLevelArmResourceName); /** - * A long-running resource action. - * + * The action operation. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -132,7 +132,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -146,7 +146,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,7 +158,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Get a TopLevelArmResource. - * + * * @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. @@ -169,7 +169,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Get a TopLevelArmResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +181,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Delete a TopLevelArmResource. - * + * * @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. @@ -191,7 +191,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Delete a TopLevelArmResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,7 +202,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Begins definition for a new TopLevelArmResource resource. - * + * * @param name resource name. * @return the first stage of the new TopLevelArmResource definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json new file mode 100644 index 00000000000..0554da1fad8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-booleannamespace_metadata.json @@ -0,0 +1 @@ +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Encode.Boolean","crossLanguageVersion":"774ecf75d81f","crossLanguageDefinitions":{"encode.booleannamespace.BooleanAsyncClient":"Encode.Boolean.Property","encode.booleannamespace.BooleanAsyncClient.falseLower":"Encode.Boolean.Property.falseLower","encode.booleannamespace.BooleanAsyncClient.falseLowerWithResponse":"Encode.Boolean.Property.falseLower","encode.booleannamespace.BooleanAsyncClient.falseMixed":"Encode.Boolean.Property.falseMixed","encode.booleannamespace.BooleanAsyncClient.falseMixedWithResponse":"Encode.Boolean.Property.falseMixed","encode.booleannamespace.BooleanAsyncClient.trueLower":"Encode.Boolean.Property.trueLower","encode.booleannamespace.BooleanAsyncClient.trueLowerWithResponse":"Encode.Boolean.Property.trueLower","encode.booleannamespace.BooleanAsyncClient.trueUpper":"Encode.Boolean.Property.trueUpper","encode.booleannamespace.BooleanAsyncClient.trueUpperWithResponse":"Encode.Boolean.Property.trueUpper","encode.booleannamespace.BooleanClient":"Encode.Boolean.Property","encode.booleannamespace.BooleanClient.falseLower":"Encode.Boolean.Property.falseLower","encode.booleannamespace.BooleanClient.falseLowerWithResponse":"Encode.Boolean.Property.falseLower","encode.booleannamespace.BooleanClient.falseMixed":"Encode.Boolean.Property.falseMixed","encode.booleannamespace.BooleanClient.falseMixedWithResponse":"Encode.Boolean.Property.falseMixed","encode.booleannamespace.BooleanClient.trueLower":"Encode.Boolean.Property.trueLower","encode.booleannamespace.BooleanClient.trueLowerWithResponse":"Encode.Boolean.Property.trueLower","encode.booleannamespace.BooleanClient.trueUpper":"Encode.Boolean.Property.trueUpper","encode.booleannamespace.BooleanClient.trueUpperWithResponse":"Encode.Boolean.Property.trueUpper","encode.booleannamespace.BooleanClientBuilder":"Encode.Boolean","encode.booleannamespace.property.models.BoolAsStringProperty":"Encode.Boolean.Property.BoolAsStringProperty"},"generatedFiles":["src/main/java/encode/booleannamespace/BooleanAsyncClient.java","src/main/java/encode/booleannamespace/BooleanClient.java","src/main/java/encode/booleannamespace/BooleanClientBuilder.java","src/main/java/encode/booleannamespace/implementation/BooleanClientImpl.java","src/main/java/encode/booleannamespace/implementation/PropertiesImpl.java","src/main/java/encode/booleannamespace/implementation/package-info.java","src/main/java/encode/booleannamespace/package-info.java","src/main/java/encode/booleannamespace/property/models/BoolAsStringProperty.java","src/main/java/encode/booleannamespace/property/models/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-duration_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-duration_metadata.json index 7cc0ab4619e..2988671e7f3 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-duration_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/encode-duration_metadata.json @@ -1 +1 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Encode.Duration","crossLanguageVersion":"59d442353391","crossLanguageDefinitions":{"encode.duration.DurationClientBuilder":"Encode.Duration","encode.duration.HeaderAsyncClient":"Encode.Duration.Header","encode.duration.HeaderAsyncClient.defaultMethod":"Encode.Duration.Header.default","encode.duration.HeaderAsyncClient.defaultMethodWithResponse":"Encode.Duration.Header.default","encode.duration.HeaderAsyncClient.float64Milliseconds":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderAsyncClient.float64MillisecondsWithResponse":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderAsyncClient.float64Seconds":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderAsyncClient.float64SecondsWithResponse":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderAsyncClient.floatMilliseconds":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderAsyncClient.floatMillisecondsLargerUnit":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderAsyncClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderAsyncClient.floatMillisecondsWithResponse":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderAsyncClient.floatSeconds":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderAsyncClient.floatSecondsLargerUnit":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderAsyncClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderAsyncClient.floatSecondsWithResponse":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderAsyncClient.int32Milliseconds":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderAsyncClient.int32MillisecondsArray":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderAsyncClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderAsyncClient.int32MillisecondsLargerUnit":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderAsyncClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderAsyncClient.int32MillisecondsWithResponse":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderAsyncClient.int32Seconds":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderAsyncClient.int32SecondsLargerUnit":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderAsyncClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderAsyncClient.int32SecondsWithResponse":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderAsyncClient.iso8601":"Encode.Duration.Header.iso8601","encode.duration.HeaderAsyncClient.iso8601Array":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderAsyncClient.iso8601ArrayWithResponse":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderAsyncClient.iso8601WithResponse":"Encode.Duration.Header.iso8601","encode.duration.HeaderClient":"Encode.Duration.Header","encode.duration.HeaderClient.defaultMethod":"Encode.Duration.Header.default","encode.duration.HeaderClient.defaultMethodWithResponse":"Encode.Duration.Header.default","encode.duration.HeaderClient.float64Milliseconds":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderClient.float64MillisecondsWithResponse":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderClient.float64Seconds":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderClient.float64SecondsWithResponse":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderClient.floatMilliseconds":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderClient.floatMillisecondsLargerUnit":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderClient.floatMillisecondsWithResponse":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderClient.floatSeconds":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderClient.floatSecondsLargerUnit":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderClient.floatSecondsWithResponse":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderClient.int32Milliseconds":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderClient.int32MillisecondsArray":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderClient.int32MillisecondsLargerUnit":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderClient.int32MillisecondsWithResponse":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderClient.int32Seconds":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderClient.int32SecondsLargerUnit":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderClient.int32SecondsWithResponse":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderClient.iso8601":"Encode.Duration.Header.iso8601","encode.duration.HeaderClient.iso8601Array":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderClient.iso8601ArrayWithResponse":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderClient.iso8601WithResponse":"Encode.Duration.Header.iso8601","encode.duration.PropertyAsyncClient":"Encode.Duration.Property","encode.duration.PropertyAsyncClient.defaultMethod":"Encode.Duration.Property.default","encode.duration.PropertyAsyncClient.defaultMethodWithResponse":"Encode.Duration.Property.default","encode.duration.PropertyAsyncClient.float64Milliseconds":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyAsyncClient.float64MillisecondsWithResponse":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyAsyncClient.float64Seconds":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyAsyncClient.float64SecondsWithResponse":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyAsyncClient.floatMilliseconds":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyAsyncClient.floatMillisecondsArray":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyAsyncClient.floatMillisecondsArrayWithResponse":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyAsyncClient.floatMillisecondsLargerUnit":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyAsyncClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyAsyncClient.floatMillisecondsWithResponse":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyAsyncClient.floatSeconds":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyAsyncClient.floatSecondsArray":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyAsyncClient.floatSecondsArrayWithResponse":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyAsyncClient.floatSecondsLargerUnit":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyAsyncClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyAsyncClient.floatSecondsWithResponse":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyAsyncClient.int32Milliseconds":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyAsyncClient.int32MillisecondsLargerUnit":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyAsyncClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyAsyncClient.int32MillisecondsWithResponse":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyAsyncClient.int32Seconds":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyAsyncClient.int32SecondsLargerUnit":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyAsyncClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyAsyncClient.int32SecondsWithResponse":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyAsyncClient.iso8601":"Encode.Duration.Property.iso8601","encode.duration.PropertyAsyncClient.iso8601WithResponse":"Encode.Duration.Property.iso8601","encode.duration.PropertyClient":"Encode.Duration.Property","encode.duration.PropertyClient.defaultMethod":"Encode.Duration.Property.default","encode.duration.PropertyClient.defaultMethodWithResponse":"Encode.Duration.Property.default","encode.duration.PropertyClient.float64Milliseconds":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyClient.float64MillisecondsWithResponse":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyClient.float64Seconds":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyClient.float64SecondsWithResponse":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyClient.floatMilliseconds":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyClient.floatMillisecondsArray":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyClient.floatMillisecondsArrayWithResponse":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyClient.floatMillisecondsLargerUnit":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyClient.floatMillisecondsWithResponse":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyClient.floatSeconds":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyClient.floatSecondsArray":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyClient.floatSecondsArrayWithResponse":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyClient.floatSecondsLargerUnit":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyClient.floatSecondsWithResponse":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyClient.int32Milliseconds":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyClient.int32MillisecondsLargerUnit":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyClient.int32MillisecondsWithResponse":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyClient.int32Seconds":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyClient.int32SecondsLargerUnit":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyClient.int32SecondsWithResponse":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyClient.iso8601":"Encode.Duration.Property.iso8601","encode.duration.PropertyClient.iso8601WithResponse":"Encode.Duration.Property.iso8601","encode.duration.QueryAsyncClient":"Encode.Duration.Query","encode.duration.QueryAsyncClient.defaultMethod":"Encode.Duration.Query.default","encode.duration.QueryAsyncClient.defaultMethodWithResponse":"Encode.Duration.Query.default","encode.duration.QueryAsyncClient.float64Milliseconds":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryAsyncClient.float64MillisecondsWithResponse":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryAsyncClient.float64Seconds":"Encode.Duration.Query.float64Seconds","encode.duration.QueryAsyncClient.float64SecondsWithResponse":"Encode.Duration.Query.float64Seconds","encode.duration.QueryAsyncClient.floatMilliseconds":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryAsyncClient.floatMillisecondsLargerUnit":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryAsyncClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryAsyncClient.floatMillisecondsWithResponse":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryAsyncClient.floatSeconds":"Encode.Duration.Query.floatSeconds","encode.duration.QueryAsyncClient.floatSecondsLargerUnit":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryAsyncClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryAsyncClient.floatSecondsWithResponse":"Encode.Duration.Query.floatSeconds","encode.duration.QueryAsyncClient.int32Milliseconds":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryAsyncClient.int32MillisecondsArray":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryAsyncClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryAsyncClient.int32MillisecondsLargerUnit":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryAsyncClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryAsyncClient.int32MillisecondsWithResponse":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryAsyncClient.int32Seconds":"Encode.Duration.Query.int32Seconds","encode.duration.QueryAsyncClient.int32SecondsArray":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryAsyncClient.int32SecondsArrayWithResponse":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryAsyncClient.int32SecondsLargerUnit":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryAsyncClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryAsyncClient.int32SecondsWithResponse":"Encode.Duration.Query.int32Seconds","encode.duration.QueryAsyncClient.iso8601":"Encode.Duration.Query.iso8601","encode.duration.QueryAsyncClient.iso8601WithResponse":"Encode.Duration.Query.iso8601","encode.duration.QueryClient":"Encode.Duration.Query","encode.duration.QueryClient.defaultMethod":"Encode.Duration.Query.default","encode.duration.QueryClient.defaultMethodWithResponse":"Encode.Duration.Query.default","encode.duration.QueryClient.float64Milliseconds":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryClient.float64MillisecondsWithResponse":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryClient.float64Seconds":"Encode.Duration.Query.float64Seconds","encode.duration.QueryClient.float64SecondsWithResponse":"Encode.Duration.Query.float64Seconds","encode.duration.QueryClient.floatMilliseconds":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryClient.floatMillisecondsLargerUnit":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryClient.floatMillisecondsWithResponse":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryClient.floatSeconds":"Encode.Duration.Query.floatSeconds","encode.duration.QueryClient.floatSecondsLargerUnit":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryClient.floatSecondsWithResponse":"Encode.Duration.Query.floatSeconds","encode.duration.QueryClient.int32Milliseconds":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryClient.int32MillisecondsArray":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryClient.int32MillisecondsLargerUnit":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryClient.int32MillisecondsWithResponse":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryClient.int32Seconds":"Encode.Duration.Query.int32Seconds","encode.duration.QueryClient.int32SecondsArray":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryClient.int32SecondsArrayWithResponse":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryClient.int32SecondsLargerUnit":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryClient.int32SecondsWithResponse":"Encode.Duration.Query.int32Seconds","encode.duration.QueryClient.iso8601":"Encode.Duration.Query.iso8601","encode.duration.QueryClient.iso8601WithResponse":"Encode.Duration.Query.iso8601","encode.duration.property.models.DefaultDurationProperty":"Encode.Duration.Property.DefaultDurationProperty","encode.duration.property.models.Float64MillisecondsDurationProperty":"Encode.Duration.Property.Float64MillisecondsDurationProperty","encode.duration.property.models.Float64SecondsDurationProperty":"Encode.Duration.Property.Float64SecondsDurationProperty","encode.duration.property.models.FloatMillisecondsDurationArrayProperty":"Encode.Duration.Property.FloatMillisecondsDurationArrayProperty","encode.duration.property.models.FloatMillisecondsDurationProperty":"Encode.Duration.Property.FloatMillisecondsDurationProperty","encode.duration.property.models.FloatMillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatMillisecondsLargerUnitDurationProperty","encode.duration.property.models.FloatSecondsDurationArrayProperty":"Encode.Duration.Property.FloatSecondsDurationArrayProperty","encode.duration.property.models.FloatSecondsDurationProperty":"Encode.Duration.Property.FloatSecondsDurationProperty","encode.duration.property.models.FloatSecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatSecondsLargerUnitDurationProperty","encode.duration.property.models.ISO8601DurationProperty":"Encode.Duration.Property.ISO8601DurationProperty","encode.duration.property.models.Int32MillisecondsDurationProperty":"Encode.Duration.Property.Int32MillisecondsDurationProperty","encode.duration.property.models.Int32MillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32MillisecondsLargerUnitDurationProperty","encode.duration.property.models.Int32SecondsDurationProperty":"Encode.Duration.Property.Int32SecondsDurationProperty","encode.duration.property.models.Int32SecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32SecondsLargerUnitDurationProperty"},"generatedFiles":["src/main/java/encode/duration/DurationClientBuilder.java","src/main/java/encode/duration/HeaderAsyncClient.java","src/main/java/encode/duration/HeaderClient.java","src/main/java/encode/duration/PropertyAsyncClient.java","src/main/java/encode/duration/PropertyClient.java","src/main/java/encode/duration/QueryAsyncClient.java","src/main/java/encode/duration/QueryClient.java","src/main/java/encode/duration/implementation/DurationClientImpl.java","src/main/java/encode/duration/implementation/HeadersImpl.java","src/main/java/encode/duration/implementation/PropertiesImpl.java","src/main/java/encode/duration/implementation/QueriesImpl.java","src/main/java/encode/duration/implementation/package-info.java","src/main/java/encode/duration/package-info.java","src/main/java/encode/duration/property/models/DefaultDurationProperty.java","src/main/java/encode/duration/property/models/Float64MillisecondsDurationProperty.java","src/main/java/encode/duration/property/models/Float64SecondsDurationProperty.java","src/main/java/encode/duration/property/models/FloatMillisecondsDurationArrayProperty.java","src/main/java/encode/duration/property/models/FloatMillisecondsDurationProperty.java","src/main/java/encode/duration/property/models/FloatMillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/FloatSecondsDurationArrayProperty.java","src/main/java/encode/duration/property/models/FloatSecondsDurationProperty.java","src/main/java/encode/duration/property/models/FloatSecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/ISO8601DurationProperty.java","src/main/java/encode/duration/property/models/Int32MillisecondsDurationProperty.java","src/main/java/encode/duration/property/models/Int32MillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/Int32SecondsDurationProperty.java","src/main/java/encode/duration/property/models/Int32SecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Encode.Duration","crossLanguageVersion":"1d6dc20e6d13","crossLanguageDefinitions":{"encode.duration.DurationClientBuilder":"Encode.Duration","encode.duration.HeaderAsyncClient":"Encode.Duration.Header","encode.duration.HeaderAsyncClient.defaultMethod":"Encode.Duration.Header.default","encode.duration.HeaderAsyncClient.defaultMethodWithResponse":"Encode.Duration.Header.default","encode.duration.HeaderAsyncClient.float64Milliseconds":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderAsyncClient.float64MillisecondsWithResponse":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderAsyncClient.float64Seconds":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderAsyncClient.float64SecondsWithResponse":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderAsyncClient.floatMilliseconds":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderAsyncClient.floatMillisecondsLargerUnit":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderAsyncClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderAsyncClient.floatMillisecondsWithResponse":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderAsyncClient.floatSeconds":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderAsyncClient.floatSecondsLargerUnit":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderAsyncClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderAsyncClient.floatSecondsWithResponse":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderAsyncClient.int32Milliseconds":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderAsyncClient.int32MillisecondsArray":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderAsyncClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderAsyncClient.int32MillisecondsLargerUnit":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderAsyncClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderAsyncClient.int32MillisecondsWithResponse":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderAsyncClient.int32Seconds":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderAsyncClient.int32SecondsLargerUnit":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderAsyncClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderAsyncClient.int32SecondsWithResponse":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderAsyncClient.iso8601":"Encode.Duration.Header.iso8601","encode.duration.HeaderAsyncClient.iso8601Array":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderAsyncClient.iso8601ArrayWithResponse":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderAsyncClient.iso8601WithResponse":"Encode.Duration.Header.iso8601","encode.duration.HeaderClient":"Encode.Duration.Header","encode.duration.HeaderClient.defaultMethod":"Encode.Duration.Header.default","encode.duration.HeaderClient.defaultMethodWithResponse":"Encode.Duration.Header.default","encode.duration.HeaderClient.float64Milliseconds":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderClient.float64MillisecondsWithResponse":"Encode.Duration.Header.float64Milliseconds","encode.duration.HeaderClient.float64Seconds":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderClient.float64SecondsWithResponse":"Encode.Duration.Header.float64Seconds","encode.duration.HeaderClient.floatMilliseconds":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderClient.floatMillisecondsLargerUnit":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Header.floatMillisecondsLargerUnit","encode.duration.HeaderClient.floatMillisecondsWithResponse":"Encode.Duration.Header.floatMilliseconds","encode.duration.HeaderClient.floatSeconds":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderClient.floatSecondsLargerUnit":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Header.floatSecondsLargerUnit","encode.duration.HeaderClient.floatSecondsWithResponse":"Encode.Duration.Header.floatSeconds","encode.duration.HeaderClient.int32Milliseconds":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderClient.int32MillisecondsArray":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Header.int32MillisecondsArray","encode.duration.HeaderClient.int32MillisecondsLargerUnit":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Header.int32MillisecondsLargerUnit","encode.duration.HeaderClient.int32MillisecondsWithResponse":"Encode.Duration.Header.int32Milliseconds","encode.duration.HeaderClient.int32Seconds":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderClient.int32SecondsLargerUnit":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Header.int32SecondsLargerUnit","encode.duration.HeaderClient.int32SecondsWithResponse":"Encode.Duration.Header.int32Seconds","encode.duration.HeaderClient.iso8601":"Encode.Duration.Header.iso8601","encode.duration.HeaderClient.iso8601Array":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderClient.iso8601ArrayWithResponse":"Encode.Duration.Header.iso8601Array","encode.duration.HeaderClient.iso8601WithResponse":"Encode.Duration.Header.iso8601","encode.duration.LossyAsyncClient":"Encode.Duration.Lossy","encode.duration.LossyAsyncClient.intMilliseconds":"Encode.Duration.Lossy.intMilliseconds","encode.duration.LossyAsyncClient.intMillisecondsWithResponse":"Encode.Duration.Lossy.intMilliseconds","encode.duration.LossyAsyncClient.intSeconds":"Encode.Duration.Lossy.intSeconds","encode.duration.LossyAsyncClient.intSecondsWithResponse":"Encode.Duration.Lossy.intSeconds","encode.duration.LossyClient":"Encode.Duration.Lossy","encode.duration.LossyClient.intMilliseconds":"Encode.Duration.Lossy.intMilliseconds","encode.duration.LossyClient.intMillisecondsWithResponse":"Encode.Duration.Lossy.intMilliseconds","encode.duration.LossyClient.intSeconds":"Encode.Duration.Lossy.intSeconds","encode.duration.LossyClient.intSecondsWithResponse":"Encode.Duration.Lossy.intSeconds","encode.duration.PropertyAsyncClient":"Encode.Duration.Property","encode.duration.PropertyAsyncClient.defaultMethod":"Encode.Duration.Property.default","encode.duration.PropertyAsyncClient.defaultMethodWithResponse":"Encode.Duration.Property.default","encode.duration.PropertyAsyncClient.float64Milliseconds":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyAsyncClient.float64MillisecondsWithResponse":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyAsyncClient.float64Seconds":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyAsyncClient.float64SecondsWithResponse":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyAsyncClient.floatMilliseconds":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyAsyncClient.floatMillisecondsArray":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyAsyncClient.floatMillisecondsArrayWithResponse":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyAsyncClient.floatMillisecondsLargerUnit":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyAsyncClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyAsyncClient.floatMillisecondsWithResponse":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyAsyncClient.floatSeconds":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyAsyncClient.floatSecondsArray":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyAsyncClient.floatSecondsArrayWithResponse":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyAsyncClient.floatSecondsLargerUnit":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyAsyncClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyAsyncClient.floatSecondsWithResponse":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyAsyncClient.int32Milliseconds":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyAsyncClient.int32MillisecondsLargerUnit":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyAsyncClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyAsyncClient.int32MillisecondsWithResponse":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyAsyncClient.int32Seconds":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyAsyncClient.int32SecondsLargerUnit":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyAsyncClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyAsyncClient.int32SecondsWithResponse":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyAsyncClient.iso8601":"Encode.Duration.Property.iso8601","encode.duration.PropertyAsyncClient.iso8601WithResponse":"Encode.Duration.Property.iso8601","encode.duration.PropertyClient":"Encode.Duration.Property","encode.duration.PropertyClient.defaultMethod":"Encode.Duration.Property.default","encode.duration.PropertyClient.defaultMethodWithResponse":"Encode.Duration.Property.default","encode.duration.PropertyClient.float64Milliseconds":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyClient.float64MillisecondsWithResponse":"Encode.Duration.Property.float64Milliseconds","encode.duration.PropertyClient.float64Seconds":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyClient.float64SecondsWithResponse":"Encode.Duration.Property.float64Seconds","encode.duration.PropertyClient.floatMilliseconds":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyClient.floatMillisecondsArray":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyClient.floatMillisecondsArrayWithResponse":"Encode.Duration.Property.floatMillisecondsArray","encode.duration.PropertyClient.floatMillisecondsLargerUnit":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Property.floatMillisecondsLargerUnit","encode.duration.PropertyClient.floatMillisecondsWithResponse":"Encode.Duration.Property.floatMilliseconds","encode.duration.PropertyClient.floatSeconds":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyClient.floatSecondsArray":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyClient.floatSecondsArrayWithResponse":"Encode.Duration.Property.floatSecondsArray","encode.duration.PropertyClient.floatSecondsLargerUnit":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Property.floatSecondsLargerUnit","encode.duration.PropertyClient.floatSecondsWithResponse":"Encode.Duration.Property.floatSeconds","encode.duration.PropertyClient.int32Milliseconds":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyClient.int32MillisecondsLargerUnit":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Property.int32MillisecondsLargerUnit","encode.duration.PropertyClient.int32MillisecondsWithResponse":"Encode.Duration.Property.int32Milliseconds","encode.duration.PropertyClient.int32Seconds":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyClient.int32SecondsLargerUnit":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Property.int32SecondsLargerUnit","encode.duration.PropertyClient.int32SecondsWithResponse":"Encode.Duration.Property.int32Seconds","encode.duration.PropertyClient.iso8601":"Encode.Duration.Property.iso8601","encode.duration.PropertyClient.iso8601WithResponse":"Encode.Duration.Property.iso8601","encode.duration.QueryAsyncClient":"Encode.Duration.Query","encode.duration.QueryAsyncClient.defaultMethod":"Encode.Duration.Query.default","encode.duration.QueryAsyncClient.defaultMethodWithResponse":"Encode.Duration.Query.default","encode.duration.QueryAsyncClient.float64Milliseconds":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryAsyncClient.float64MillisecondsWithResponse":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryAsyncClient.float64Seconds":"Encode.Duration.Query.float64Seconds","encode.duration.QueryAsyncClient.float64SecondsWithResponse":"Encode.Duration.Query.float64Seconds","encode.duration.QueryAsyncClient.floatMilliseconds":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryAsyncClient.floatMillisecondsLargerUnit":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryAsyncClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryAsyncClient.floatMillisecondsWithResponse":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryAsyncClient.floatSeconds":"Encode.Duration.Query.floatSeconds","encode.duration.QueryAsyncClient.floatSecondsLargerUnit":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryAsyncClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryAsyncClient.floatSecondsWithResponse":"Encode.Duration.Query.floatSeconds","encode.duration.QueryAsyncClient.int32Milliseconds":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryAsyncClient.int32MillisecondsArray":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryAsyncClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryAsyncClient.int32MillisecondsLargerUnit":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryAsyncClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryAsyncClient.int32MillisecondsWithResponse":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryAsyncClient.int32Seconds":"Encode.Duration.Query.int32Seconds","encode.duration.QueryAsyncClient.int32SecondsArray":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryAsyncClient.int32SecondsArrayWithResponse":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryAsyncClient.int32SecondsLargerUnit":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryAsyncClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryAsyncClient.int32SecondsWithResponse":"Encode.Duration.Query.int32Seconds","encode.duration.QueryAsyncClient.iso8601":"Encode.Duration.Query.iso8601","encode.duration.QueryAsyncClient.iso8601WithResponse":"Encode.Duration.Query.iso8601","encode.duration.QueryClient":"Encode.Duration.Query","encode.duration.QueryClient.defaultMethod":"Encode.Duration.Query.default","encode.duration.QueryClient.defaultMethodWithResponse":"Encode.Duration.Query.default","encode.duration.QueryClient.float64Milliseconds":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryClient.float64MillisecondsWithResponse":"Encode.Duration.Query.float64Milliseconds","encode.duration.QueryClient.float64Seconds":"Encode.Duration.Query.float64Seconds","encode.duration.QueryClient.float64SecondsWithResponse":"Encode.Duration.Query.float64Seconds","encode.duration.QueryClient.floatMilliseconds":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryClient.floatMillisecondsLargerUnit":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryClient.floatMillisecondsLargerUnitWithResponse":"Encode.Duration.Query.floatMillisecondsLargerUnit","encode.duration.QueryClient.floatMillisecondsWithResponse":"Encode.Duration.Query.floatMilliseconds","encode.duration.QueryClient.floatSeconds":"Encode.Duration.Query.floatSeconds","encode.duration.QueryClient.floatSecondsLargerUnit":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryClient.floatSecondsLargerUnitWithResponse":"Encode.Duration.Query.floatSecondsLargerUnit","encode.duration.QueryClient.floatSecondsWithResponse":"Encode.Duration.Query.floatSeconds","encode.duration.QueryClient.int32Milliseconds":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryClient.int32MillisecondsArray":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryClient.int32MillisecondsArrayWithResponse":"Encode.Duration.Query.int32MillisecondsArray","encode.duration.QueryClient.int32MillisecondsLargerUnit":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryClient.int32MillisecondsLargerUnitWithResponse":"Encode.Duration.Query.int32MillisecondsLargerUnit","encode.duration.QueryClient.int32MillisecondsWithResponse":"Encode.Duration.Query.int32Milliseconds","encode.duration.QueryClient.int32Seconds":"Encode.Duration.Query.int32Seconds","encode.duration.QueryClient.int32SecondsArray":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryClient.int32SecondsArrayWithResponse":"Encode.Duration.Query.int32SecondsArray","encode.duration.QueryClient.int32SecondsLargerUnit":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryClient.int32SecondsLargerUnitWithResponse":"Encode.Duration.Query.int32SecondsLargerUnit","encode.duration.QueryClient.int32SecondsWithResponse":"Encode.Duration.Query.int32Seconds","encode.duration.QueryClient.iso8601":"Encode.Duration.Query.iso8601","encode.duration.QueryClient.iso8601WithResponse":"Encode.Duration.Query.iso8601","encode.duration.property.models.DefaultDurationProperty":"Encode.Duration.Property.DefaultDurationProperty","encode.duration.property.models.Float64MillisecondsDurationProperty":"Encode.Duration.Property.Float64MillisecondsDurationProperty","encode.duration.property.models.Float64SecondsDurationProperty":"Encode.Duration.Property.Float64SecondsDurationProperty","encode.duration.property.models.FloatMillisecondsDurationArrayProperty":"Encode.Duration.Property.FloatMillisecondsDurationArrayProperty","encode.duration.property.models.FloatMillisecondsDurationProperty":"Encode.Duration.Property.FloatMillisecondsDurationProperty","encode.duration.property.models.FloatMillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatMillisecondsLargerUnitDurationProperty","encode.duration.property.models.FloatSecondsDurationArrayProperty":"Encode.Duration.Property.FloatSecondsDurationArrayProperty","encode.duration.property.models.FloatSecondsDurationProperty":"Encode.Duration.Property.FloatSecondsDurationProperty","encode.duration.property.models.FloatSecondsLargerUnitDurationProperty":"Encode.Duration.Property.FloatSecondsLargerUnitDurationProperty","encode.duration.property.models.ISO8601DurationProperty":"Encode.Duration.Property.ISO8601DurationProperty","encode.duration.property.models.Int32MillisecondsDurationProperty":"Encode.Duration.Property.Int32MillisecondsDurationProperty","encode.duration.property.models.Int32MillisecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32MillisecondsLargerUnitDurationProperty","encode.duration.property.models.Int32SecondsDurationProperty":"Encode.Duration.Property.Int32SecondsDurationProperty","encode.duration.property.models.Int32SecondsLargerUnitDurationProperty":"Encode.Duration.Property.Int32SecondsLargerUnitDurationProperty"},"generatedFiles":["src/main/java/encode/duration/DurationClientBuilder.java","src/main/java/encode/duration/HeaderAsyncClient.java","src/main/java/encode/duration/HeaderClient.java","src/main/java/encode/duration/LossyAsyncClient.java","src/main/java/encode/duration/LossyClient.java","src/main/java/encode/duration/PropertyAsyncClient.java","src/main/java/encode/duration/PropertyClient.java","src/main/java/encode/duration/QueryAsyncClient.java","src/main/java/encode/duration/QueryClient.java","src/main/java/encode/duration/implementation/DurationClientImpl.java","src/main/java/encode/duration/implementation/HeadersImpl.java","src/main/java/encode/duration/implementation/LossiesImpl.java","src/main/java/encode/duration/implementation/PropertiesImpl.java","src/main/java/encode/duration/implementation/QueriesImpl.java","src/main/java/encode/duration/implementation/package-info.java","src/main/java/encode/duration/package-info.java","src/main/java/encode/duration/property/models/DefaultDurationProperty.java","src/main/java/encode/duration/property/models/Float64MillisecondsDurationProperty.java","src/main/java/encode/duration/property/models/Float64SecondsDurationProperty.java","src/main/java/encode/duration/property/models/FloatMillisecondsDurationArrayProperty.java","src/main/java/encode/duration/property/models/FloatMillisecondsDurationProperty.java","src/main/java/encode/duration/property/models/FloatMillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/FloatSecondsDurationArrayProperty.java","src/main/java/encode/duration/property/models/FloatSecondsDurationProperty.java","src/main/java/encode/duration/property/models/FloatSecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/ISO8601DurationProperty.java","src/main/java/encode/duration/property/models/Int32MillisecondsDurationProperty.java","src/main/java/encode/duration/property/models/Int32MillisecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/Int32SecondsDurationProperty.java","src/main/java/encode/duration/property/models/Int32SecondsLargerUnitDurationProperty.java","src/main/java/encode/duration/property/models/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/parameters-query_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/parameters-query_metadata.json index d2540b329d8..c8368fc551b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/parameters-query_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/parameters-query_metadata.json @@ -1 +1 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Parameters.Query","crossLanguageVersion":"d221aa20c419","crossLanguageDefinitions":{"parameters.query.ConstantAsyncClient":"Parameters.Query.Constant","parameters.query.ConstantAsyncClient.post":"Parameters.Query.Constant.post","parameters.query.ConstantAsyncClient.postWithResponse":"Parameters.Query.Constant.post","parameters.query.ConstantClient":"Parameters.Query.Constant","parameters.query.ConstantClient.post":"Parameters.Query.Constant.post","parameters.query.ConstantClient.postWithResponse":"Parameters.Query.Constant.post","parameters.query.QueryClientBuilder":"Parameters.Query","parameters.query.SpecialCharAsyncClient":"Parameters.Query.SpecialChar","parameters.query.SpecialCharAsyncClient.dollarSign":"Parameters.Query.SpecialChar.dollarSign","parameters.query.SpecialCharAsyncClient.dollarSignWithResponse":"Parameters.Query.SpecialChar.dollarSign","parameters.query.SpecialCharClient":"Parameters.Query.SpecialChar","parameters.query.SpecialCharClient.dollarSign":"Parameters.Query.SpecialChar.dollarSign","parameters.query.SpecialCharClient.dollarSignWithResponse":"Parameters.Query.SpecialChar.dollarSign"},"generatedFiles":["src/main/java/module-info.java","src/main/java/parameters/query/ConstantAsyncClient.java","src/main/java/parameters/query/ConstantClient.java","src/main/java/parameters/query/QueryClientBuilder.java","src/main/java/parameters/query/SpecialCharAsyncClient.java","src/main/java/parameters/query/SpecialCharClient.java","src/main/java/parameters/query/implementation/ConstantsImpl.java","src/main/java/parameters/query/implementation/QueryClientImpl.java","src/main/java/parameters/query/implementation/SpecialCharsImpl.java","src/main/java/parameters/query/implementation/package-info.java","src/main/java/parameters/query/package-info.java"]} \ No newline at end of file +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Parameters.Query","crossLanguageVersion":"8e99b5930726","crossLanguageDefinitions":{"parameters.query.ConstantAsyncClient":"Parameters.Query.Constant","parameters.query.ConstantAsyncClient.post":"Parameters.Query.Constant.post","parameters.query.ConstantAsyncClient.postWithResponse":"Parameters.Query.Constant.post","parameters.query.ConstantClient":"Parameters.Query.Constant","parameters.query.ConstantClient.post":"Parameters.Query.Constant.post","parameters.query.ConstantClient.postWithResponse":"Parameters.Query.Constant.post","parameters.query.QueryClientBuilder":"Parameters.Query","parameters.query.SpecialCharAsyncClient":"Parameters.Query.SpecialChar","parameters.query.SpecialCharAsyncClient.dollarSign":"Parameters.Query.SpecialChar.dollarSign","parameters.query.SpecialCharAsyncClient.dollarSignWithResponse":"Parameters.Query.SpecialChar.dollarSign","parameters.query.SpecialCharClient":"Parameters.Query.SpecialChar","parameters.query.SpecialCharClient.dollarSign":"Parameters.Query.SpecialChar.dollarSign","parameters.query.SpecialCharClient.dollarSignWithResponse":"Parameters.Query.SpecialChar.dollarSign"},"generatedFiles":["src/main/java/module-info.java","src/main/java/parameters/query/ConstantAsyncClient.java","src/main/java/parameters/query/ConstantClient.java","src/main/java/parameters/query/QueryClientBuilder.java","src/main/java/parameters/query/SpecialCharAsyncClient.java","src/main/java/parameters/query/SpecialCharClient.java","src/main/java/parameters/query/implementation/ConstantsImpl.java","src/main/java/parameters/query/implementation/QueryClientImpl.java","src/main/java/parameters/query/implementation/SpecialCharsImpl.java","src/main/java/parameters/query/implementation/package-info.java","src/main/java/parameters/query/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_metadata.json index c0361dceeb5..f25f8e9115c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/routes_metadata.json @@ -1 +1 @@ -{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Routes","crossLanguageVersion":"61e0326a00d1","crossLanguageDefinitions":{"routes.InInterfaceAsyncClient":"Routes.InInterface","routes.InInterfaceAsyncClient.fixed":"Routes.InInterface.fixed","routes.InInterfaceAsyncClient.fixedWithResponse":"Routes.InInterface.fixed","routes.InInterfaceClient":"Routes.InInterface","routes.InInterfaceClient.fixed":"Routes.InInterface.fixed","routes.InInterfaceClient.fixedWithResponse":"Routes.InInterface.fixed","routes.PathParametersAsyncClient":"Routes.PathParameters","routes.PathParametersAsyncClient.annotationOnly":"Routes.PathParameters.annotationOnly","routes.PathParametersAsyncClient.annotationOnlyWithResponse":"Routes.PathParameters.annotationOnly","routes.PathParametersAsyncClient.explicit":"Routes.PathParameters.explicit","routes.PathParametersAsyncClient.explicitWithResponse":"Routes.PathParameters.explicit","routes.PathParametersAsyncClient.templateOnly":"Routes.PathParameters.templateOnly","routes.PathParametersAsyncClient.templateOnlyWithResponse":"Routes.PathParameters.templateOnly","routes.PathParametersClient":"Routes.PathParameters","routes.PathParametersClient.annotationOnly":"Routes.PathParameters.annotationOnly","routes.PathParametersClient.annotationOnlyWithResponse":"Routes.PathParameters.annotationOnly","routes.PathParametersClient.explicit":"Routes.PathParameters.explicit","routes.PathParametersClient.explicitWithResponse":"Routes.PathParameters.explicit","routes.PathParametersClient.templateOnly":"Routes.PathParameters.templateOnly","routes.PathParametersClient.templateOnlyWithResponse":"Routes.PathParameters.templateOnly","routes.PathParametersLabelExpansionExplodeAsyncClient":"Routes.PathParameters.LabelExpansion.Explode","routes.PathParametersLabelExpansionExplodeAsyncClient.array":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeAsyncClient.record":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionExplodeClient":"Routes.PathParameters.LabelExpansion.Explode","routes.PathParametersLabelExpansionExplodeClient.array":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeClient.primitive":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeClient.record":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionStandardAsyncClient":"Routes.PathParameters.LabelExpansion.Standard","routes.PathParametersLabelExpansionStandardAsyncClient.array":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardAsyncClient.primitive":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardAsyncClient.record":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersLabelExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersLabelExpansionStandardClient":"Routes.PathParameters.LabelExpansion.Standard","routes.PathParametersLabelExpansionStandardClient.array":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardClient.primitive":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardClient.record":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersLabelExpansionStandardClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersMatrixExpansionExplodeAsyncClient":"Routes.PathParameters.MatrixExpansion.Explode","routes.PathParametersMatrixExpansionExplodeAsyncClient.array":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeAsyncClient.record":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionExplodeClient":"Routes.PathParameters.MatrixExpansion.Explode","routes.PathParametersMatrixExpansionExplodeClient.array":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeClient.primitive":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeClient.record":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionStandardAsyncClient":"Routes.PathParameters.MatrixExpansion.Standard","routes.PathParametersMatrixExpansionStandardAsyncClient.array":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardAsyncClient.primitive":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardAsyncClient.record":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersMatrixExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersMatrixExpansionStandardClient":"Routes.PathParameters.MatrixExpansion.Standard","routes.PathParametersMatrixExpansionStandardClient.array":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardClient.primitive":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardClient.record":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersMatrixExpansionStandardClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersPathExpansionExplodeAsyncClient":"Routes.PathParameters.PathExpansion.Explode","routes.PathParametersPathExpansionExplodeAsyncClient.array":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeAsyncClient.record":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionExplodeClient":"Routes.PathParameters.PathExpansion.Explode","routes.PathParametersPathExpansionExplodeClient.array":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeClient.primitive":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeClient.record":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionStandardAsyncClient":"Routes.PathParameters.PathExpansion.Standard","routes.PathParametersPathExpansionStandardAsyncClient.array":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardAsyncClient.primitive":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardAsyncClient.record":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersPathExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersPathExpansionStandardClient":"Routes.PathParameters.PathExpansion.Standard","routes.PathParametersPathExpansionStandardClient.array":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardClient.primitive":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardClient.record":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersPathExpansionStandardClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersReservedExpansionAsyncClient":"Routes.PathParameters.ReservedExpansion","routes.PathParametersReservedExpansionAsyncClient.annotation":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionAsyncClient.annotationWithResponse":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionAsyncClient.template":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersReservedExpansionAsyncClient.templateWithResponse":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersReservedExpansionClient":"Routes.PathParameters.ReservedExpansion","routes.PathParametersReservedExpansionClient.annotation":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionClient.annotationWithResponse":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionClient.template":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersReservedExpansionClient.templateWithResponse":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersSimpleExpansionExplodeAsyncClient":"Routes.PathParameters.SimpleExpansion.Explode","routes.PathParametersSimpleExpansionExplodeAsyncClient.array":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeAsyncClient.record":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionExplodeClient":"Routes.PathParameters.SimpleExpansion.Explode","routes.PathParametersSimpleExpansionExplodeClient.array":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeClient.primitive":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeClient.record":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionStandardAsyncClient":"Routes.PathParameters.SimpleExpansion.Standard","routes.PathParametersSimpleExpansionStandardAsyncClient.array":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardAsyncClient.primitive":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardAsyncClient.record":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.PathParametersSimpleExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.PathParametersSimpleExpansionStandardClient":"Routes.PathParameters.SimpleExpansion.Standard","routes.PathParametersSimpleExpansionStandardClient.array":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardClient.primitive":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardClient.record":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.PathParametersSimpleExpansionStandardClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.QueryParametersAsyncClient":"Routes.QueryParameters","routes.QueryParametersAsyncClient.annotationOnly":"Routes.QueryParameters.annotationOnly","routes.QueryParametersAsyncClient.annotationOnlyWithResponse":"Routes.QueryParameters.annotationOnly","routes.QueryParametersAsyncClient.explicit":"Routes.QueryParameters.explicit","routes.QueryParametersAsyncClient.explicitWithResponse":"Routes.QueryParameters.explicit","routes.QueryParametersAsyncClient.templateOnly":"Routes.QueryParameters.templateOnly","routes.QueryParametersAsyncClient.templateOnlyWithResponse":"Routes.QueryParameters.templateOnly","routes.QueryParametersClient":"Routes.QueryParameters","routes.QueryParametersClient.annotationOnly":"Routes.QueryParameters.annotationOnly","routes.QueryParametersClient.annotationOnlyWithResponse":"Routes.QueryParameters.annotationOnly","routes.QueryParametersClient.explicit":"Routes.QueryParameters.explicit","routes.QueryParametersClient.explicitWithResponse":"Routes.QueryParameters.explicit","routes.QueryParametersClient.templateOnly":"Routes.QueryParameters.templateOnly","routes.QueryParametersClient.templateOnlyWithResponse":"Routes.QueryParameters.templateOnly","routes.QueryParametersQueryContinuationExplodeAsyncClient":"Routes.QueryParameters.QueryContinuation.Explode","routes.QueryParametersQueryContinuationExplodeAsyncClient.array":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeAsyncClient.primitive":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeAsyncClient.record":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationExplodeAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationExplodeClient":"Routes.QueryParameters.QueryContinuation.Explode","routes.QueryParametersQueryContinuationExplodeClient.array":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeClient.primitive":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeClient.record":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationExplodeClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationStandardAsyncClient":"Routes.QueryParameters.QueryContinuation.Standard","routes.QueryParametersQueryContinuationStandardAsyncClient.array":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardAsyncClient.primitive":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardAsyncClient.record":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryContinuationStandardAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryContinuationStandardClient":"Routes.QueryParameters.QueryContinuation.Standard","routes.QueryParametersQueryContinuationStandardClient.array":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardClient.primitive":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardClient.record":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryContinuationStandardClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryExpansionExplodeAsyncClient":"Routes.QueryParameters.QueryExpansion.Explode","routes.QueryParametersQueryExpansionExplodeAsyncClient.array":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeAsyncClient.primitive":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeAsyncClient.record":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionExplodeAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionExplodeClient":"Routes.QueryParameters.QueryExpansion.Explode","routes.QueryParametersQueryExpansionExplodeClient.array":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeClient.primitive":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeClient.record":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionExplodeClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionStandardAsyncClient":"Routes.QueryParameters.QueryExpansion.Standard","routes.QueryParametersQueryExpansionStandardAsyncClient.array":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardAsyncClient.primitive":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardAsyncClient.record":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.QueryParametersQueryExpansionStandardAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.QueryParametersQueryExpansionStandardClient":"Routes.QueryParameters.QueryExpansion.Standard","routes.QueryParametersQueryExpansionStandardClient.array":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardClient.primitive":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardClient.record":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.QueryParametersQueryExpansionStandardClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.RoutesAsyncClient":"Routes","routes.RoutesAsyncClient.fixed":"Routes.fixed","routes.RoutesAsyncClient.fixedWithResponse":"Routes.fixed","routes.RoutesClient":"Routes","routes.RoutesClient.fixed":"Routes.fixed","routes.RoutesClient.fixedWithResponse":"Routes.fixed","routes.RoutesClientBuilder":"Routes"},"generatedFiles":["src/main/java/module-info.java","src/main/java/routes/InInterfaceAsyncClient.java","src/main/java/routes/InInterfaceClient.java","src/main/java/routes/PathParametersAsyncClient.java","src/main/java/routes/PathParametersClient.java","src/main/java/routes/PathParametersLabelExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersLabelExpansionExplodeClient.java","src/main/java/routes/PathParametersLabelExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersLabelExpansionStandardClient.java","src/main/java/routes/PathParametersMatrixExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersMatrixExpansionExplodeClient.java","src/main/java/routes/PathParametersMatrixExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersMatrixExpansionStandardClient.java","src/main/java/routes/PathParametersPathExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersPathExpansionExplodeClient.java","src/main/java/routes/PathParametersPathExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersPathExpansionStandardClient.java","src/main/java/routes/PathParametersReservedExpansionAsyncClient.java","src/main/java/routes/PathParametersReservedExpansionClient.java","src/main/java/routes/PathParametersSimpleExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersSimpleExpansionExplodeClient.java","src/main/java/routes/PathParametersSimpleExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersSimpleExpansionStandardClient.java","src/main/java/routes/QueryParametersAsyncClient.java","src/main/java/routes/QueryParametersClient.java","src/main/java/routes/QueryParametersQueryContinuationExplodeAsyncClient.java","src/main/java/routes/QueryParametersQueryContinuationExplodeClient.java","src/main/java/routes/QueryParametersQueryContinuationStandardAsyncClient.java","src/main/java/routes/QueryParametersQueryContinuationStandardClient.java","src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java","src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java","src/main/java/routes/QueryParametersQueryExpansionStandardAsyncClient.java","src/main/java/routes/QueryParametersQueryExpansionStandardClient.java","src/main/java/routes/RoutesAsyncClient.java","src/main/java/routes/RoutesClient.java","src/main/java/routes/RoutesClientBuilder.java","src/main/java/routes/implementation/InInterfacesImpl.java","src/main/java/routes/implementation/PathParametersImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersReservedExpansionsImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java","src/main/java/routes/implementation/QueryParametersImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java","src/main/java/routes/implementation/RoutesClientImpl.java","src/main/java/routes/implementation/package-info.java","src/main/java/routes/package-info.java"]} \ No newline at end of file +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Routes","crossLanguageVersion":"c6a64c6e889c","crossLanguageDefinitions":{"routes.InInterfaceAsyncClient":"Routes.InInterface","routes.InInterfaceAsyncClient.fixed":"Routes.InInterface.fixed","routes.InInterfaceAsyncClient.fixedWithResponse":"Routes.InInterface.fixed","routes.InInterfaceClient":"Routes.InInterface","routes.InInterfaceClient.fixed":"Routes.InInterface.fixed","routes.InInterfaceClient.fixedWithResponse":"Routes.InInterface.fixed","routes.PathParametersAsyncClient":"Routes.PathParameters","routes.PathParametersAsyncClient.annotationOnly":"Routes.PathParameters.annotationOnly","routes.PathParametersAsyncClient.annotationOnlyWithResponse":"Routes.PathParameters.annotationOnly","routes.PathParametersAsyncClient.explicit":"Routes.PathParameters.explicit","routes.PathParametersAsyncClient.explicitWithResponse":"Routes.PathParameters.explicit","routes.PathParametersAsyncClient.templateOnly":"Routes.PathParameters.templateOnly","routes.PathParametersAsyncClient.templateOnlyWithResponse":"Routes.PathParameters.templateOnly","routes.PathParametersClient":"Routes.PathParameters","routes.PathParametersClient.annotationOnly":"Routes.PathParameters.annotationOnly","routes.PathParametersClient.annotationOnlyWithResponse":"Routes.PathParameters.annotationOnly","routes.PathParametersClient.explicit":"Routes.PathParameters.explicit","routes.PathParametersClient.explicitWithResponse":"Routes.PathParameters.explicit","routes.PathParametersClient.templateOnly":"Routes.PathParameters.templateOnly","routes.PathParametersClient.templateOnlyWithResponse":"Routes.PathParameters.templateOnly","routes.PathParametersLabelExpansionExplodeAsyncClient":"Routes.PathParameters.LabelExpansion.Explode","routes.PathParametersLabelExpansionExplodeAsyncClient.array":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeAsyncClient.record":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionExplodeClient":"Routes.PathParameters.LabelExpansion.Explode","routes.PathParametersLabelExpansionExplodeClient.array":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Explode.array","routes.PathParametersLabelExpansionExplodeClient.primitive":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Explode.primitive","routes.PathParametersLabelExpansionExplodeClient.record":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Explode.record","routes.PathParametersLabelExpansionStandardAsyncClient":"Routes.PathParameters.LabelExpansion.Standard","routes.PathParametersLabelExpansionStandardAsyncClient.array":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardAsyncClient.primitive":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardAsyncClient.record":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersLabelExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersLabelExpansionStandardClient":"Routes.PathParameters.LabelExpansion.Standard","routes.PathParametersLabelExpansionStandardClient.array":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.LabelExpansion.Standard.array","routes.PathParametersLabelExpansionStandardClient.primitive":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.LabelExpansion.Standard.primitive","routes.PathParametersLabelExpansionStandardClient.record":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersLabelExpansionStandardClient.recordWithResponse":"Routes.PathParameters.LabelExpansion.Standard.record","routes.PathParametersMatrixExpansionExplodeAsyncClient":"Routes.PathParameters.MatrixExpansion.Explode","routes.PathParametersMatrixExpansionExplodeAsyncClient.array":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeAsyncClient.record":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionExplodeClient":"Routes.PathParameters.MatrixExpansion.Explode","routes.PathParametersMatrixExpansionExplodeClient.array":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.array","routes.PathParametersMatrixExpansionExplodeClient.primitive":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.primitive","routes.PathParametersMatrixExpansionExplodeClient.record":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Explode.record","routes.PathParametersMatrixExpansionStandardAsyncClient":"Routes.PathParameters.MatrixExpansion.Standard","routes.PathParametersMatrixExpansionStandardAsyncClient.array":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardAsyncClient.primitive":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardAsyncClient.record":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersMatrixExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersMatrixExpansionStandardClient":"Routes.PathParameters.MatrixExpansion.Standard","routes.PathParametersMatrixExpansionStandardClient.array":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.array","routes.PathParametersMatrixExpansionStandardClient.primitive":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.primitive","routes.PathParametersMatrixExpansionStandardClient.record":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersMatrixExpansionStandardClient.recordWithResponse":"Routes.PathParameters.MatrixExpansion.Standard.record","routes.PathParametersPathExpansionExplodeAsyncClient":"Routes.PathParameters.PathExpansion.Explode","routes.PathParametersPathExpansionExplodeAsyncClient.array":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeAsyncClient.record":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionExplodeClient":"Routes.PathParameters.PathExpansion.Explode","routes.PathParametersPathExpansionExplodeClient.array":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Explode.array","routes.PathParametersPathExpansionExplodeClient.primitive":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Explode.primitive","routes.PathParametersPathExpansionExplodeClient.record":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Explode.record","routes.PathParametersPathExpansionStandardAsyncClient":"Routes.PathParameters.PathExpansion.Standard","routes.PathParametersPathExpansionStandardAsyncClient.array":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardAsyncClient.primitive":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardAsyncClient.record":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersPathExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersPathExpansionStandardClient":"Routes.PathParameters.PathExpansion.Standard","routes.PathParametersPathExpansionStandardClient.array":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.PathExpansion.Standard.array","routes.PathParametersPathExpansionStandardClient.primitive":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.PathExpansion.Standard.primitive","routes.PathParametersPathExpansionStandardClient.record":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersPathExpansionStandardClient.recordWithResponse":"Routes.PathParameters.PathExpansion.Standard.record","routes.PathParametersReservedExpansionAsyncClient":"Routes.PathParameters.ReservedExpansion","routes.PathParametersReservedExpansionAsyncClient.annotation":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionAsyncClient.annotationWithResponse":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionAsyncClient.template":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersReservedExpansionAsyncClient.templateWithResponse":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersReservedExpansionClient":"Routes.PathParameters.ReservedExpansion","routes.PathParametersReservedExpansionClient.annotation":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionClient.annotationWithResponse":"Routes.PathParameters.ReservedExpansion.annotation","routes.PathParametersReservedExpansionClient.template":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersReservedExpansionClient.templateWithResponse":"Routes.PathParameters.ReservedExpansion.template","routes.PathParametersSimpleExpansionExplodeAsyncClient":"Routes.PathParameters.SimpleExpansion.Explode","routes.PathParametersSimpleExpansionExplodeAsyncClient.array":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeAsyncClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeAsyncClient.primitive":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeAsyncClient.record":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionExplodeAsyncClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionExplodeClient":"Routes.PathParameters.SimpleExpansion.Explode","routes.PathParametersSimpleExpansionExplodeClient.array":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.array","routes.PathParametersSimpleExpansionExplodeClient.primitive":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.primitive","routes.PathParametersSimpleExpansionExplodeClient.record":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionExplodeClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Explode.record","routes.PathParametersSimpleExpansionStandardAsyncClient":"Routes.PathParameters.SimpleExpansion.Standard","routes.PathParametersSimpleExpansionStandardAsyncClient.array":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardAsyncClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardAsyncClient.primitive":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardAsyncClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardAsyncClient.record":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.PathParametersSimpleExpansionStandardAsyncClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.PathParametersSimpleExpansionStandardClient":"Routes.PathParameters.SimpleExpansion.Standard","routes.PathParametersSimpleExpansionStandardClient.array":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardClient.arrayWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.array","routes.PathParametersSimpleExpansionStandardClient.primitive":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardClient.primitiveWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.primitive","routes.PathParametersSimpleExpansionStandardClient.record":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.PathParametersSimpleExpansionStandardClient.recordWithResponse":"Routes.PathParameters.SimpleExpansion.Standard.record","routes.QueryParametersAsyncClient":"Routes.QueryParameters","routes.QueryParametersAsyncClient.annotationOnly":"Routes.QueryParameters.annotationOnly","routes.QueryParametersAsyncClient.annotationOnlyWithResponse":"Routes.QueryParameters.annotationOnly","routes.QueryParametersAsyncClient.explicit":"Routes.QueryParameters.explicit","routes.QueryParametersAsyncClient.explicitWithResponse":"Routes.QueryParameters.explicit","routes.QueryParametersAsyncClient.templateOnly":"Routes.QueryParameters.templateOnly","routes.QueryParametersAsyncClient.templateOnlyWithResponse":"Routes.QueryParameters.templateOnly","routes.QueryParametersClient":"Routes.QueryParameters","routes.QueryParametersClient.annotationOnly":"Routes.QueryParameters.annotationOnly","routes.QueryParametersClient.annotationOnlyWithResponse":"Routes.QueryParameters.annotationOnly","routes.QueryParametersClient.explicit":"Routes.QueryParameters.explicit","routes.QueryParametersClient.explicitWithResponse":"Routes.QueryParameters.explicit","routes.QueryParametersClient.templateOnly":"Routes.QueryParameters.templateOnly","routes.QueryParametersClient.templateOnlyWithResponse":"Routes.QueryParameters.templateOnly","routes.QueryParametersQueryContinuationExplodeAsyncClient":"Routes.QueryParameters.QueryContinuation.Explode","routes.QueryParametersQueryContinuationExplodeAsyncClient.array":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeAsyncClient.primitive":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeAsyncClient.record":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationExplodeAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationExplodeClient":"Routes.QueryParameters.QueryContinuation.Explode","routes.QueryParametersQueryContinuationExplodeClient.array":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.array","routes.QueryParametersQueryContinuationExplodeClient.primitive":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.primitive","routes.QueryParametersQueryContinuationExplodeClient.record":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationExplodeClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Explode.record","routes.QueryParametersQueryContinuationStandardAsyncClient":"Routes.QueryParameters.QueryContinuation.Standard","routes.QueryParametersQueryContinuationStandardAsyncClient.array":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardAsyncClient.primitive":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardAsyncClient.record":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryContinuationStandardAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryContinuationStandardClient":"Routes.QueryParameters.QueryContinuation.Standard","routes.QueryParametersQueryContinuationStandardClient.array":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardClient.arrayWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.array","routes.QueryParametersQueryContinuationStandardClient.primitive":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardClient.primitiveWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.primitive","routes.QueryParametersQueryContinuationStandardClient.record":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryContinuationStandardClient.recordWithResponse":"Routes.QueryParameters.QueryContinuation.Standard.record","routes.QueryParametersQueryExpansionExplodeAsyncClient":"Routes.QueryParameters.QueryExpansion.Explode","routes.QueryParametersQueryExpansionExplodeAsyncClient.array":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeAsyncClient.model":"Routes.QueryParameters.QueryExpansion.Explode.model","routes.QueryParametersQueryExpansionExplodeAsyncClient.modelWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.model","routes.QueryParametersQueryExpansionExplodeAsyncClient.primitive":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeAsyncClient.record":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionExplodeAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionExplodeClient":"Routes.QueryParameters.QueryExpansion.Explode","routes.QueryParametersQueryExpansionExplodeClient.array":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.array","routes.QueryParametersQueryExpansionExplodeClient.model":"Routes.QueryParameters.QueryExpansion.Explode.model","routes.QueryParametersQueryExpansionExplodeClient.modelWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.model","routes.QueryParametersQueryExpansionExplodeClient.primitive":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.primitive","routes.QueryParametersQueryExpansionExplodeClient.record":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionExplodeClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Explode.record","routes.QueryParametersQueryExpansionStandardAsyncClient":"Routes.QueryParameters.QueryExpansion.Standard","routes.QueryParametersQueryExpansionStandardAsyncClient.array":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardAsyncClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardAsyncClient.primitive":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardAsyncClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardAsyncClient.record":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.QueryParametersQueryExpansionStandardAsyncClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.QueryParametersQueryExpansionStandardClient":"Routes.QueryParameters.QueryExpansion.Standard","routes.QueryParametersQueryExpansionStandardClient.array":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardClient.arrayWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.array","routes.QueryParametersQueryExpansionStandardClient.primitive":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardClient.primitiveWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.primitive","routes.QueryParametersQueryExpansionStandardClient.record":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.QueryParametersQueryExpansionStandardClient.recordWithResponse":"Routes.QueryParameters.QueryExpansion.Standard.record","routes.RoutesAsyncClient":"Routes","routes.RoutesAsyncClient.fixed":"Routes.fixed","routes.RoutesAsyncClient.fixedWithResponse":"Routes.fixed","routes.RoutesClient":"Routes","routes.RoutesClient.fixed":"Routes.fixed","routes.RoutesClient.fixedWithResponse":"Routes.fixed","routes.RoutesClientBuilder":"Routes","routes.models.ExpandParameters":"Routes.ExpandParameters"},"generatedFiles":["src/main/java/module-info.java","src/main/java/routes/InInterfaceAsyncClient.java","src/main/java/routes/InInterfaceClient.java","src/main/java/routes/PathParametersAsyncClient.java","src/main/java/routes/PathParametersClient.java","src/main/java/routes/PathParametersLabelExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersLabelExpansionExplodeClient.java","src/main/java/routes/PathParametersLabelExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersLabelExpansionStandardClient.java","src/main/java/routes/PathParametersMatrixExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersMatrixExpansionExplodeClient.java","src/main/java/routes/PathParametersMatrixExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersMatrixExpansionStandardClient.java","src/main/java/routes/PathParametersPathExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersPathExpansionExplodeClient.java","src/main/java/routes/PathParametersPathExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersPathExpansionStandardClient.java","src/main/java/routes/PathParametersReservedExpansionAsyncClient.java","src/main/java/routes/PathParametersReservedExpansionClient.java","src/main/java/routes/PathParametersSimpleExpansionExplodeAsyncClient.java","src/main/java/routes/PathParametersSimpleExpansionExplodeClient.java","src/main/java/routes/PathParametersSimpleExpansionStandardAsyncClient.java","src/main/java/routes/PathParametersSimpleExpansionStandardClient.java","src/main/java/routes/QueryParametersAsyncClient.java","src/main/java/routes/QueryParametersClient.java","src/main/java/routes/QueryParametersQueryContinuationExplodeAsyncClient.java","src/main/java/routes/QueryParametersQueryContinuationExplodeClient.java","src/main/java/routes/QueryParametersQueryContinuationStandardAsyncClient.java","src/main/java/routes/QueryParametersQueryContinuationStandardClient.java","src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java","src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java","src/main/java/routes/QueryParametersQueryExpansionStandardAsyncClient.java","src/main/java/routes/QueryParametersQueryExpansionStandardClient.java","src/main/java/routes/RoutesAsyncClient.java","src/main/java/routes/RoutesClient.java","src/main/java/routes/RoutesClientBuilder.java","src/main/java/routes/implementation/InInterfacesImpl.java","src/main/java/routes/implementation/PathParametersImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersLabelExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersMatrixExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersPathExpansionStandardsImpl.java","src/main/java/routes/implementation/PathParametersReservedExpansionsImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionExplodesImpl.java","src/main/java/routes/implementation/PathParametersSimpleExpansionStandardsImpl.java","src/main/java/routes/implementation/QueryParametersImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryContinuationStandardsImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java","src/main/java/routes/implementation/QueryParametersQueryExpansionStandardsImpl.java","src/main/java/routes/implementation/RoutesClientImpl.java","src/main/java/routes/implementation/package-info.java","src/main/java/routes/models/ExpandParameters.java","src/main/java/routes/models/package-info.java","src/main/java/routes/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/encode-booleannamespace.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/encode-booleannamespace.properties new file mode 100644 index 00000000000..ca812989b4f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/encode-booleannamespace.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/generated/BooleanClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/generated/BooleanClientTestBase.java new file mode 100644 index 00000000000..7eaa26636e5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/generated/BooleanClientTestBase.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package encode.booleannamespace.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 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 encode.booleannamespace.BooleanClient; +import encode.booleannamespace.BooleanClientBuilder; + +class BooleanClientTestBase extends TestProxyTestBase { + protected BooleanClient booleanClient; + + @Override + protected void beforeTest() { + BooleanClientBuilder booleanClientbuilder = new BooleanClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + booleanClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + booleanClient = booleanClientbuilder.buildClient(); + + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/generated/DurationClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/generated/DurationClientTestBase.java index 950f6c711fe..453c4357c3b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/generated/DurationClientTestBase.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/generated/DurationClientTestBase.java @@ -15,6 +15,7 @@ import com.azure.core.util.Configuration; import encode.duration.DurationClientBuilder; import encode.duration.HeaderClient; +import encode.duration.LossyClient; import encode.duration.PropertyClient; import encode.duration.QueryClient; @@ -25,6 +26,8 @@ class DurationClientTestBase extends TestProxyTestBase { protected HeaderClient headerClient; + protected LossyClient lossyClient; + @Override protected void beforeTest() { DurationClientBuilder queryClientbuilder = new DurationClientBuilder() @@ -54,5 +57,14 @@ protected void beforeTest() { } headerClient = headerClientbuilder.buildHeaderClient(); + DurationClientBuilder lossyClientbuilder = new DurationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + lossyClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + lossyClient = lossyClientbuilder.buildLossyClient(); + } } diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json index b58c448bae3..52a4b5d9f11 100644 --- a/packages/http-client-java/package-lock.json +++ b/packages/http-client-java/package-lock.json @@ -10,51 +10,51 @@ "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.1", - "yaml": "^2.8.3" + "yaml": "^2.9.0" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.69.1", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-azure-rulesets": "0.69.2", - "@azure-tools/typespec-client-generator-core": "0.69.2", + "@azure-tools/typespec-autorest": "0.70.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-azure-rulesets": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", "@microsoft/api-extractor": "^7.58.9", "@microsoft/api-extractor-model": "^7.33.8", - "@types/node": "~26.1.0", - "@typespec/compiler": "1.13.0", - "@typespec/events": "0.83.0", - "@typespec/http": "1.13.0", - "@typespec/openapi": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/sse": "0.83.0", - "@typespec/streams": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0", - "@vitest/coverage-v8": "^4.1.9", - "@vitest/ui": "^4.1.9", + "@types/node": "~26.1.1", + "@typespec/compiler": "1.14.0", + "@typespec/events": "0.84.0", + "@typespec/http": "1.14.0", + "@typespec/openapi": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0", + "@vitest/coverage-v8": "^4.1.10", + "@vitest/ui": "^4.1.10", "c8": "~11.0.0", "rimraf": "~6.1.3", - "typescript": "~6.0.3", - "vitest": "^4.1.9" + "typescript": "~7.0.2", + "vitest": "^4.1.10" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.2 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": ">=0.83.0 <1.0.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/sse": ">=0.83.0 <1.0.0", - "@typespec/streams": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.70.0 <1.0.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": ">=0.84.0 <1.0.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": ">=0.84.0 <1.0.0", + "@typespec/sse": ">=0.84.0 <1.0.0", + "@typespec/streams": ">=0.84.0 <1.0.0", + "@typespec/versioning": ">=0.84.0 <1.0.0", + "@typespec/xml": ">=0.84.0 <1.0.0" } }, "node_modules/@autorest/codemodel": { @@ -143,24 +143,27 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.69.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.69.1.tgz", - "integrity": "sha512-nbAsTagr4pyBO0ajlRnE5TW4tAXrYKFYSoWD+8bevXpe23bkVIJkDUJCZPSgWE7CBf3kxfw53lAb70a50oJmRA==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.70.0.tgz", + "integrity": "sha512-OaxLkgMcuOXAbaqTNpezmFF24jtkiIH1+2PBwAeRo3ZG7C1r7Hf8xZwCK6KVtBEgMbqnrd5eCqxsPl1zy3y9/Q==", "dev": true, "license": "MIT", + "dependencies": { + "yaml": "^2.8.3" + }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.1", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/xml": { @@ -169,28 +172,26 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", - "integrity": "sha512-UNdPb/DgMvXqwWk9hb54QOAumCJ6u6GGy+bj3RIIT1Sht6FR9rIn8AQ/UQ7WtrhbJBoqvQo5dxtS565a9/VRZw==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", + "integrity": "sha512-8MojHWRtTLKycJJ98IMoXX/5b9tTo3F0d3Iu20OKoCsORnSDG2NfjOWHJVW63oxA2t8VTlqC6J8BDcnRihygQQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.69.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.69.2.tgz", - "integrity": "sha512-8Kcn68zKwRsAOc4LICYHOeGq9w5sCDLaXp2t0x0/DibVtYlKJI3ixQnUCW1P7et0nyKp92UZNKvjdUXC1kEINg==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.70.0.tgz", + "integrity": "sha512-hVrbbsOhU3EQ2yQTppCqsGQwY/HcVZPOINtFkoUo+PUVBmCFXyqLkTO4jvUbsp/LvJEwoQ8aEA8Y35f7VWT5uw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "change-case": "^5.4.4", "pluralize": "^8.0.0" @@ -199,37 +200,36 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.69.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.69.2.tgz", - "integrity": "sha512-7FI2Fv4weFGAjAgUnbBkh1FPCW3SxcEQElIo3SHtc4YDXYbDgvs1qCpz+eyGKEdELPnrIFJFrLa/Mu32GxSrZw==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.70.0.tgz", + "integrity": "sha512-Uxxl/18oryDwk2S+aYx6cIqiyjmoMeFDGmjuQ72a+aw6u8mZjgahMxNsY0ShvGLSchjsDqsVGaUlazXGXakVrw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.2", - "@azure-tools/typespec-client-generator-core": "^0.69.2", - "@typespec/compiler": "^1.13.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.69.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.2.tgz", - "integrity": "sha512-Td+CUO9UNioD/k2aFnv7TcffGGSaxmodshonTwts3/ZBJLmFtZI06odXr0+7/QDM9K9koPDjCg0VwTbS2c6scA==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", + "integrity": "sha512-8yxOYJfID3wp3FLQYNIa3kbmR5YLWjYtpB+i4u66quHTTQWWANHV1/o9f8xymAf+8fO9jbLo5tw1JerumxISWg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "change-case": "^5.4.4", "pluralize": "^8.0.0", @@ -239,16 +239,16 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure/abort-controller": { @@ -285,7 +285,6 @@ "integrity": "sha512-1D2LpsU7y9xrqKjdIbsB7PlrRePw0xsVV8p+AKTlzITrWmscajryfJCdDJB/oGwvDI5HmRo04eMMADB67uwAwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -351,7 +350,6 @@ "integrity": "sha512-PpLsoDQ3AMmKZ0VU+0GrmqMxgp/sExjlVm4R+nLWngeoEGAzOIPVifaxKGU5gMv+nWELUoHfvrolWD+ZS/nFJg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", @@ -1148,48 +1146,10 @@ ], "license": "MIT" }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@oxc-project/types": { - "version": "0.137.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.137.0.tgz", - "integrity": "sha512-WT+Gb24i8hmvo85AIv2oEYouEXkRlKAlT9WaCa3TfLgNCN+GhrJOGZuIlMouAh38Qe4QOx26eUOVsq70qXrywA==", + "version": "0.139.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", "dev": true, "license": "MIT", "funding": { @@ -1204,9 +1164,9 @@ "license": "MIT" }, "node_modules/@rolldown/binding-android-arm64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.3.tgz", - "integrity": "sha512-DT6Z3PhvioeHMvxo+xHc3KtqggrI7CCTXCmC2h/5zUlp5jVitv7XEy+9q5/7v8IolhlioawpMo8Kg0EEBy7J0g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", "cpu": [ "arm64" ], @@ -1221,9 +1181,9 @@ } }, "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.3.tgz", - "integrity": "sha512-0NwgwsjM7LrsuVnXMK3koTpagBNOhloc/BNjKqZjv4V5zI5r13qx69uVhRx+o5Z0yy4Hzq+lpy7TAgUG/ocvrw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", "cpu": [ "arm64" ], @@ -1238,9 +1198,9 @@ } }, "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.3.tgz", - "integrity": "sha512-YtiBp4disu6V560loT6PjMdiRaWmVvDNrUunAalbiFx2ggeJwxdAsgZMcoGP17uyAsTwAj5V1niksxlHnVQ1Sw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", "cpu": [ "x64" ], @@ -1255,9 +1215,9 @@ } }, "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.3.tgz", - "integrity": "sha512-yD3EkEdXk2LypPxnf/kSZHirarsI8gcPzc62SukhR9VJTyvV+F9Q/GxWNuCojc7sXyuVC4DxRGhdDK4X8VSsbw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", "cpu": [ "x64" ], @@ -1272,9 +1232,9 @@ } }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.3.tgz", - "integrity": "sha512-c+8vieQbsD7HNAHKIA34w0GJ9FedFFuJGD+7E6vz7Q3uqAIugL5p45fhlsj4UaAsHpcmlqugBWMhA0/j7o0sIg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", "cpu": [ "arm" ], @@ -1289,9 +1249,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.3.tgz", - "integrity": "sha512-50jD0uUwLvur7Zz9LHz17kaAdTPjn5wN93hEgjvmYFRZwiR7ZJYovTd5ipyWJDAnXKvZ+wgc+/Ika6dwSF5OcA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", "cpu": [ "arm64" ], @@ -1306,9 +1266,9 @@ } }, "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.3.tgz", - "integrity": "sha512-BO9+oPL8K9poZJBfYPsXNtYjPE5uM3qeehT3aFcW4LITOl+iSqhp0abzjR2nWBUNjIZeKXjAEWBZ64WjNoHd6w==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", "cpu": [ "arm64" ], @@ -1323,9 +1283,9 @@ } }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.3.tgz", - "integrity": "sha512-f3VpLB1vQ0Eo6ecr/6cekLnvYMFF4YBFoVGkfkvPLq1bAkbAwHYQPZKoAmG6OJyTcxxoC+AvezGx/S1obNC0Mw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", "cpu": [ "ppc64" ], @@ -1340,9 +1300,9 @@ } }, "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.3.tgz", - "integrity": "sha512-AmurZ26Pqx/RI9N1gzEOCklkKXl927yjfXWUUS0O7Puh8ARM/Ob8qfrD3qnWksScdw6cSrW5PSHE9DyLu7+PtA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", "cpu": [ "s390x" ], @@ -1357,9 +1317,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.3.tgz", - "integrity": "sha512-JJpqs8bRGITDOdbkNKnlojzBabbOHrqjSvDr0IVsZObE1lBcPjxItUEY9eWIDbxaJ3cGrXPWGfGkIxFijg/URg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", "cpu": [ "x64" ], @@ -1374,9 +1334,9 @@ } }, "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.3.tgz", - "integrity": "sha512-rSJcdjPxzA/by/6/rYs+v+bXU7UjvnbUWz8MJb6kh6+knqB1dCrtHg0uu7C/4haqJvqdkYHQ5IGn+tCH9GLW/g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", "cpu": [ "x64" ], @@ -1391,9 +1351,9 @@ } }, "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.3.tgz", - "integrity": "sha512-hQ3/PYkDJICgevvyNcVrihVeqq7k1Pp3VZ9lY+dauAYUJKO+auqApvANhvR1An9BhmqYKvW2Mu1F9u4DXSMLxQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", "cpu": [ "arm64" ], @@ -1408,9 +1368,9 @@ } }, "node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.3.tgz", - "integrity": "sha512-Elcv/BtML9lXrV6JuKITc/grN2kYV9gjsQpW8Jfw4ioK0TOkjBjye0nnyqQNy9STNaI20lXNaQBRrD5gSgR0Yg==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", "cpu": [ "wasm32" ], @@ -1427,9 +1387,9 @@ } }, "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.3.tgz", - "integrity": "sha512-2DrEfhluH9yhiaFApmsjsjwrSYbNcY1oFTzYSP1a535jDbV98zCFanA/96TBUd0iDFcxGmw9QRExwGCXz3U+/g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", "cpu": [ "arm64" ], @@ -1444,9 +1404,9 @@ } }, "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.3.tgz", - "integrity": "sha512-OL4OMk7UPXOeVGGd3qo5zJyPIljf4AFgk5QAkPPS+OoLuOOozhuaQGC18MxVTnw/06q93gShAJzlwnSCY9YtqA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", "cpu": [ "x64" ], @@ -1564,19 +1524,6 @@ "string-argv": "~0.3.1" } }, - "node_modules/@sindresorhus/merge-streams": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", - "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@standard-schema/spec": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", @@ -1635,12 +1582,11 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.0.tgz", - "integrity": "sha512-O0A1G3xPGy4w7AgQdAQYUlQ+BKk2Oovw8eRpofyp5KdBZULnbe+WqaOVNrm705SHphCiG4XHsACrSmPu1f+Kgw==", + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~8.3.0" } @@ -1652,259 +1598,544 @@ "dev": true, "license": "MIT" }, - "node_modules/@typespec/compiler": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.13.0.tgz", - "integrity": "sha512-DonoHiyAMx0UjSmssqTrFtya+v97wny1aHcTLU5QF2wFzLATtcwUU9hbPC+eXhepuTunMOCHf8yk3pEsH6PZYA==", + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.29.0", - "@inquirer/prompts": "^8.4.1", - "ajv": "^8.18.0", - "change-case": "^5.4.4", - "env-paths": "^4.0.0", - "is-unicode-supported": "^2.1.0", - "mustache": "^4.2.0", - "picocolors": "^1.1.1", - "prettier": "^3.8.1", - "semver": "^7.7.4", - "tar": "^7.5.13", - "temporal-polyfill": "^0.3.2", - "vscode-languageserver": "^9.0.1", - "vscode-languageserver-textdocument": "^1.0.12", - "yaml": "^2.8.3", - "yargs": "^18.0.0" - }, - "bin": { - "tsp": "cmd/tsp.js", - "tsp-server": "cmd/tsp-server.js" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], "engines": { - "node": ">=22.0.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/events": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.83.0.tgz", - "integrity": "sha512-3EP1EIjdLgwStgd2rGWaF/QqY7YRAt+DIYnnYG2VsdPwa8s2t6K6eJ9YJDXveeHImAkHs+cpFuwxnjKMl4hOyw==", + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "peer": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=22.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/http": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.13.0.tgz", - "integrity": "sha512-tf8XFddU6g1MZSAVCLC/0Xa4fNfUO0CcHe6PWpmC3bvUojxMnpRcERI2DdoRJ+aycB9Q+Z8wN8bJO3up6u+sCw==", + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "peer": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=22.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/streams": "^0.83.0" - }, - "peerDependenciesMeta": { - "@typespec/streams": { - "optional": true - } + "node": ">=16.20.0" } }, - "node_modules/@typespec/openapi": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.13.0.tgz", - "integrity": "sha512-omPc9n+LM2WvjYwnIf31RCxmG17fFUOVLBRsWg4T1mbcsNCj4grnNP7Lwt+irIZCiKtmLKxq3ViE7jYixCkZ3g==", + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "peer": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=22.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/rest": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.83.0.tgz", - "integrity": "sha512-WMEwEe1kdaOdZ0c+ct5BVmTSBXkrPniUYDWCz3K52T4in2dNc7J6YGP6tL8bXgQz5B0CsP0VNO12N+UysQDsLw==", + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", - "peer": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=22.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/spec-api": { - "version": "0.1.0-alpha.14", - "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.14.tgz", - "integrity": "sha512-MpLVtJZMsONMB9Di9aiXRbbihqa/+4MmbDHpuwd3ka39wtRhcA3sbFQY/+oU5zVEfEAldGgVkenFd2wnoI/xkQ==", + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], "dev": true, - "license": "MIT", - "dependencies": { - "deep-equal": "^2.2.3", - "express": "^5.2.1", - "xml2js": "^0.6.2" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=20.0.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/spec-coverage-sdk": { - "version": "0.1.0-alpha.16", - "resolved": "https://registry.npmjs.org/@typespec/spec-coverage-sdk/-/spec-coverage-sdk-0.1.0-alpha.16.tgz", - "integrity": "sha512-qwSnuE+CXjv4mn2uhioTVlaO4GjypR4ZtbkSoLmWA677ggYmoAjIDpyNgT1tjsc1lDKVtSiPvGhM9XFKExVmbQ==", + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "@azure/identity": "~4.13.0", - "@azure/storage-blob": "~12.31.0", - "@types/node": "~25.3.0", - "@types/semver": "^7.5.8", - "semver": "^7.7.1" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=16.0.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/spec-coverage-sdk/node_modules/@types/node": { - "version": "25.3.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.5.tgz", - "integrity": "sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA==", + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~7.18.0" + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" } }, - "node_modules/@typespec/spec-coverage-sdk/node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@typespec/spector": { - "version": "0.1.0-alpha.25", - "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.25.tgz", - "integrity": "sha512-KxMiwA/+XDWpZOdhr7TbnsR8ppXVi+edFa9hdUuerOGQzzALbSeQYUJLUr4RErRiHpqg2/P4FyJ2E0eiA2fTYA==", + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], "dev": true, - "license": "MIT", - "dependencies": { - "@azure/identity": "~4.13.0", - "@typespec/compiler": "^1.11.0", - "@typespec/http": "^1.11.0", - "@typespec/rest": "^0.81.0", - "@typespec/spec-api": "^0.1.0-alpha.14", - "@typespec/spec-coverage-sdk": "^0.1.0-alpha.16", - "@typespec/versioning": "^0.81.0", - "ajv": "~8.18.0", - "body-parser": "^2.2.2", - "deep-equal": "^2.2.3", - "express": "^5.2.1", - "globby": "~16.1.1", - "micromatch": "^4.0.8", - "morgan": "^1.10.1", - "multer": "^2.1.1", - "picocolors": "~1.1.1", - "source-map-support": "~0.5.21", - "xml2js": "^0.6.2", - "yaml": "~2.8.2", - "yargs": "~18.0.0" - }, - "bin": { - "tsp-spector": "cmd/cli.mjs" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=16.0.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/spector/node_modules/@typespec/rest": { - "version": "0.81.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.81.0.tgz", - "integrity": "sha512-qQXZRKEvq5aNlDFEUqBiiXXPIFyr/+PWgBY0kIrnhyZzMjfUqPInkB12QgXpVp2O2Wm3jmETJD45SaLHTCYBbg==", + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.11.0", - "@typespec/http": "^1.11.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/spector/node_modules/@typespec/versioning": { - "version": "0.81.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.81.0.tgz", - "integrity": "sha512-5bha4t64xA85zLY8VGm/6jNd2kwPHzjPq/dlCUjtgGfGXv2R6Ow/YIukqhqZnwnIgNAIlZ7nguekRMRx+2oO2w==", + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.11.0" + "node": ">=16.20.0" } }, - "node_modules/@typespec/spector/node_modules/yaml": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.4.tgz", - "integrity": "sha512-ml/JPOj9fOQK8RNnWojA67GbZ0ApXAUlN2UQclwv2eVgTgn7O9gg9o7paZWKMp4g0H3nTLtS9LVzhkpOFIKzog==", + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" + "node": ">=16.20.0" } }, - "node_modules/@typespec/sse": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.83.0.tgz", - "integrity": "sha512-04WNaju2rwBbcF5pG+HrKQtdcrmSGuTVziLHNA9XOqj1qM7Uon3+wo2g+ZZ3Z6tngfqQoTCPyDcRHqZtGRdNuw==", - "dev": true, - "license": "MIT", - "peer": true, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typespec/compiler": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.14.0.tgz", + "integrity": "sha512-RRN0LGVDlonG/IbB2b4mvRjdCo6LywwB9/J8lOp6UaH7vtaFnKe5FL+rpxhof4rXx/zI/4OWnQO6c01bTCz4/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@inquirer/prompts": "^8.4.1", + "ajv": "^8.18.0", + "change-case": "^5.4.4", + "env-paths": "^4.0.0", + "is-unicode-supported": "^2.1.0", + "mustache": "^4.2.0", + "picocolors": "^1.1.1", + "prettier": "^3.8.1", + "semver": "^7.7.4", + "tar": "^7.5.13", + "temporal-polyfill": "^1.0.1", + "vscode-languageserver": "^10.0.0", + "vscode-languageserver-textdocument": "^1.0.12", + "yaml": "^2.8.3", + "yargs": "^18.0.0" + }, + "bin": { + "tsp": "cmd/tsp.js", + "tsp-server": "cmd/tsp-server.js" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@typespec/events": { + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.84.0.tgz", + "integrity": "sha512-UroDIu6t6Z+cOLyX8I+GJWhSFmYGrp1L93F7ZVt0Ypmj0ndmC9YYa4cpeEyS5PDDIC8u49WfCIwfGegxt4rPVQ==", + "dev": true, + "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0" + } + }, + "node_modules/@typespec/http": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.14.0.tgz", + "integrity": "sha512-W+heCzu8K63AVcoX8MachVWaRxSAMFWOI1yBTc2Kq8QHaJeDiLL5JbU8VfTZ4tL/6EoGSdKfIT5ZNRW7oVCzhg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "^1.14.0", + "@typespec/streams": "^0.84.0" + }, + "peerDependenciesMeta": { + "@typespec/streams": { + "optional": true + } + } + }, + "node_modules/@typespec/openapi": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.14.0.tgz", + "integrity": "sha512-KL7kImPhCXRmxpHVt1k7TWaa4bb3NbSeUx2rxyxeq7lYZFllI6/NYRCTOI/5JOrbElWmmSxrajU9K9IAKI6PkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" + } + }, + "node_modules/@typespec/rest": { + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.84.0.tgz", + "integrity": "sha512-9s5dDfRoHRPdtbVvkBasUx/RnMvwWMTuXRieSQDEji4gWGgxVu4Zt4MiEEKSfQrkMr3Aw0QjRCSxBxjMCHIOmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" + } + }, + "node_modules/@typespec/spec-api": { + "version": "0.1.0-alpha.15", + "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.15.tgz", + "integrity": "sha512-rVPcA3KFJEBYpXq9BJkmtOk0SmF/pHUXv4m1FJNbXX8YW7eo3/NUKwB2Tc3TQVZB9zEIfBmf3BtLWpwvmVMAUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "express": "^5.2.1", + "fast-xml-parser": "^5.7.0" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@typespec/spec-coverage-sdk": { + "version": "0.1.0-alpha.16", + "resolved": "https://registry.npmjs.org/@typespec/spec-coverage-sdk/-/spec-coverage-sdk-0.1.0-alpha.16.tgz", + "integrity": "sha512-qwSnuE+CXjv4mn2uhioTVlaO4GjypR4ZtbkSoLmWA677ggYmoAjIDpyNgT1tjsc1lDKVtSiPvGhM9XFKExVmbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@azure/identity": "~4.13.0", + "@azure/storage-blob": "~12.31.0", + "@types/node": "~25.3.0", + "@types/semver": "^7.5.8", + "semver": "^7.7.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@typespec/spec-coverage-sdk/node_modules/@types/node": { + "version": "25.3.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.5.tgz", + "integrity": "sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/@typespec/spec-coverage-sdk/node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typespec/spector": { + "version": "0.1.0-alpha.26", + "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.26.tgz", + "integrity": "sha512-WtaWIJE+Xh80G11Bi/3zC1GIrK4EVYBSCnkmSvm9bEYcBMH8QuryPDbUeTXYUyozcCrMYXaKnBboHN91IEi8ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@azure/identity": "^4.13.1", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/spec-api": "^0.1.0-alpha.15", + "@typespec/spec-coverage-sdk": "^0.1.0-alpha.16", + "@typespec/versioning": "^0.84.0", + "ajv": "^8.18.0", + "express": "^5.2.1", + "micromatch": "^4.0.8", + "morgan": "^1.10.1", + "multer": "^2.2.0", + "picocolors": "^1.1.1", + "source-map-support": "^0.5.21", + "yaml": "^2.8.3", + "yargs": "^18.0.0" + }, + "bin": { + "tsp-spector": "cmd/cli.mjs" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@typespec/sse": { + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.84.0.tgz", + "integrity": "sha512-9joNgVisRCWDFfV1d79iTAuR1W/6r+AKJrKUfcjsaTrq5A8OWW3v5TTsfxbHAZArn7n2WxQkqhNGgNyc8LjEng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/streams": "^0.84.0" } }, "node_modules/@typespec/streams": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.83.0.tgz", - "integrity": "sha512-wbO6sdH1Uf+UwjxxsWdHQkjJ3wwiYsAKI+L66qnDYVXAFe02sUdMKd0mxH5o9ipGXE52MZ+yvZ52vHAD+g3RFQ==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.84.0.tgz", + "integrity": "sha512-SDneR8+zY+ueOpzg9yJtttfDe/ikB99JgddZSXKPwiDPlAIEeEvI8auipcYfB58EEOB21h8Oq0tEm8HqiAAWdQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/ts-http-runtime": { @@ -1923,43 +2154,40 @@ } }, "node_modules/@typespec/versioning": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.83.0.tgz", - "integrity": "sha512-nE66ta0ixpHB6FQpSzqnj8QnVfgFsxeK/4Xv+DxYx2nB/w18f6VjkF+hW+A/zs1tZIYvBZVbCNa/Rcr8zM6fhg==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.84.0.tgz", + "integrity": "sha512-ZoDasTDj4z0mgFK+0cJL2+7DduCaTjvICHL2nQ/RBWc7nLgObaIYCjvXLno8WneDXnpxCAr7larN4/nlHEv9fg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/xml": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.83.0.tgz", - "integrity": "sha512-2/dtAD8jGPkIdwpQ1G1P+5+qdMPeafQiIKCd8NdAnOo0w9OZ59Io52jINm9HdN8+FcbOrqK8+B2N9rlPRj7PqA==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.84.0.tgz", + "integrity": "sha512-3x0spgIrr4u3azkYaOxrlumtjoqPiUnJ/G5RwGBmUCAeE5F413MHf/AeIkmZ2ULT1gY3myabfZp8bOijTbMk7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@vitest/coverage-v8": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.9.tgz", - "integrity": "sha512-G9/lgqibheLVBDRuya45EbsEXTYcWoSG+TLg7i2axuzx0Eq62eXn+aWXyaVdV5vKvFSWd6ywcX8hA7la9Pvu8g==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.10.tgz", + "integrity": "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@bcoe/v8-coverage": "^1.0.2", - "@vitest/utils": "4.1.9", + "@vitest/utils": "4.1.10", "ast-v8-to-istanbul": "^1.0.0", "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", @@ -1973,8 +2201,8 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/browser": "4.1.9", - "vitest": "4.1.9" + "@vitest/browser": "4.1.10", + "vitest": "4.1.10" }, "peerDependenciesMeta": { "@vitest/browser": { @@ -1983,16 +2211,16 @@ } }, "node_modules/@vitest/expect": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.9.tgz", - "integrity": "sha512-vl/rYsUKcBr3SnQn166+XR5ZQcgMx3DQhFWdfli/cWpLnLUmbxZvyrJZotLFUryib+LtArYMSTJ5RbQ57ZqrlA==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz", + "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==", "dev": true, "license": "MIT", "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/chai": "^5.2.2", - "@vitest/spy": "4.1.9", - "@vitest/utils": "4.1.9", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", "chai": "^6.2.2", "tinyrainbow": "^3.1.0" }, @@ -2001,13 +2229,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.9.tgz", - "integrity": "sha512-EVkXzBjrPGM+cK8/ANWgBrkUCfJfb38/EfTSO8h7pWvKkyPkpWxvR7BkD2MyItMF62C97zAEoqdpUixwR/e+Rw==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz", + "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "4.1.9", + "@vitest/spy": "4.1.10", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, @@ -2028,9 +2256,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.9.tgz", - "integrity": "sha512-s0iufns3iIFitdgm+YR7g1whCAaGtXz459VS9/PqyKDEEFgYIhsHOQmXgIgDuYCt7DeQmiZT0Qe2OA2p4ZPu5A==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", + "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==", "dev": true, "license": "MIT", "dependencies": { @@ -2041,13 +2269,13 @@ } }, "node_modules/@vitest/runner": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.9.tgz", - "integrity": "sha512-KXLMDtc7oe70+3mJfGrPUWPesswH+3sTxAMAMl8DG7I8IUQT4XW718dY5ID3vPUcmlu27CcKfY4P3h3I29SLJg==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz", + "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "4.1.9", + "@vitest/utils": "4.1.10", "pathe": "^2.0.3" }, "funding": { @@ -2055,14 +2283,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.9.tgz", - "integrity": "sha512-Jc7RKGNBo8Z28WYIm0Niej4xdSPByRf6mU58VpHQkd6Zh05rlnA+twjbK5HyeIGHxrzsc3mJgS43uM0CZKzaIA==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz", + "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.1.9", - "@vitest/utils": "4.1.9", + "@vitest/pretty-format": "4.1.10", + "@vitest/utils": "4.1.10", "magic-string": "^0.30.21", "pathe": "^2.0.3" }, @@ -2071,9 +2299,9 @@ } }, "node_modules/@vitest/spy": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.9.tgz", - "integrity": "sha512-fHpsS6mIi+PiEW+vcRVOMkX1oSaPKne3VOclSFICPcGOmfKgXPU5iAah+wcNcj2xPrCCmfq99IDGf+EojhhvhA==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz", + "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==", "dev": true, "license": "MIT", "funding": { @@ -2081,14 +2309,13 @@ } }, "node_modules/@vitest/ui": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.1.9.tgz", - "integrity": "sha512-U/cRvtqfEPj27FI1n9cyUvi4vXXdcLhjJiI+InYKdk8hP4VrS6RXOjGL7rfFaeBc37iRKANsR6eEzIoC7lmgBQ==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.1.10.tgz", + "integrity": "sha512-EOUqfXHTXtpSHsyLHH40ts3Ue+hRhSGwzwzMlK0dTEOLSDYyOXLyr5JDGmHQWhN2DYI30gw6dVx3cdgM9FZl+Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@vitest/utils": "4.1.9", + "@vitest/utils": "4.1.10", "fflate": "^0.8.2", "flatted": "^3.4.2", "pathe": "^2.0.3", @@ -2100,17 +2327,17 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": "4.1.9" + "vitest": "4.1.10" } }, "node_modules/@vitest/utils": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.9.tgz", - "integrity": "sha512-A51o8ymO5PpqlWNnBP9ZHPXDIpuMtTLlGSjN7la4US+LJzoUMyhwjA5QXlm39JexgwHKW4Xjs8Z2d3dLCXOeuA==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz", + "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "4.1.9", + "@vitest/pretty-format": "4.1.10", "convert-source-map": "^2.0.0", "tinyrainbow": "^3.1.0" }, @@ -2248,23 +2475,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -2294,22 +2504,6 @@ "dev": true, "license": "MIT" }, - "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, - "license": "MIT", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", @@ -2365,6 +2559,20 @@ "url": "https://opencollective.com/express" } }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/brace-expansion": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", @@ -2590,25 +2798,6 @@ "node": ">=12" } }, - "node_modules/call-bind": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", - "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "get-intrinsic": "^1.3.0", - "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.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -2750,17 +2939,13 @@ } }, "node_modules/content-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", - "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "node": ">= 0.6" } }, "node_modules/convert-source-map": { @@ -2823,39 +3008,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, - "license": "MIT", - "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/default-browser": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz", @@ -2886,24 +3038,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -2917,24 +3051,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -3050,31 +3166,10 @@ "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, - "license": "MIT", - "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": "2.2.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.2.0.tgz", - "integrity": "sha512-3lGxdTXCLfe1MYfTz1y2ksAAUM4NAOP6rPEjxGJVKO7TZ5+tvHCaQWGpC4Y3IXvW3ece0Cz1cIP4FWBxOnGCTQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.1.tgz", + "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==", "dev": true, "license": "MIT" }, @@ -3192,16 +3287,6 @@ "url": "https://opencollective.com/express" } }, - "node_modules/express/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, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3209,23 +3294,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "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.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, "node_modules/fast-string-truncated-width": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", @@ -3311,16 +3379,6 @@ "fxparser": "src/cli/cli.js" } }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/fflate": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", @@ -3387,22 +3445,6 @@ "dev": true, "license": "ISC" }, - "node_modules/for-each": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", - "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", @@ -3480,16 +3522,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, - "license": "MIT", - "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", @@ -3570,40 +3602,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "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, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-16.1.1.tgz", - "integrity": "sha512-dW7vl+yiAJSp6aCekaVnVJxurRv7DCOLyXqEG3RYMYUg7AuJ2jCqPkZTA8ooqC2vtnkaMcV5WfFBMuEnTu1OQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/merge-streams": "^4.0.0", - "fast-glob": "^3.3.3", - "ignore": "^7.0.5", - "is-path-inside": "^4.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.4.0" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -3623,19 +3621,6 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", - "dev": true, - "license": "MIT", - "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", @@ -3646,19 +3631,6 @@ "node": ">=8" } }, - "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, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -3672,22 +3644,6 @@ "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, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasown": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", @@ -3723,188 +3679,82 @@ }, "engines": { "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "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, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "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, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-lazy": { - "version": "4.0.0", - "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" - } - }, - "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, - "license": "ISC" - }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/is-arguments": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", - "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "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, "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 14" } }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "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, "license": "MIT", "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" + "agent-base": "^7.1.2", + "debug": "4" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 14" } }, - "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==", + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", "dev": true, "license": "MIT", "dependencies": { - "has-bigints": "^1.0.2" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=0.10.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true, "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=8" } }, - "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==", + "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, + "license": "ISC" + }, + "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, "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.10" } }, "node_modules/is-core-module": { @@ -3923,23 +3773,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -3956,16 +3789,6 @@ "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", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "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", @@ -3976,19 +3799,6 @@ "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, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-inside-container": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", @@ -4008,19 +3818,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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", @@ -4031,36 +3828,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "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", @@ -4068,25 +3835,6 @@ "dev": true, "license": "MIT" }, - "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, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-safe-filename": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-safe-filename/-/is-safe-filename-0.1.1.tgz", @@ -4100,70 +3848,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", @@ -4190,36 +3874,6 @@ ], "license": "MIT" }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-wsl": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", @@ -4236,13 +3890,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4789,16 +4436,6 @@ "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==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5022,9 +4659,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.15", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", - "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", "dev": true, "funding": [ { @@ -5036,74 +4673,26 @@ "bin": { "nanoid": "bin/nanoid.cjs" }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/negotiator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "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/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">= 0.6" } }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, "engines": { "node": ">= 0.4" }, @@ -5334,20 +4923,10 @@ "node": ">=4" } }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postcss": { - "version": "8.5.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", - "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "version": "8.5.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz", + "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==", "dev": true, "funding": [ { @@ -5433,27 +5012,6 @@ "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" - } - ], - "license": "MIT" - }, "node_modules/range-parser": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", @@ -5499,27 +5057,6 @@ "node": ">= 6" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.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", @@ -5571,17 +5108,6 @@ "node": "*" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rimraf": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", @@ -5603,13 +5129,13 @@ } }, "node_modules/rolldown": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.3.tgz", - "integrity": "sha512-1F1eEtUBtFvcGm1HQ9TiUIUHPQG7mSAODrhIzjxoUEFuo8OcbrGLiVLkevNgj84TE4lnHvnumwFjhJO5Eu135g==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.137.0", + "@oxc-project/types": "=0.139.0", "@rolldown/pluginutils": "^1.0.0" }, "bin": { @@ -5619,21 +5145,21 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.1.3", - "@rolldown/binding-darwin-arm64": "1.1.3", - "@rolldown/binding-darwin-x64": "1.1.3", - "@rolldown/binding-freebsd-x64": "1.1.3", - "@rolldown/binding-linux-arm-gnueabihf": "1.1.3", - "@rolldown/binding-linux-arm64-gnu": "1.1.3", - "@rolldown/binding-linux-arm64-musl": "1.1.3", - "@rolldown/binding-linux-ppc64-gnu": "1.1.3", - "@rolldown/binding-linux-s390x-gnu": "1.1.3", - "@rolldown/binding-linux-x64-gnu": "1.1.3", - "@rolldown/binding-linux-x64-musl": "1.1.3", - "@rolldown/binding-openharmony-arm64": "1.1.3", - "@rolldown/binding-wasm32-wasi": "1.1.3", - "@rolldown/binding-win32-arm64-msvc": "1.1.3", - "@rolldown/binding-win32-x64-msvc": "1.1.3" + "@rolldown/binding-android-arm64": "1.1.5", + "@rolldown/binding-darwin-arm64": "1.1.5", + "@rolldown/binding-darwin-x64": "1.1.5", + "@rolldown/binding-freebsd-x64": "1.1.5", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", + "@rolldown/binding-linux-arm64-gnu": "1.1.5", + "@rolldown/binding-linux-arm64-musl": "1.1.5", + "@rolldown/binding-linux-ppc64-gnu": "1.1.5", + "@rolldown/binding-linux-s390x-gnu": "1.1.5", + "@rolldown/binding-linux-x64-gnu": "1.1.5", + "@rolldown/binding-linux-x64-musl": "1.1.5", + "@rolldown/binding-openharmony-arm64": "1.1.5", + "@rolldown/binding-wasm32-wasi": "1.1.5", + "@rolldown/binding-win32-arm64-msvc": "1.1.5", + "@rolldown/binding-win32-x64-msvc": "1.1.5" } }, "node_modules/router": { @@ -5666,30 +5192,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -5711,24 +5213,6 @@ ], "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -5736,16 +5220,6 @@ "dev": true, "license": "MIT" }, - "node_modules/sax": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", - "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=11.0.0" - } - }, "node_modules/semver": { "version": "7.8.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", @@ -5805,40 +5279,6 @@ "url": "https://opencollective.com/express" } }, - "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, - "license": "MIT", - "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, - "license": "MIT", - "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", @@ -5980,19 +5420,6 @@ "node": ">=18" } }, - "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, - "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", @@ -6049,26 +5476,12 @@ } }, "node_modules/std-env": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.1.0.tgz", - "integrity": "sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", "dev": true, "license": "MIT" }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -6078,6 +5491,16 @@ "node": ">=10.0.0" } }, + "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, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -6106,16 +5529,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/strip-ansi": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", @@ -6195,21 +5608,29 @@ } }, "node_modules/temporal-polyfill": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.3.2.tgz", - "integrity": "sha512-TzHthD/heRK947GNiSu3Y5gSPpeUDH34+LESnfsq8bqpFhsB79HFBX8+Z834IVX68P3EUyRPZK5bL/1fh437Eg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", + "integrity": "sha512-N2SoI9olnW7BUsU8RosDphZQl9s+WJ8O7PoJMFCr/e5/1rFkVI4GNOWaSeySG+UoP04foPYsnLWbJmbXOiShZg==", "dev": true, "license": "MIT", "dependencies": { - "temporal-spec": "0.3.1" + "temporal-spec": "1.0.0", + "temporal-utils": "1.0.1" } }, "node_modules/temporal-spec": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.3.1.tgz", - "integrity": "sha512-B4TUhezh9knfSIMwt7RVggApDRJZo73uZdj8AacL2mZ8RP5KtLianh2MXxL06GN9ESYiIsiuoLQhgVfwe55Yhw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-1.0.0.tgz", + "integrity": "sha512-00Ahj1e1ifaERTMOIIGpOCdOo9IEk2m6GGSMedsn9a2SIsGLdOTbmME1Htv6IM82b6VHrzSUTIVc7YHy6hdhFQ==", "dev": true, - "license": "ISC" + "license": "Apache-2.0" + }, + "node_modules/temporal-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/temporal-utils/-/temporal-utils-1.0.1.tgz", + "integrity": "sha512-HAixuesxFQIUaQk3ptX2jhfO/FsOkgVkDDMawvp6n/fkB1q6BKfs3lURw9I+pK/2e2e/q/vrLrxmeqauBoyGMQ==", + "dev": true, + "license": "MIT" }, "node_modules/test-exclude": { "version": "8.0.0", @@ -6279,12 +5700,11 @@ } }, "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -6361,6 +5781,20 @@ "url": "https://opencollective.com/express" } }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -6369,17 +5803,38 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dev": true, "license": "Apache-2.0", "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "tsc": "bin/tsc" }, "engines": { - "node": ">=14.17" + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" } }, "node_modules/undici-types": { @@ -6389,19 +5844,6 @@ "dev": true, "license": "MIT" }, - "node_modules/unicorn-magic": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz", - "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -6455,17 +5897,16 @@ } }, "node_modules/vite": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.0.tgz", - "integrity": "sha512-BuJcQK/56NQTWDGn4ABea3q4SSBdNPWwNZKTkkUpcMPnLoquSYH8llRtSUIgoL1KSCpHt5eghLShn50mH36y7Q==", + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", + "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "lightningcss": "^1.32.0", - "picomatch": "^4.0.4", - "postcss": "^8.5.15", - "rolldown": "~1.1.2", + "picomatch": "^4.0.5", + "postcss": "^8.5.16", + "rolldown": "~1.1.4", "tinyglobby": "^0.2.17" }, "bin": { @@ -6534,9 +5975,9 @@ } }, "node_modules/vite/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -6547,20 +5988,19 @@ } }, "node_modules/vitest": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.9.tgz", - "integrity": "sha512-nE3/LEyc0z87uHYLZebqCUOaJr2hdtuPp7BQ4BosVFnfltxgAvMG08NyrSGlPpOUWvR27c5flSmYFTNr78L9GQ==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz", + "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@vitest/expect": "4.1.9", - "@vitest/mocker": "4.1.9", - "@vitest/pretty-format": "4.1.9", - "@vitest/runner": "4.1.9", - "@vitest/snapshot": "4.1.9", - "@vitest/spy": "4.1.9", - "@vitest/utils": "4.1.9", + "@vitest/expect": "4.1.10", + "@vitest/mocker": "4.1.10", + "@vitest/pretty-format": "4.1.10", + "@vitest/runner": "4.1.10", + "@vitest/snapshot": "4.1.10", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", "es-module-lexer": "^2.0.0", "expect-type": "^1.3.0", "magic-string": "^0.30.21", @@ -6588,12 +6028,12 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.1.9", - "@vitest/browser-preview": "4.1.9", - "@vitest/browser-webdriverio": "4.1.9", - "@vitest/coverage-istanbul": "4.1.9", - "@vitest/coverage-v8": "4.1.9", - "@vitest/ui": "4.1.9", + "@vitest/browser-playwright": "4.1.10", + "@vitest/browser-preview": "4.1.10", + "@vitest/browser-webdriverio": "4.1.10", + "@vitest/coverage-istanbul": "4.1.10", + "@vitest/coverage-v8": "4.1.10", + "@vitest/ui": "4.1.10", "happy-dom": "*", "jsdom": "*", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -6638,9 +6078,9 @@ } }, "node_modules/vitest/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -6651,9 +6091,9 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", + "integrity": "sha512-rfuA6T75H6m5EkbhtEPzre9pT0HPcDI2MMy4+nPFIBks5J8JBAUHD4tRYSgaBOijIEC7SRkC1kKyXTLqbmh9jw==", "dev": true, "license": "MIT", "engines": { @@ -6661,27 +6101,27 @@ } }, "node_modules/vscode-languageserver": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", - "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", + "integrity": "sha512-9gEWpXkYGXoqG7pBnE8O8hx/yP7+Aabn4+peQ3KDicQv6qunHSWyLTud3OF0w4S2+HfDD+5HqYKiXQW9HAU6mA==", "dev": true, "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.17.5" + "vscode-languageserver-protocol": "3.18.2" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", + "integrity": "sha512-XRyDbT0Pp3sSNti3JmxVEUMySWCSi1hhM+/KUlCy1hV1zmrqpM1OwO12EAki8blhmLuIMpaJrYbo0OzGVfK2Qg==", "dev": true, "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "9.0.1", + "vscode-languageserver-types": "3.18.0" } }, "node_modules/vscode-languageserver-textdocument": { @@ -6692,9 +6132,9 @@ "license": "MIT" }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha512-8TsGPNMIMiiBdkORgRSvLjuiEIiAFtO+KssmYWxQ+uSVvlf7RjK8YKCOjPzZ+YA04jXEV7+7LvkSmHkhpNS99g==", "dev": true, "license": "MIT" }, @@ -6714,67 +6154,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "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, - "license": "MIT", - "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.22", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.22.tgz", - "integrity": "sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.9", - "call-bound": "^1.0.4", - "for-each": "^0.3.5", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "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", @@ -6849,30 +6228,6 @@ "node": ">=16.0.0" } }, - "node_modules/xml2js": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", - "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "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 8c3586dac2a..cb25275b978 100644 --- a/packages/http-client-java/package.json +++ b/packages/http-client-java/package.json @@ -49,48 +49,48 @@ "generator/http-client-generator/target/classes/PerfAutomation.jfc" ], "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.2 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": ">=0.83.0 <1.0.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/sse": ">=0.83.0 <1.0.0", - "@typespec/streams": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.70.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.70.0 <1.0.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": ">=0.84.0 <1.0.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": ">=0.84.0 <1.0.0", + "@typespec/sse": ">=0.84.0 <1.0.0", + "@typespec/streams": ">=0.84.0 <1.0.0", + "@typespec/versioning": ">=0.84.0 <1.0.0", + "@typespec/xml": ">=0.84.0 <1.0.0" }, "dependencies": { "@autorest/codemodel": "~4.20.1", - "yaml": "^2.8.3" + "yaml": "^2.9.0" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.69.1", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-azure-rulesets": "0.69.2", - "@azure-tools/typespec-client-generator-core": "0.69.2", + "@azure-tools/typespec-autorest": "0.70.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-azure-rulesets": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", "@microsoft/api-extractor": "^7.58.9", "@microsoft/api-extractor-model": "^7.33.8", - "@types/node": "~26.1.0", - "@typespec/compiler": "1.13.0", - "@typespec/events": "0.83.0", - "@typespec/http": "1.13.0", - "@typespec/openapi": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/sse": "0.83.0", - "@typespec/streams": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0", - "@vitest/coverage-v8": "^4.1.9", - "@vitest/ui": "^4.1.9", + "@types/node": "~26.1.1", + "@typespec/compiler": "1.14.0", + "@typespec/events": "0.84.0", + "@typespec/http": "1.14.0", + "@typespec/openapi": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0", + "@vitest/coverage-v8": "^4.1.10", + "@vitest/ui": "^4.1.10", "c8": "~11.0.0", "rimraf": "~6.1.3", - "typescript": "~6.0.3", - "vitest": "^4.1.9" + "typescript": "~7.0.2", + "vitest": "^4.1.10" } } From d373119bb0eb1bbcaf204a922ebdffb135181328 Mon Sep 17 00:00:00 2001 From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> Date: Wed, 15 Jul 2026 10:40:44 -0500 Subject: [PATCH 004/249] feat: generalize back compat (#10988) ## Generalize backward-compatibility handling into base `TypeProvider` Moves the backward-compatibility algorithms out of individual providers into the base `TypeProvider`/`BackCompatHelper` so all providers inherit them automatically. **Generalized into the base:** - Parameter reorder & name restoration - Hidden overloads for new optional non-body parameters - Non-abstract-base type preservation - Public-constructor promotion on abstract bases - ApiCompat baseline awareness **New:** - Fixed-enum removed-member resurrection (int/long), honoring baseline-accepted removals - Fixed-enum member value preservation fixes: https://github.com/microsoft/typespec/issues/10583 regen preview: https://github.com/Azure/azure-sdk-for-net/pull/60584 --- .../src/Providers/ClientProvider.cs | 332 +-------- .../ExtensibleEnumSerializationProvider.cs | 4 + .../MrwSerializationTypeDefinition.cs | 4 + ...ultipartFormDataSerializationDefinition.cs | 3 + .../BackCompatibilityChangeCategory.cs | 3 + .../src/EmitterRpc/Emitter.cs | 1 + .../src/Expressions/VariableExpression.cs | 2 +- .../src/Primitives/CSharpType.cs | 10 - .../src/Primitives/CodeWriterDeclaration.cs | 10 +- .../src/Providers/ApiVersionEnumProvider.cs | 11 +- .../src/Providers/FixedEnumProvider.cs | 112 ++- .../src/Providers/ModelFactoryProvider.cs | 90 +-- .../src/Providers/ModelProvider.cs | 72 +- .../src/Providers/NamedTypeSymbolProvider.cs | 4 + .../src/Providers/TypeProvider.cs | 125 +++- .../src/Shared/MethodSignatureHelper.cs | 8 +- .../src/SourceInput/ApiCompatBaseline.cs | 193 ++++- .../src/Utilities/BackCompatHelper.cs | 539 ++++++++++++++ .../EnumProviders/EnumProviderTests.cs | 272 ++++++- ...ChangedValueHonoredWhenBaselineAccepts.txt | 4 + .../MockInputEnum.cs | 10 + .../MockInputEnum.cs | 11 + .../MockInputEnum.cs | 11 + ...ovedValueNotReaddedWhenBaselineAccepts.txt | 4 + .../MockInputEnum.cs | 0 .../MockInputEnum.cs | 11 + .../MockInputEnum.cs | 11 + .../MockInputEnum.cs | 10 + .../MockInputEnum.cs | 11 + .../KeepCtorType.cs | 9 + .../PromoteCtorType.cs | 9 + .../NonAbstractPreservedType.cs | 6 + ...cTaskOfTOverloadForNewOptionalParameter.cs | 23 + .../AsyncOverloadType.cs | 12 + ...syncTaskOverloadForNewOptionalParameter.cs | 23 + .../AsyncTaskOverloadType.cs | 12 + ...lityAddsOverloadForNewOptionalParameter.cs | 22 + .../NewOptionalParamType.cs | 7 + ...oadWhenDifferentOverloadRemovalAccepted.cs | 22 + ...adWhenDifferentOverloadRemovalAccepted.txt | 1 + .../DifferentOverloadRemovalType.cs | 7 + ...dsStaticOverloadForNewOptionalParameter.cs | 22 + .../StaticOverloadType.cs | 7 + ...AddsVoidOverloadForNewOptionalParameter.cs | 21 + .../VoidOverloadType.cs | 7 + ...patibilityKeepsUnpublishedParameterName.cs | 18 + .../TestClient.cs | 10 + ...patibilityPreservesExtensionThisKeyword.cs | 22 + .../ExtensionOverloadType.cs | 7 + ...ForBackCompatibilityPreservesOutKeyword.cs | 23 + .../OutOverloadType.cs | 11 + ...ForBackCompatibilityPreservesRefKeyword.cs | 22 + .../RefOverloadType.cs | 7 + ...ityRestoredNameDoesNotSplitDeclarations.cs | 19 + .../TestClient.cs | 10 + ...patibilityRestoresPreviousParameterName.cs | 19 + .../TestClient.cs | 10 + ...kipsOverloadForBaselineAcceptedRemoval.txt | 1 + .../SkipOverloadType.cs | 7 + ...atibilitySkipsReorderAcceptedInBaseline.cs | 14 + ...tibilitySkipsReorderAcceptedInBaseline.txt | 1 + .../SkipReorderType.cs | 7 + ...viderInheritsParameterReorderBackCompat.cs | 14 + .../CustomReorderType.cs | 7 + ...oviderReorderPreservesValueTypeDefaults.cs | 14 + .../CustomReorderValueTypeDefaultsType.cs | 13 + .../TestClient.cs | 15 + .../test/Providers/TypeProviderTests.cs | 671 ++++++++++++++++++ .../test/Shared/MethodSignatureHelperTests.cs | 46 ++ .../SourceInput/ApiCompatBaselineTests.cs | 239 +++++++ .../ApiCompatBaselineTests/Baseline.txt | 12 + .../test/TestHelpers/TestTypeProvider.cs | 7 +- .../generator/docs/backward-compatibility.md | 88 ++- 73 files changed, 2899 insertions(+), 523 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/BackCompatHelper.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts.txt create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumNonContiguousValuesPreserved/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedMiddleValueReadded/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts.txt rename packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/{BackCompat_IntEnumValueRemoved => BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts}/MockInputEnum.cs (100%) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueReadded/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LastContractExposesEnumMemberValues/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LongEnumRemovedValueReadded/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_StringEnumRemovedValueNotReadded/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityKeepsModifierOnNonAbstractType/KeepCtorType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityPromotesPrivateProtectedToPublic/PromoteCtorType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildDeclarationModifiersPreservesNonAbstractFromLastContract/NonAbstractPreservedType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter/AsyncOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter/AsyncTaskOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter/NewOptionalParamType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.txt create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted/DifferentOverloadRemovalType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter/StaticOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter/VoidOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName/TestClient.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword/ExtensionOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword/OutOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword/RefOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations/TestClient.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName/TestClient.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval.txt create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval/SkipOverloadType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.txt create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline/SkipReorderType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat/CustomReorderType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults/CustomReorderValueTypeDefaultsType.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/FindPreviousParameterNameLooksUpLastContract/TestClient.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs index 947b717b5ec..b6e2d9cc78a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs @@ -1263,149 +1263,59 @@ protected override ScmMethodProvider[] BuildMethods() protected sealed override IReadOnlyList BuildMethodsForBackCompatibility(IEnumerable originalMethods) { - List materializedMethods = [.. originalMethods]; - if (LastContractView?.Methods == null || LastContractView.Methods.Count == 0) { - return materializedMethods; + return [.. originalMethods]; } - var currentMethodSignatures = BuildCurrentMethodSignatures(materializedMethods); - - ProcessBackCompatForParameterReordering(materializedMethods, currentMethodSignatures); - ProcessBackCompatForNewOptionalParameters(materializedMethods, currentMethodSignatures); + // Snapshot the current signatures before the base reorders any of them in place, so we + // can fix up convenience method bodies that call reordered protocol methods afterwards. + var originalSignatures = new Dictionary(ReferenceEqualityComparer.Instance); + foreach (var method in originalMethods) + { + originalSignatures.TryAdd(method, method.Signature); + } - return materializedMethods; - } + List result = [.. base.BuildMethodsForBackCompatibility(originalMethods)]; - private void ProcessBackCompatForParameterReordering( - IList materializedMethods, - Dictionary currentMethodSignatures) - { + // Determine which existing methods had their parameters reordered by the base and fix up + // convenience method bodies that call the reordered protocol methods. var updatedSignatureToOriginal = new Dictionary(MethodSignature.MethodSignatureComparer); var methodsWithReorderedParams = new List(); - - foreach (var previousMethod in LastContractView!.Methods) + foreach (var (method, originalSignature) in originalSignatures) { - if (!ShouldProcessMethodForBackCompat(previousMethod.Signature, currentMethodSignatures)) + if (method.Signature.Name.Equals(originalSignature.Name) + && !MethodSignatureHelper.HaveSameParametersInSameOrder(method.Signature, originalSignature)) { - continue; - } - - var methodToUpdate = FindMethodWithSameParametersButDifferentOrder( - previousMethod.Signature, - currentMethodSignatures); - - if (methodToUpdate != null && TryReorderCurrentMethodParameters( - methodToUpdate, - previousMethod.Signature, - updatedSignatureToOriginal)) - { - methodsWithReorderedParams.Add(methodToUpdate); - CodeModelGenerator.Instance.Emitter.Debug( - $"Reordered parameters of '{Name}.{methodToUpdate.Signature.Name}' to match last contract.", - BackCompatibilityChangeCategory.MethodParameterReordering); + updatedSignatureToOriginal.TryAdd(method.Signature, originalSignature); + methodsWithReorderedParams.Add(method); } } if (methodsWithReorderedParams.Count > 0) { - UpdateConvenienceMethodsForBackCompat(materializedMethods, methodsWithReorderedParams, updatedSignatureToOriginal); - } - } - - private Dictionary BuildCurrentMethodSignatures(IEnumerable originalMethods) - { - var allMethods = CustomCodeView?.Methods != null - ? originalMethods.Concat(CustomCodeView.Methods) - : originalMethods; - - var result = new Dictionary(MethodSignature.MethodSignatureComparer); - foreach (var method in allMethods) - { - result.TryAdd(method.Signature, method); - } - return result; - } - - private static bool ShouldProcessMethodForBackCompat( - MethodSignature previousSignature, - Dictionary currentMethodSignatures) - { - if (currentMethodSignatures.ContainsKey(previousSignature)) - { - return false; - } - - var modifiers = previousSignature.Modifiers; - return modifiers.HasFlag(MethodSignatureModifiers.Public) || - modifiers.HasFlag(MethodSignatureModifiers.Protected); - } - - private static MethodProvider? FindMethodWithSameParametersButDifferentOrder( - MethodSignature previousSignature, - Dictionary currentMethodSignatures) - { - foreach (var kvp in currentMethodSignatures) - { - var currentSignature = kvp.Key; - if (currentSignature.Name.Equals(previousSignature.Name) - && currentSignature.ReturnType?.AreNamesEqual(previousSignature.ReturnType) == true - && MethodSignatureHelper.ContainsSameParameters(previousSignature, currentSignature)) - { - return kvp.Value; - } - } - - return null; - } - - private bool TryReorderCurrentMethodParameters( - MethodProvider methodToUpdate, - MethodSignature previousSignature, - Dictionary updatedSignatureToOriginal) - { - var currentSignature = methodToUpdate.Signature; - // Early exit: Check if parameters are already in the same order - if (MethodSignatureHelper.HaveSameParametersInSameOrder(currentSignature, previousSignature)) - { - return false; + UpdateConvenienceMethodsForBackCompat(result, methodsWithReorderedParams, updatedSignatureToOriginal); } - var parametersByName = currentSignature.Parameters.ToDictionary(p => p.Name.ToVariableName()); - var reorderedParameters = new List(currentSignature.Parameters.Count); - - foreach (var previousParam in previousSignature.Parameters) + // The base adds hidden overloads for methods that gained new optional non-body parameters. + // Where such an overload preserves a previous signature whose trailing parameter was a + // CancellationToken, suppress AZC0002: making that parameter optional would create an + // ambiguous call with the current method. + foreach (var method in result) { - if (parametersByName.TryGetValue(previousParam.Name, out var matchingParam)) + if (!originalSignatures.ContainsKey(method) && PreviousSignatureEndsWithCancellationToken(method.Signature)) { - reorderedParameters.Add(matchingParam); + method.Update(suppressions: + [ + new SuppressionStatement( + inner: null, + code: Literal("AZC0002"), + justification: "Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method.") + ]); } } - if (reorderedParameters.Count != currentSignature.Parameters.Count) - { - return false; - } - - var updatedSignature = new MethodSignature( - currentSignature.Name, - currentSignature.Description, - currentSignature.Modifiers, - currentSignature.ReturnType, - currentSignature.ReturnDescription, - reorderedParameters, - currentSignature.Attributes, - currentSignature.GenericArguments, - currentSignature.GenericParameterConstraints, - currentSignature.ExplicitInterface, - currentSignature.NonDocumentComment); - updatedSignatureToOriginal.TryAdd(updatedSignature, currentSignature); - - UpdateXmlDocProviderForParamReorder(methodToUpdate.XmlDocs, updatedSignature); - methodToUpdate.Update(signature: updatedSignature, xmlDocProvider: methodToUpdate.XmlDocs); - - return true; + return result; } private ParameterProvider BuildClientEndpointParameter() @@ -1773,104 +1683,6 @@ private static void ReorderMethodInvocationArguments( } } - private static void UpdateXmlDocProviderForParamReorder( - XmlDocProvider xmlDocs, - MethodSignature updatedSignature) - { - var paramDocsByName = xmlDocs.Parameters.ToDictionary(s => s.Parameter.Name); - var reorderedParamDocs = new List(updatedSignature.Parameters.Count); - - foreach (var param in updatedSignature.Parameters) - { - if (paramDocsByName.TryGetValue(param.Name, out var paramDoc)) - { - reorderedParamDocs.Add(paramDoc); - } - } - - if (reorderedParamDocs.Count == xmlDocs.Parameters.Count && - !reorderedParamDocs.SequenceEqual(xmlDocs.Parameters)) - { - xmlDocs.Update(parameters: reorderedParamDocs); - } - } - - private void ProcessBackCompatForNewOptionalParameters( - List methods, - Dictionary currentMethodSignatures) - { - var currentMethodsByName = new Dictionary>(); - foreach (var method in currentMethodSignatures.Values) - { - if (method is ScmMethodProvider { Kind: ScmMethodKind.CreateRequest }) - { - continue; - } - - if (!currentMethodsByName.TryGetValue(method.Signature.Name, out var list)) - { - list = []; - currentMethodsByName[method.Signature.Name] = list; - } - list.Add(method); - } - - foreach (var previousMethod in LastContractView!.Methods) - { - var previousSignature = previousMethod.Signature; - - if (!previousSignature.Modifiers.HasFlag(MethodSignatureModifiers.Public) && - !previousSignature.Modifiers.HasFlag(MethodSignatureModifiers.Protected)) - { - continue; - } - - if (currentMethodSignatures.ContainsKey(previousSignature) || - !currentMethodsByName.TryGetValue(previousSignature.Name, out var candidates)) - { - continue; - } - - ScmMethodProvider? matchedCurrent = null; - foreach (var candidate in candidates) - { - if (candidate is ScmMethodProvider { Kind: ScmMethodKind.Convenience or ScmMethodKind.Protocol } scmCandidate && - HasNewOptionalNonBodyParametersOnly(previousSignature, scmCandidate.Signature)) - { - matchedCurrent = scmCandidate; - break; - } - } - - if (matchedCurrent is null) - { - continue; - } - - var overload = BuildBackCompatOverloadForNewOptionalParameters(previousMethod, matchedCurrent); - if (overload == null || !currentMethodSignatures.TryAdd(overload.Signature, overload)) - { - continue; - } - - if (PreviousSignatureEndsWithCancellationToken(previousSignature)) - { - overload.Update(suppressions: - [ - new SuppressionStatement( - inner: null, - code: Literal("AZC0002"), - justification: "Back-compat overload preserves the previous method signature where CancellationToken was the trailing parameter. Making it optional would introduce an ambiguous call with the new method.") - ]); - } - - methods.Add(overload); - CodeModelGenerator.Instance.Emitter.Debug( - $"Added back-compat overload for '{Name}.{previousSignature.Name}' to handle new optional parameter(s) introduced relative to the last contract.", - BackCompatibilityChangeCategory.SvcMethodNewOptionalParameterOverloadAdded); - } - } - private static bool PreviousSignatureEndsWithCancellationToken(MethodSignature previousSignature) { if (previousSignature.Parameters.Count == 0) @@ -1881,87 +1693,5 @@ private static bool PreviousSignatureEndsWithCancellationToken(MethodSignature p var lastParam = previousSignature.Parameters[previousSignature.Parameters.Count - 1]; return new CSharpType.CSharpTypeIgnoreNullableComparer().Equals(lastParam.Type, new CSharpType(typeof(CancellationToken))); } - - // Returns true when currentSignature contains all parameters of previousSignature in the same - // relative order, every "extra" parameter is optional, and none of the extras are body parameters. - private static bool HasNewOptionalNonBodyParametersOnly( - MethodSignature previousSignature, - MethodSignature currentSignature) - { - if (currentSignature.Parameters.Count <= previousSignature.Parameters.Count) - { - return false; - } - - if (previousSignature.ReturnType is null - ? currentSignature.ReturnType is not null - : !previousSignature.ReturnType.AreNamesEqual(currentSignature.ReturnType)) - { - return false; - } - - // Walk current parameters and ensure previous parameters appear in the same relative order - // (matched by variable name and type), with every "extra" parameter being optional and non-body. - int previousIndex = 0; - for (int currentIndex = 0; currentIndex < currentSignature.Parameters.Count; currentIndex++) - { - var currentParam = currentSignature.Parameters[currentIndex]; - - if (previousIndex < previousSignature.Parameters.Count) - { - var previousParam = previousSignature.Parameters[previousIndex]; - if (currentParam.Name.ToVariableName() == previousParam.Name.ToVariableName() && - currentParam.Type.AreNamesEqual(previousParam.Type)) - { - previousIndex++; - continue; - } - } - - if (currentParam.DefaultValue is null) - { - return false; - } - - if (currentParam.Location == ParameterLocation.Body) - { - return false; - } - } - - return previousIndex == previousSignature.Parameters.Count; - } - - private ScmMethodProvider? BuildBackCompatOverloadForNewOptionalParameters( - MethodProvider previousMethod, - ScmMethodProvider currentMethod) - { - var previousSignature = previousMethod.Signature; - var currentSignature = currentMethod.Signature; - - var previousParamsByName = new Dictionary(); - foreach (var p in previousSignature.Parameters) - { - previousParamsByName.TryAdd(p.Name.ToVariableName(), p); - } - - var arguments = new List(currentSignature.Parameters.Count); - foreach (var currentParam in currentSignature.Parameters) - { - var currentParamVariableName = currentParam.Name.ToVariableName(); - ValueExpression value = previousParamsByName.TryGetValue(currentParamVariableName, out var prevParam) - ? prevParam - : (currentParam.DefaultValue ?? Default); - arguments.Add(PositionalReference(currentParamVariableName, value)); - } - - return new ScmMethodProvider( - signature: MethodSignatureHelper.BuildBackCompatMethodSignature(previousSignature, hideMethod: true), - bodyStatements: Return(This.Invoke(currentSignature.Name, arguments)), - enclosingType: this, - methodKind: currentMethod.Kind, - xmlDocProvider: previousMethod.XmlDocs, - serviceMethod: currentMethod.ServiceMethod); - } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ExtensibleEnumSerializationProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ExtensibleEnumSerializationProvider.cs index f3c5a792c95..a026a17b325 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ExtensibleEnumSerializationProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ExtensibleEnumSerializationProvider.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.IO; using Microsoft.TypeSpec.Generator.Input; using Microsoft.TypeSpec.Generator.Primitives; @@ -34,6 +35,9 @@ protected override string BuildRelativeFilePath() protected override TypeSignatureModifiers BuildDeclarationModifiers() => _enumProvider.DeclarationModifiers; + protected override IReadOnlyList BuildMethodsForBackCompatibility(IEnumerable originalMethods) + => [.. originalMethods]; + protected override MethodProvider[] BuildMethods() { // for string-based extensible enums, we are using `ToString` as its serialization diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs index 8202a2af405..16ac19e14e9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs @@ -117,6 +117,10 @@ public MrwSerializationTypeDefinition(InputModelType inputModel, ModelProvider m protected override string BuildNamespace() => _model.Type.Namespace; protected override TypeSignatureModifiers BuildDeclarationModifiers() => _model.DeclarationModifiers; + + protected override IReadOnlyList BuildMethodsForBackCompatibility(IEnumerable originalMethods) + => [.. originalMethods]; + private ConstructorProvider SerializationConstructor => _serializationConstructor ??= _model.FullConstructor; private PropertyProvider[] AdditionalProperties => _additionalProperties.Value; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs index 88cb97b16e7..3ef2c7c4c62 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs @@ -46,6 +46,9 @@ public MultipartFormDataSerializationDefinition(InputModelType inputModel, Model protected override TypeSignatureModifiers BuildDeclarationModifiers() => _model.DeclarationModifiers; + protected override IReadOnlyList BuildMethodsForBackCompatibility(IEnumerable originalMethods) + => [.. originalMethods]; + protected override string BuildRelativeFilePath() { return Path.Combine("src", "Generated", "Models", $"{Name}.Serialization.Multipart.cs"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/BackCompatibilityChangeCategory.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/BackCompatibilityChangeCategory.cs index 1c322568a7b..38f74bddf37 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/BackCompatibilityChangeCategory.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/BackCompatibilityChangeCategory.cs @@ -45,5 +45,8 @@ public enum BackCompatibilityChangeCategory /// A back-compat change was skipped because the removal was accepted in the ApiCompat baseline. BaselineAcceptedRemovalSkipped, + + /// A fixed enum member was re-added to preserve a member that existed in the last contract but is no longer produced by the current spec. + EnumMemberAddedFromLastContract, } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/Emitter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/Emitter.cs index e170e8a98a3..83d965b4ed0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/Emitter.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/EmitterRpc/Emitter.cs @@ -182,6 +182,7 @@ public void WriteBufferedMessages() BackCompatibilityChangeCategory.ModelFactoryMethodSkipped => "Model Factory Method Back-Compat Skipped", BackCompatibilityChangeCategory.SvcMethodNewOptionalParameterOverloadAdded => "Method Back-Compat Overload Added For New Optional Parameter", BackCompatibilityChangeCategory.BaselineAcceptedRemovalSkipped => "Back-Compat Skipped For ApiCompat Baseline Accepted Removal", + BackCompatibilityChangeCategory.EnumMemberAddedFromLastContract => "Enum Member Added From Last Contract", _ => category.ToString(), }; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/VariableExpression.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/VariableExpression.cs index 409e5dc2b62..219b72470aa 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/VariableExpression.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Expressions/VariableExpression.cs @@ -34,7 +34,7 @@ public void Update(CSharpType? type = null, string? name = null) } if (name != null) { - Declaration = new CodeWriterDeclaration(name); + Declaration.Update(name: name); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CSharpType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CSharpType.cs index 0678df21108..961075449e8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CSharpType.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CSharpType.cs @@ -652,16 +652,6 @@ private bool IsNameMatch(CSharpType other) return FullyQualifiedName == other.FullyQualifiedName; } - // TO-DO: Implement this once SystemObjectType is implemented: https://github.com/Azure/autorest.csharp/issues/4198 - // internal static CSharpType FromSystemType(Type type, string defaultNamespace, SourceInputModel? sourceInputModel, IEnumerable? backingProperties = null) - // { - // var systemObjectType = SystemObjectType.Create(type, defaultNamespace, sourceInputModel, backingProperties); - // return systemObjectType.Type; - // } - - // internal static CSharpType FromSystemType(BuildContext context, Type type, IEnumerable? backingProperties = null) - // => FromSystemType(type, context.DefaultNamespace, context.SourceInputModel, backingProperties); - /// /// This function is used to create a new CSharpType instance with a literal value. /// If the type is a framework type, the CSharpType will be created with the literal value Constant diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CodeWriterDeclaration.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CodeWriterDeclaration.cs index 3894d8f1c57..87035d3114c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CodeWriterDeclaration.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CodeWriterDeclaration.cs @@ -33,7 +33,7 @@ public CodeWriterDeclaration(string name) RequestedName = name; } - public string RequestedName { get; } + public string RequestedName { get; private set; } internal string GetActualName(CodeWriter.CodeScope scope) { @@ -49,5 +49,13 @@ internal void SetActualName(string actualName, CodeWriter.CodeScope scope) { _actualNames[scope] = actualName; } + + internal void Update(string? name = null) + { + if (name != null) + { + RequestedName = name; + } + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ApiVersionEnumProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ApiVersionEnumProvider.cs index 642a8bf85e2..6bceafce8a5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ApiVersionEnumProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ApiVersionEnumProvider.cs @@ -168,15 +168,8 @@ private List BuildApiVersionEnumValuesForBackwardCompatibility(L return currentApiVersions; } - var processedNames = new HashSet(lastContractFields.Select(f => f.Name), StringComparer.OrdinalIgnoreCase); - // Then, add new versions in the wire order - foreach (var currentVersion in currentApiVersions) - { - if (!processedNames.Contains(currentVersion.Name)) - { - allMembers.Add(currentVersion); - } - } + // Then, add new versions in the wire order. + AppendMembersNotInLastContract(currentApiVersions, lastContractFields, allMembers); for (int i = 0; i < allMembers.Count; i++) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs index 524b3bf2627..854ea4a6b6a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.TypeSpec.Generator.EmitterRpc; using Microsoft.TypeSpec.Generator.Expressions; @@ -128,29 +129,49 @@ protected override IReadOnlyList BuildEnumValues() { if (currentLookup.TryGetValue(field.Name, out var existingMember)) { + // By default, preserve the last contract's explicit value for integer enums so + // members keep their exact values. If the baseline accepts a value change for this + // member (EnumValuesMustMatch), honor the current value instead of restoring the old. + ValueExpression? initializationValue = existingMember.Field.InitializationValue; + var memberValue = existingMember.Value; + if (IsIntValueType + && field.InitializationValue is LiteralExpression { Literal: { } lastContractValue } + && CodeModelGenerator.Instance.SourceInputModel?.ApiCompatBaseline.IsMemberSuppressed(Type.FullyQualifiedName, field.Name, 0) != true) + { + initializationValue = field.InitializationValue; + memberValue = lastContractValue; + } + var updatedField = new FieldProvider( existingMember.Field.Modifiers, existingMember.Field.Type, existingMember.Name, existingMember.Field.EnclosingType, - existingMember.Field.Description); - allMembers.Add(new EnumTypeMember(existingMember.Name, updatedField, existingMember.Value)); + existingMember.Field.Description, + initializationValue); + allMembers.Add(new EnumTypeMember(existingMember.Name, updatedField, memberValue)); } - } - - // Then, add new members that weren't in the last contract (in their original input order) - var processedNames = new HashSet(lastContractFields.Select(f => f.Name), StringComparer.OrdinalIgnoreCase); - foreach (var current in currentValues) - { - if (!processedNames.Contains(current.Name)) + else if (CodeModelGenerator.Instance.SourceInputModel?.ApiCompatBaseline.IsMemberSuppressed(Type.FullyQualifiedName, field.Name, 0) == true) { - allMembers.Add(current); + CodeModelGenerator.Instance.Emitter.Debug( + $"Skipping re-add of enum member '{Name}.{field.Name}'; the removal is accepted in the ApiCompat baseline.", + BackCompatibilityChangeCategory.BaselineAcceptedRemovalSkipped); + } + else if (TryResurrectRemovedMember(field, out var resurrectedMember)) + { + allMembers.Add(resurrectedMember); + CodeModelGenerator.Instance.Emitter.Debug( + $"Re-added enum member '{field.Name}' to enum '{Name}' to preserve a member from the last contract.", + BackCompatibilityChangeCategory.EnumMemberAddedFromLastContract); } } - // Report a summary-level change only if the relative order of shared members - // was actually altered to match the last contract. - if (!EnumMemberOrderMatches(currentValues, allMembers)) + // Then, add new members that weren't in the last contract (in their original input order). + AppendMembersNotInLastContract(currentValues, lastContractFields, allMembers); + + // Report a reordering only when the relative order of members present in BOTH the + // current values and the resulting set was actually altered. + if (SharedMemberOrderChanged(currentValues, allMembers)) { CodeModelGenerator.Instance.Emitter.Debug( $"Reordered members of enum '{Name}' to match last contract.", @@ -160,22 +181,71 @@ protected override IReadOnlyList BuildEnumValues() return allMembers; } - private static bool EnumMemberOrderMatches( - IReadOnlyList left, - IReadOnlyList right) + private bool TryResurrectRemovedMember(FieldProvider lastContractField, [NotNullWhen(true)] out EnumTypeMember? member) { - if (left.Count != right.Count) + member = null; + if (!IsIntValueType || lastContractField.InitializationValue is not LiteralExpression { Literal: { } literalValue }) { return false; } - for (int i = 0; i < left.Count; i++) + + var field = new FieldProvider( + FieldModifiers.Public | FieldModifiers.Static, + EnumUnderlyingType, + lastContractField.Name, + this, + lastContractField.Description, + Literal(literalValue)); + member = new EnumTypeMember(lastContractField.Name, field, literalValue); + return true; + } + + // Appends the members of that were not present in the last + // contract (i.e. newly introduced by the current spec), preserving their original input order. + // Shared by the fixed-enum and API-version back-compatibility passes. + private protected static void AppendMembersNotInLastContract( + IReadOnlyList currentValues, + IReadOnlyList lastContractFields, + List allMembers) + { + var lastContractNames = new HashSet(lastContractFields.Select(f => f.Name), StringComparer.OrdinalIgnoreCase); + foreach (var current in currentValues) + { + if (!lastContractNames.Contains(current.Name)) + { + allMembers.Add(current); + } + } + } + + private static bool SharedMemberOrderChanged( + IReadOnlyList currentValues, + IReadOnlyList result) + { + var currentNames = new HashSet(currentValues.Count, StringComparer.Ordinal); + foreach (var member in currentValues) { - if (!string.Equals(left[i].Name, right[i].Name, StringComparison.Ordinal)) + currentNames.Add(member.Name); + } + + var index = 0; + foreach (var member in result) + { + if (!currentNames.Contains(member.Name)) + { + continue; + } + + if (index >= currentValues.Count + || !string.Equals(member.Name, currentValues[index].Name, StringComparison.Ordinal)) { - return false; + return true; } + + index++; } - return true; + + return false; } protected internal override FieldProvider[] BuildFields() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs index c30d3a00bff..ae2495a64ba 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs @@ -12,6 +12,7 @@ using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Snippets; using Microsoft.TypeSpec.Generator.Statements; +using Microsoft.TypeSpec.Generator.Utilities; using static Microsoft.TypeSpec.Generator.Snippets.Snippet; namespace Microsoft.TypeSpec.Generator.Providers @@ -105,7 +106,7 @@ protected internal sealed override IReadOnlyList BuildMethodsFor // change between the previous and current contract is a parameter rename. This // avoids source-breaking changes for callers using named arguments (e.g. when a // property is renamed via @@clientName, spec rename, or naming-rule change). - PreservePreviousParameterNames(factoryMethods); + BackCompatHelper.RestorePreviousParameterNames(this, factoryMethods); HashSet currentMethodSignatures = new List([.. factoryMethods, .. CustomCodeView?.Methods ?? []]) .Select(m => m.Signature) @@ -120,14 +121,8 @@ protected internal sealed override IReadOnlyList BuildMethodsFor // If the removal of this factory method has already been accepted in the ApiCompat // baseline, honor that decision and do not resurrect a compatibility shim for it. - if (CodeModelGenerator.Instance.SourceInputModel?.ApiCompatBaseline.IsMemberSuppressed( - Type.FullyQualifiedName, - previousMethod.Signature.Name, - previousMethod.Signature.Parameters.Count) == true) + if (BackCompatHelper.IsMethodRemovalAcceptedInBaseline(this, previousMethod.Signature)) { - CodeModelGenerator.Instance.Emitter.Info( - $"Skipping back-compat shim for '{Type.FullyQualifiedName}.{previousMethod.Signature.Name}'; removal is accepted in the ApiCompat baseline.", - BackCompatibilityChangeCategory.BaselineAcceptedRemovalSkipped); continue; } @@ -212,85 +207,6 @@ protected internal sealed override IReadOnlyList BuildMethodsFor return [.. factoryMethods]; } - // Preserve original parameter names from the previous contract when a current factory - // method matches a previous one by name + parameter types/order but differs only in - // parameter names. The rename is applied in-place via ParameterProvider.Update which - // also updates the cached variable/argument expressions used by the method body and - // XML docs, so the body and docs serialize with the preserved names automatically. - private void PreservePreviousParameterNames(List currentFactoryMethods) - { - if (LastContractView?.Methods == null) - { - return; - } - - foreach (var previousMethod in LastContractView.Methods) - { - MethodProvider? matchingCurrent = null; - foreach (var current in currentFactoryMethods) - { - // MethodSignatureComparer matches on method name + parameter count + parameter - // types (positional); it does not consider parameter names. So a previous - // method whose only difference from a current method is parameter names will - // still match here. - if (MethodSignature.MethodSignatureComparer.Equals(current.Signature, previousMethod.Signature)) - { - matchingCurrent = current; - break; - } - } - - if (matchingCurrent is null) - { - continue; - } - - var previousParameters = previousMethod.Signature.Parameters; - var currentParameters = matchingCurrent.Signature.Parameters; - if (previousParameters.Count != currentParameters.Count) - { - continue; - } - - for (int i = 0; i < previousParameters.Count; i++) - { - var previousName = previousParameters[i].Name; - var currentParam = currentParameters[i]; - if (string.IsNullOrEmpty(previousName) || currentParam.Name == previousName) - { - continue; - } - - // Skip the rename when applying it would create a name collision with another - // current parameter (e.g. two same-typed parameters in swapped order between - // the previous and current contracts). A positional rename in that case would - // silently swap which parameter feeds which constructor field via name-based - // lookup in GetCtorArgs, producing semantically wrong (and source-breaking) code. - var previousNameToApply = previousName; - bool wouldCollide = false; - for (int j = 0; j < currentParameters.Count; j++) - { - if (j != i && string.Equals(currentParameters[j].Name, previousNameToApply, StringComparison.Ordinal)) - { - wouldCollide = true; - break; - } - } - - if (wouldCollide) - { - continue; - } - - CodeModelGenerator.Instance.Emitter.Debug( - $"Preserved parameter name '{previousName}' on '{Name}.{matchingCurrent.Signature.Name}' from last contract (instead of '{currentParam.Name}').", - BackCompatibilityChangeCategory.ParameterNamePreserved); - - currentParam.Update(name: previousName); - } - } - } - private bool TryBuildCompatibleMethodForPreviousContract( MethodProvider previousMethod, MethodSignature? currentMethodSignature, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs index 9f28c6bc482..53142b6c74c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs @@ -27,7 +27,7 @@ protected override FormattableString BuildDescription() { var description = DocHelpers.GetFormattableDescription(_inputModel.Summary, _inputModel.Doc) ?? $"The {Name}."; - if (IsAbstract) + if (DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract)) { _derivedModels = BuildDerivedModels(); var publicDerivedModels = _derivedModels.Where(m => m.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)).ToList(); @@ -66,7 +66,6 @@ protected override FormattableString BuildDescription() private ConstructorProvider? _fullConstructor; internal PropertyProvider? DiscriminatorProperty { get; private set; } private ValueExpression DiscriminatorLiteral => Literal(_inputModel.DiscriminatorValue ?? ""); - private bool IsAbstract => _inputModel.DiscriminatorProperty is not null && _inputModel.DiscriminatorValue is null && LastContractView?.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract) != false; public ModelProvider(InputModelType inputModel) : base(inputModel) { @@ -325,7 +324,7 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() declarationModifiers |= TypeSignatureModifiers.Internal; } - if (IsAbstract) + if (_inputModel.DiscriminatorProperty is not null && _inputModel.DiscriminatorValue is null) { declarationModifiers |= TypeSignatureModifiers.Abstract; } @@ -777,7 +776,7 @@ protected internal override ConstructorProvider[] BuildConstructors() private bool ComputeIsMultiLevelDiscriminator() { // Only applies to non-abstract models with a base model - if (IsAbstract || _inputModel.BaseModel == null) + if (DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract) || _inputModel.BaseModel == null) { return false; } @@ -848,71 +847,6 @@ private ConstructorProvider BuildFullConstructor() this); } - protected internal override IReadOnlyList BuildConstructorsForBackCompatibility(IEnumerable originalConstructors) - { - // Only handle the case of changing modifiers on abstract base types - if (!DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract)) - { - return [.. originalConstructors]; - } - - if (LastContractView?.Constructors == null || LastContractView.Constructors.Count == 0) - { - return [.. originalConstructors]; - } - - List constructors = [.. originalConstructors]; - - // Check if the last contract had a public constructor with matching parameters - foreach (var previousConstructor in LastContractView.Constructors) - { - if (!previousConstructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Public)) - { - continue; - } - - // Find a matching constructor in the current version by parameter signature - for (int i = 0; i < constructors.Count; i++) - { - var currentConstructor = constructors[i]; - - // Check if parameters match (same count and types) - if (ParametersMatch(currentConstructor.Signature.Parameters, previousConstructor.Signature.Parameters)) - { - // Change the modifier from private protected to public - if (currentConstructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Private) && - currentConstructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Protected)) - { - currentConstructor.Signature.Update(modifiers: MethodSignatureModifiers.Public); - CodeModelGenerator.Instance.Emitter.Debug( - $"Promoted constructor '{Name}({string.Join(", ", currentConstructor.Signature.Parameters.Select(p => p.Type.ToString()))})' from 'private protected' to 'public' to match last contract.", - BackCompatibilityChangeCategory.ConstructorModifierPreserved); - } - } - } - } - - return [.. constructors]; - } - - private bool ParametersMatch(IReadOnlyList params1, IReadOnlyList params2) - { - if (params1.Count != params2.Count) - { - return false; - } - - for (int i = 0; i < params1.Count; i++) - { - if (!params1[i].Type.AreNamesEqual(params2[i].Type) || params1[i].Name != params2[i].Name) - { - return false; - } - } - - return true; - } - private IEnumerable GetAllBasePropertiesForConstructorInitialization(bool includeAllHierarchyDiscriminator = false) { var properties = new Stack>(); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs index ed3a45d54e8..5f0faf734e7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs @@ -373,6 +373,10 @@ private void AddAdditionalModifiers(IMethodSymbol methodSymbol, ref MethodSignat { modifiers |= MethodSignatureModifiers.Static; } + if (methodSymbol.IsExtensionMethod) + { + modifiers |= MethodSignatureModifiers.Extension; + } // Handle conversion operators (explicit and implicit) if (methodSymbol.MethodKind == MethodKind.Conversion) { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs index 3d71670d5a9..83380c4299b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs @@ -215,6 +215,16 @@ private TypeSignatureModifiers BuildDeclarationModifiersInternal() severity: EmitterDiagnosticSeverity.Warning); } + // Back-compat: a type that the last contract published as non-abstract must not become + // abstract, which would be a source-breaking change for existing derived types and + // callers. Preserve the previously-published non-abstract shape. + if (modifiers.HasFlag(TypeSignatureModifiers.Abstract) && + LastContractView is { } lastContractView && + !lastContractView.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract)) + { + modifiers &= ~TypeSignatureModifiers.Abstract; + } + // we always add partial when possible if (!modifiers.HasFlag(TypeSignatureModifiers.Enum) && DeclaringTypeProvider is null) { @@ -813,11 +823,122 @@ private static IReadOnlyList VisitNewMembers( protected internal virtual IReadOnlyList? BuildEnumValuesForBackCompatibility(IReadOnlyList originalEnumValues) => null; + /// + /// Returns this type's methods with backward compatibility applied against + /// . The default implementation restores the previous + /// parameter order on a current method when it matches a last-contract method by name and + /// return type with the same parameter set but in a different order. Reordering is done in + /// place, so a method's body (which references its parameters by object) remains valid. + /// Override and call base to extend this behavior; override without calling + /// base to replace it. + /// protected internal virtual IReadOnlyList BuildMethodsForBackCompatibility(IEnumerable originalMethods) - => [.. originalMethods]; + { + var methods = new List(originalMethods); + + if (LastContractView?.Methods is not { Count: > 0 } previousMethods) + { + return methods; + } + + var currentMethodSignatures = BuildCurrentMethodSignatureMap(methods); + + foreach (var previousMethod in previousMethods) + { + if (!BackCompatHelper.ShouldApplyMethodBackCompatibility(previousMethod.Signature, currentMethodSignatures) + || BackCompatHelper.IsMethodRemovalAcceptedInBaseline(this, previousMethod.Signature)) + { + continue; + } + + var methodToReorder = BackCompatHelper.FindMethodWithSameParametersDifferentOrder(previousMethod.Signature, currentMethodSignatures); + if (methodToReorder != null && BackCompatHelper.TryRestorePreviousParameterOrder(methodToReorder, previousMethod.Signature)) + { + CodeModelGenerator.Instance.Emitter.Debug( + $"Reordered parameters of '{Name}.{methodToReorder.Signature.Name}' to match last contract.", + BackCompatibilityChangeCategory.MethodParameterReordering); + } + } + + BackCompatHelper.RestorePreviousParameterNames(this, methods); + BackCompatHelper.AddOverloadsForNewOptionalParameters(this, methods); + + return methods; + } + + /// + /// Builds a lookup of the type's current method signatures (including custom code methods) + /// used to match against last-contract methods. + /// + private Dictionary BuildCurrentMethodSignatureMap(IEnumerable methods) + { + var allMethods = CustomCodeView?.Methods != null + ? methods.Concat(CustomCodeView.Methods) + : methods; + + var result = new Dictionary(MethodSignature.MethodSignatureComparer); + foreach (var method in allMethods) + { + result.TryAdd(method.Signature, method); + } + return result; + } + /// + /// Returns this type's constructors with backward compatibility applied against + /// . The default implementation preserves a previously-published + /// public constructor on an abstract base type: when the current generation would emit a + /// private protected constructor whose parameters match a public constructor in + /// the last contract, the modifier is promoted back to public. Override and call + /// base to extend this behavior. + /// protected internal virtual IReadOnlyList BuildConstructorsForBackCompatibility(IEnumerable originalConstructors) - => [.. originalConstructors]; + { + // Only handle the case of changing modifiers on abstract base types. + if (!DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract)) + { + return [.. originalConstructors]; + } + + if (LastContractView?.Constructors == null || LastContractView.Constructors.Count == 0) + { + return [.. originalConstructors]; + } + + List constructors = [.. originalConstructors]; + + // Check if the last contract had a public constructor with matching parameters + foreach (var previousConstructor in LastContractView.Constructors) + { + if (!previousConstructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Public)) + { + continue; + } + + // Find a matching constructor in the current version by parameter signature + for (int i = 0; i < constructors.Count; i++) + { + var currentConstructor = constructors[i]; + if (!currentConstructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Private) || + !currentConstructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Protected)) + { + continue; + } + + // Check if parameters match (same count and types) + if (BackCompatHelper.ParametersMatch(currentConstructor.Signature.Parameters, previousConstructor.Signature.Parameters)) + { + // Change the modifier from private protected to public + currentConstructor.Signature.Update(modifiers: MethodSignatureModifiers.Public); + CodeModelGenerator.Instance.Emitter.Debug( + $"Promoted constructor '{Name}({string.Join(", ", currentConstructor.Signature.Parameters.Select(p => p.Type.ToString()))})' from 'private protected' to 'public' to match last contract.", + BackCompatibilityChangeCategory.ConstructorModifierPreserved); + } + } + } + + return [.. constructors]; + } private IReadOnlyList? _enumValues; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Shared/MethodSignatureHelper.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Shared/MethodSignatureHelper.cs index e2f1d312100..724f345569c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Shared/MethodSignatureHelper.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Shared/MethodSignatureHelper.cs @@ -53,7 +53,7 @@ internal static bool HaveSameParametersInSameOrder(MethodSignature method1, Meth return true; } - internal static MethodSignature BuildBackCompatMethodSignature(MethodSignature previousMethodSignature, bool hideMethod) + internal static MethodSignature BuildBackCompatMethodSignature(MethodSignature previousMethodSignature, bool hideMethod, bool shouldNotBeAsync = false) { if (hideMethod) { @@ -64,13 +64,17 @@ internal static MethodSignature BuildBackCompatMethodSignature(MethodSignature p } } + var modifiers = shouldNotBeAsync + ? previousMethodSignature.Modifiers & ~MethodSignatureModifiers.Async + : previousMethodSignature.Modifiers; + var attributes = hideMethod ? [.. previousMethodSignature.Attributes, new AttributeStatement(typeof(EditorBrowsableAttribute), Snippet.FrameworkEnumValue(EditorBrowsableState.Never))] : previousMethodSignature.Attributes; return new MethodSignature( previousMethodSignature.Name, previousMethodSignature.Description, - previousMethodSignature.Modifiers, + modifiers, previousMethodSignature.ReturnType, previousMethodSignature.ReturnDescription, previousMethodSignature.Parameters, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/ApiCompatBaseline.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/ApiCompatBaseline.cs index 287c0ead838..86e1fb24fa2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/ApiCompatBaseline.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/ApiCompatBaseline.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text; using Microsoft.TypeSpec.Generator.Primitives; namespace Microsoft.TypeSpec.Generator.SourceInput @@ -26,21 +27,24 @@ public sealed class ApiCompatBaseline { private const string TypesMustExist = "TypesMustExist"; private const string MembersMustExist = "MembersMustExist"; + private const string EnumValuesMustMatch = "EnumValuesMustMatch"; private readonly HashSet _suppressedTypes; private readonly HashSet _suppressedMembers; + private readonly HashSet _suppressedMethods; - private ApiCompatBaseline(HashSet suppressedTypes, HashSet suppressedMembers) + private ApiCompatBaseline(HashSet suppressedTypes, HashSet suppressedMembers, HashSet suppressedMethods) { _suppressedTypes = suppressedTypes; _suppressedMembers = suppressedMembers; + _suppressedMethods = suppressedMethods; } /// /// An empty baseline that suppresses nothing. Used when no baseline file is present. /// public static ApiCompatBaseline Empty { get; } = - new(new HashSet(StringComparer.Ordinal), new HashSet()); + new(new HashSet(StringComparer.Ordinal), new HashSet(), new HashSet()); /// /// Gets a value indicating whether this baseline contains any suppressions. @@ -68,6 +72,7 @@ public static ApiCompatBaseline Parse(IEnumerable lines) { var suppressedTypes = new HashSet(StringComparer.Ordinal); var suppressedMembers = new HashSet(); + var suppressedMethods = new HashSet(); foreach (var rawLine in lines) { @@ -98,9 +103,20 @@ public static ApiCompatBaseline Parse(IEnumerable lines) suppressedTypes.Add(quoted); break; case MembersMustExist: - if (TryParseMember(quoted, out var memberKey)) + if (TryParseMember(quoted, out var memberKey, out var methodKey)) { suppressedMembers.Add(memberKey); + suppressedMethods.Add(methodKey); + } + else if (TryParseField(quoted, out memberKey)) + { + suppressedMembers.Add(memberKey); + } + break; + case EnumValuesMustMatch: + if (TryParseField(quoted, out var enumMemberKey)) + { + suppressedMembers.Add(enumMemberKey); } break; // Other rule ids (e.g. CannotRemoveAttribute) do not describe a removed @@ -110,7 +126,7 @@ public static ApiCompatBaseline Parse(IEnumerable lines) } } - return new ApiCompatBaseline(suppressedTypes, suppressedMembers); + return new ApiCompatBaseline(suppressedTypes, suppressedMembers, suppressedMethods); } /// @@ -142,6 +158,30 @@ public bool IsMemberSuppressed(string declaringTypeFullName, string memberName, return _suppressedMembers.Contains(new MemberKey(declaringTypeFullName, memberName, parameterCount)); } + /// + /// Determines whether the removal of a specific method overload has been accepted in the + /// baseline. Unlike , matching considers the + /// exact parameter types (not just their count), so accepting the removal of one overload — for + /// example Foo(string) — does not incorrectly suppress a different overload such as + /// Foo(int). The removal of the declaring type itself (a TypesMustExist + /// suppression) still implies all of its methods are suppressed. + /// + public bool IsMethodRemovalSuppressed(string declaringTypeFullName, string memberName, IReadOnlyList parameterTypes) + { + if (string.IsNullOrEmpty(declaringTypeFullName) || string.IsNullOrEmpty(memberName)) + { + return false; + } + + if (_suppressedTypes.Contains(declaringTypeFullName)) + { + return true; + } + + return _suppressedMethods.Contains( + new MethodKey(declaringTypeFullName, memberName, BuildParameterSignature(parameterTypes))); + } + /// /// Determines whether the given type, or any of its generic argument types, refers to a type /// whose removal has been accepted in the baseline (a TypesMustExist suppression). This @@ -197,9 +237,12 @@ private static bool TryExtractQuoted(string message, out string value) // public Ns.Result Ns.Factory.Make(Ns.Kind, System.String) // public void Ns.Record..ctor(Ns.Kind, System.String) // public Ns.Kind Ns.Record.Prop.get() - private static bool TryParseMember(string signature, out MemberKey memberKey) + // Also produces a that captures the exact parameter-type signature so + // overloads differing only by parameter types can be told apart. + private static bool TryParseMember(string signature, out MemberKey memberKey, out MethodKey methodKey) { memberKey = default; + methodKey = default; var parenIndex = signature.IndexOf('('); if (parenIndex < 0 || !signature.EndsWith(")", StringComparison.Ordinal)) @@ -251,8 +294,42 @@ private static bool TryParseMember(string signature, out MemberKey memberKey) } } - var parameterCount = CountParameters(signature.Substring(parenIndex + 1, signature.Length - parenIndex - 2)); - memberKey = new MemberKey(declaringTypeFullName, memberName, parameterCount); + var parameterList = signature.Substring(parenIndex + 1, signature.Length - parenIndex - 2); + memberKey = new MemberKey(declaringTypeFullName, memberName, CountParameters(parameterList)); + methodKey = new MethodKey(declaringTypeFullName, memberName, NormalizeParameterList(parameterList)); + return true; + } + + // Parses an ApiCompat field/enum-value signature (which has no parameter list) of the form: + // [modifiers] FieldType Namespace.DeclaringType.MemberName + // for example: + // Ns.CapacityLevel Ns.CapacityLevel.FiftyThousand + // public Ns.Kind Ns.Foo.Kind + // Enum members are recorded with a parameter count of zero. + private static bool TryParseField(string signature, out MemberKey memberKey) + { + memberKey = default; + + // Field/enum-value signatures never contain a parameter list. + if (signature.Contains('(')) + { + return false; + } + + // The fully-qualified member path is the last whitespace-delimited token (the tokens + // before it are access modifiers and the field/enum type). + var lastSpace = signature.LastIndexOf(' '); + var memberPath = lastSpace >= 0 ? signature.Substring(lastSpace + 1) : signature; + + var lastDot = memberPath.LastIndexOf('.'); + if (lastDot <= 0 || lastDot == memberPath.Length - 1) + { + return false; + } + + var declaringTypeFullName = memberPath.Substring(0, lastDot); + var memberName = memberPath.Substring(lastDot + 1); + memberKey = new MemberKey(declaringTypeFullName, memberName, 0); return true; } @@ -289,6 +366,84 @@ private static int CountParameters(string parameterList) return count; } + // Produces a canonical, whitespace-free representation of a baseline parameter list + // (e.g. "System.Collections.Generic.IDictionary,System.String") so + // it can be compared against a signature built from parameter types. + private static string NormalizeParameterList(string parameterList) + { + var trimmed = parameterList.Trim(); + if (trimmed.Length == 0) + { + return string.Empty; + } + + var builder = new StringBuilder(trimmed.Length); + foreach (var c in trimmed) + { + if (!char.IsWhiteSpace(c)) + { + builder.Append(c); + } + } + + return builder.ToString(); + } + + // Builds the same canonical parameter-type signature from a list of + // (using each type's fully-qualified name and recursively-rendered generic arguments) that + // produces from a baseline signature. + private static string BuildParameterSignature(IReadOnlyList parameterTypes) + { + if (parameterTypes.Count == 0) + { + return string.Empty; + } + + var builder = new StringBuilder(); + for (int i = 0; i < parameterTypes.Count; i++) + { + if (i > 0) + { + builder.Append(','); + } + + AppendTypeName(builder, parameterTypes[i]); + } + + return builder.ToString(); + } + + private static void AppendTypeName(StringBuilder builder, CSharpType type) + { + // Nullable value types are rendered by ApiCompat as System.Nullable. + if (type.IsNullable && type.IsValueType) + { + builder.Append("System.Nullable<"); + AppendTypeName(builder, type.WithNullable(false)); + builder.Append('>'); + return; + } + + builder.Append(type.FullyQualifiedName); + + var arguments = type.Arguments; + if (arguments.Count > 0) + { + builder.Append('<'); + for (int i = 0; i < arguments.Count; i++) + { + if (i > 0) + { + builder.Append(','); + } + + AppendTypeName(builder, arguments[i]); + } + + builder.Append('>'); + } + } + private readonly struct MemberKey : IEquatable { private readonly string _declaringTypeFullName; @@ -312,5 +467,29 @@ public bool Equals(MemberKey other) public override int GetHashCode() => HashCode.Combine(_declaringTypeFullName, _memberName, _parameterCount); } + + private readonly struct MethodKey : IEquatable + { + private readonly string _declaringTypeFullName; + private readonly string _memberName; + private readonly string _parameterSignature; + + public MethodKey(string declaringTypeFullName, string memberName, string parameterSignature) + { + _declaringTypeFullName = declaringTypeFullName; + _memberName = memberName; + _parameterSignature = parameterSignature; + } + + public bool Equals(MethodKey other) + => string.Equals(_declaringTypeFullName, other._declaringTypeFullName, StringComparison.Ordinal) + && string.Equals(_memberName, other._memberName, StringComparison.Ordinal) + && string.Equals(_parameterSignature, other._parameterSignature, StringComparison.Ordinal); + + public override bool Equals(object? obj) => obj is MethodKey other && Equals(other); + + public override int GetHashCode() + => HashCode.Combine(_declaringTypeFullName, _memberName, _parameterSignature); + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/BackCompatHelper.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/BackCompatHelper.cs new file mode 100644 index 00000000000..33ad107cb95 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/BackCompatHelper.cs @@ -0,0 +1,539 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.TypeSpec.Generator.EmitterRpc; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Input.Extensions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Statements; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; + +namespace Microsoft.TypeSpec.Generator.Utilities +{ + /// + /// Shared helpers for applying backward compatibility to generated methods by comparing the + /// current generation against a type's last contract. + /// + internal static class BackCompatHelper + { + /// + /// Returns true when a last-contract method should be considered for back compatibility: + /// it is public or protected and has no exact match among the current signatures. + /// + public static bool ShouldApplyMethodBackCompatibility( + MethodSignature previousSignature, + Dictionary currentMethodSignatures) + { + if (currentMethodSignatures.ContainsKey(previousSignature)) + { + return false; + } + + var modifiers = previousSignature.Modifiers; + return modifiers.HasFlag(MethodSignatureModifiers.Public) || + modifiers.HasFlag(MethodSignatureModifiers.Protected); + } + + /// + /// Returns true when the removal of a previously-published method — identified by the enclosing + /// type's fully-qualified name, the method name, and the exact parameter types — has been + /// accepted in the ApiCompat baseline, in which case back compatibility must not resurrect or + /// restore it. Emits an informational log entry when a suppression is honored. + /// + public static bool IsMethodRemovalAcceptedInBaseline(TypeProvider enclosingType, MethodSignature previousSignature) + { + var parameterTypes = new CSharpType[previousSignature.Parameters.Count]; + for (int i = 0; i < parameterTypes.Length; i++) + { + parameterTypes[i] = previousSignature.Parameters[i].Type; + } + + if (CodeModelGenerator.Instance.SourceInputModel?.ApiCompatBaseline.IsMethodRemovalSuppressed( + enclosingType.Type.FullyQualifiedName, + previousSignature.Name, + parameterTypes) != true) + { + return false; + } + + CodeModelGenerator.Instance.Emitter.Info( + $"Skipping back-compat for '{enclosingType.Type.FullyQualifiedName}.{previousSignature.Name}'; removal is accepted in the ApiCompat baseline.", + BackCompatibilityChangeCategory.BaselineAcceptedRemovalSkipped); + return true; + } + + /// + /// Finds the current method that has the same parameter set as + /// (matched by name and return type) but in a different order, or null when there is none. + /// + public static MethodProvider? FindMethodWithSameParametersDifferentOrder( + MethodSignature previousSignature, + Dictionary currentMethodSignatures) + { + foreach (var kvp in currentMethodSignatures) + { + var currentSignature = kvp.Key; + if (currentSignature.Name.Equals(previousSignature.Name) + && currentSignature.ReturnType?.AreNamesEqual(previousSignature.ReturnType) == true + && MethodSignatureHelper.ContainsSameParameters(previousSignature, currentSignature)) + { + return kvp.Value; + } + } + + return null; + } + + /// + /// Returns true when two parameter lists match positionally by type name and parameter name + /// (and have the same count). Used to align a current member with its last-contract counterpart. + /// + public static bool ParametersMatch(IReadOnlyList params1, IReadOnlyList params2) + { + if (params1.Count != params2.Count) + { + return false; + } + + for (int i = 0; i < params1.Count; i++) + { + if (!params1[i].Type.AreNamesEqual(params2[i].Type) || params1[i].Name != params2[i].Name) + { + return false; + } + } + + return true; + } + + /// + /// Returns the previously-published name of a parameter whose original (spec) name is + /// , looked up in . When + /// is supplied, the search is scoped to last-contract methods + /// whose name matches it (allowing for a sync/async pair) so a parameter name shared across + /// methods cannot cross-match. Returns null when no match exists. + /// + public static string? FindPreviousParameterName( + TypeProvider? lastContractView, + string originalName, + string? methodName = null) + { + var lastContractMethods = lastContractView?.Methods; + if (lastContractMethods is null || lastContractMethods.Count == 0) + { + return null; + } + + IEnumerable scopedMethods = lastContractMethods; + if (methodName != null) + { + scopedMethods = lastContractMethods.Where(m => + string.Equals(m.Signature.Name, methodName, StringComparison.OrdinalIgnoreCase) || + string.Equals(m.Signature.Name, methodName + "Async", StringComparison.OrdinalIgnoreCase)); + } + + return scopedMethods + .SelectMany(method => method.Signature.Parameters) + .FirstOrDefault(p => string.Equals(p.Name, originalName, StringComparison.OrdinalIgnoreCase)) + ?.Name; + } + + public static void RestorePreviousParameterNames( + TypeProvider enclosingType, + IReadOnlyList currentMethods) + { + var lastContractView = enclosingType.LastContractView; + if (lastContractView?.Methods is not { Count: > 0 } previousMethods) + { + return; + } + + foreach (var method in currentMethods) + { + var modifiers = method.Signature.Modifiers; + if (!modifiers.HasFlag(MethodSignatureModifiers.Public) && !modifiers.HasFlag(MethodSignatureModifiers.Protected)) + { + continue; + } + + var currentParameters = method.Signature.Parameters; + MethodProvider? matchingPrevious = null; + bool matchingPreviousResolved = false; + + for (int i = 0; i < currentParameters.Count; i++) + { + var parameter = currentParameters[i]; + string? preservedName; + + var inputParameter = parameter.InputParameter; + if (inputParameter is not null) + { + if (!string.Equals(parameter.Name, inputParameter.Name, StringComparison.Ordinal)) + { + continue; + } + + var originalName = inputParameter.OriginalName; + if (string.IsNullOrEmpty(originalName)) + { + continue; + } + + preservedName = FindPreviousParameterName(lastContractView, originalName, method.Signature.Name); + } + else + { + // Positional fallback for synthesized parameters (e.g. model factory methods). + if (!matchingPreviousResolved) + { + matchingPrevious = FindMethodWithSameSignatureIgnoringNames(previousMethods, method.Signature); + matchingPreviousResolved = true; + } + + var previousParameters = matchingPrevious?.Signature.Parameters; + preservedName = previousParameters is not null && previousParameters.Count == currentParameters.Count + ? previousParameters[i].Name + : null; + } + + // A casing-only difference is still a source-breaking rename for named arguments, + // so compare case-sensitively and restore the previously-published spelling. + if (string.IsNullOrEmpty(preservedName) || string.Equals(parameter.Name, preservedName, StringComparison.Ordinal)) + { + continue; + } + + // Skip the rename when applying it would collide with another current parameter's + // name (e.g. two same-typed parameters whose order changed between the previous and + // current contracts). A rename in that case would produce a duplicate parameter name + // and, for name-based argument lookups, silently wire the wrong value. + bool wouldCollide = false; + for (int j = 0; j < currentParameters.Count; j++) + { + if (j != i && string.Equals(currentParameters[j].Name, preservedName, StringComparison.Ordinal)) + { + wouldCollide = true; + break; + } + } + + if (wouldCollide) + { + continue; + } + + CodeModelGenerator.Instance.Emitter.Debug( + $"Preserved parameter name '{preservedName}' on '{enclosingType.Name}.{method.Signature.Name}' from last contract (instead of '{parameter.Name}').", + BackCompatibilityChangeCategory.ParameterNamePreserved); + parameter.Update(name: preservedName); + } + } + } + + /// + /// Finds the last-contract method whose signature matches on + /// method name plus parameter count and types (ignoring parameter names), or null when none. + /// + private static MethodProvider? FindMethodWithSameSignatureIgnoringNames( + IReadOnlyList previousMethods, + MethodSignature currentSignature) + { + foreach (var previousMethod in previousMethods) + { + if (MethodSignature.MethodSignatureComparer.Equals(currentSignature, previousMethod.Signature)) + { + return previousMethod; + } + } + + return null; + } + + /// + /// Restores the previous parameter order on in place + /// (updating XML docs). Returns true when a change was made. + /// + public static bool TryRestorePreviousParameterOrder( + MethodProvider methodToReorder, + MethodSignature previousSignature) + { + var currentSignature = methodToReorder.Signature; + if (MethodSignatureHelper.HaveSameParametersInSameOrder(currentSignature, previousSignature)) + { + return false; + } + + var parametersByName = currentSignature.Parameters.ToDictionary(p => p.Name.ToVariableName()); + var reorderedParameters = new List(currentSignature.Parameters.Count); + + foreach (var previousParam in previousSignature.Parameters) + { + if (parametersByName.TryGetValue(previousParam.Name.ToVariableName(), out var matchingParam)) + { + reorderedParameters.Add(matchingParam); + } + } + + if (reorderedParameters.Count != currentSignature.Parameters.Count) + { + return false; + } + + foreach (var previousParam in previousSignature.Parameters) + { + if (parametersByName.TryGetValue(previousParam.Name.ToVariableName(), out var matchingParam) + && matchingParam.DefaultValue is not null + && previousParam.DefaultValue is not null) + { + matchingParam.Update(defaultValue: previousParam.DefaultValue); + } + } + + var updatedSignature = new MethodSignature( + currentSignature.Name, + currentSignature.Description, + currentSignature.Modifiers, + currentSignature.ReturnType, + currentSignature.ReturnDescription, + reorderedParameters, + currentSignature.Attributes, + currentSignature.GenericArguments, + currentSignature.GenericParameterConstraints, + currentSignature.ExplicitInterface, + currentSignature.NonDocumentComment); + + UpdateXmlDocProviderForParamReorder(methodToReorder.XmlDocs, updatedSignature); + methodToReorder.Update(signature: updatedSignature, xmlDocProvider: methodToReorder.XmlDocs); + + return true; + } + + private static void UpdateXmlDocProviderForParamReorder( + XmlDocProvider xmlDocs, + MethodSignature updatedSignature) + { + var paramDocsByName = xmlDocs.Parameters.ToDictionary(s => s.Parameter.Name); + var reorderedParamDocs = new List(updatedSignature.Parameters.Count); + + foreach (var param in updatedSignature.Parameters) + { + if (paramDocsByName.TryGetValue(param.Name, out var paramDoc)) + { + reorderedParamDocs.Add(paramDoc); + } + } + + if (reorderedParamDocs.Count == xmlDocs.Parameters.Count && + !reorderedParamDocs.SequenceEqual(xmlDocs.Parameters)) + { + xmlDocs.Update(parameters: reorderedParamDocs); + } + } + + /// + /// Adds hidden back-compat overloads for public/protected methods that gained one or more new + /// optional non-body parameters relative to the last contract. Each added overload matches a + /// previously-published signature and delegates to the current method, forwarding the previous + /// arguments and passing default for every new parameter. Renaming a method's parameter + /// set this way is otherwise a source-breaking change for existing callers. + /// + public static void AddOverloadsForNewOptionalParameters(TypeProvider enclosingType, List methods) + { + if (enclosingType.LastContractView?.Methods is not { Count: > 0 } previousMethods) + { + return; + } + + var currentMethods = enclosingType.CustomCodeView?.Methods is { } customMethods + ? methods.Concat(customMethods) + : methods; + if (!currentMethods.Any()) + { + return; + } + + var currentMethodsByName = new Dictionary>(); + foreach (var method in currentMethods) + { + if (!currentMethodsByName.TryGetValue(method.Signature.Name, out var bucket)) + { + bucket = []; + currentMethodsByName[method.Signature.Name] = bucket; + } + bucket.Add(method); + } + + foreach (var previousMethod in previousMethods) + { + var previousSignature = previousMethod.Signature; + if ((!previousSignature.Modifiers.HasFlag(MethodSignatureModifiers.Public) && + !previousSignature.Modifiers.HasFlag(MethodSignatureModifiers.Protected)) || + !currentMethodsByName.TryGetValue(previousSignature.Name, out var candidates)) + { + continue; + } + + // One pass over the same-named methods: bail if the previous signature still exists, + // otherwise remember the first public/protected method that merely gained optional + // non-body parameters. + MethodProvider? matchedCurrent = null; + bool previousStillExists = false; + foreach (var candidate in candidates) + { + if (MethodSignature.MethodSignatureComparer.Equals(candidate.Signature, previousSignature)) + { + previousStillExists = true; + break; + } + + var modifiers = candidate.Signature.Modifiers; + if (matchedCurrent is null && + (modifiers.HasFlag(MethodSignatureModifiers.Public) || modifiers.HasFlag(MethodSignatureModifiers.Protected)) && + HasNewOptionalNonBodyParametersOnly(previousSignature, candidate.Signature)) + { + matchedCurrent = candidate; + } + } + + if (previousStillExists || matchedCurrent is null || IsMethodRemovalAcceptedInBaseline(enclosingType, previousSignature)) + { + continue; + } + + var overload = BuildNewOptionalParameterOverload(enclosingType, previousMethod, matchedCurrent); + candidates.Add(overload); + methods.Add(overload); + CodeModelGenerator.Instance.Emitter.Debug( + $"Added back-compat overload for '{enclosingType.Name}.{previousSignature.Name}' to handle new optional parameter(s) introduced relative to the last contract.", + BackCompatibilityChangeCategory.SvcMethodNewOptionalParameterOverloadAdded); + } + } + + /// + /// Returns true when contains all parameters of + /// in the same relative order (matched by variable name and + /// type) with the same return type, every "extra" current parameter is optional, and none of the + /// extras are body parameters. + /// + public static bool HasNewOptionalNonBodyParametersOnly( + MethodSignature previousSignature, + MethodSignature currentSignature) + { + if (currentSignature.Parameters.Count <= previousSignature.Parameters.Count) + { + return false; + } + + if (previousSignature.ReturnType is null + ? currentSignature.ReturnType is not null + : !previousSignature.ReturnType.AreNamesEqual(currentSignature.ReturnType)) + { + return false; + } + + // Walk current parameters and ensure previous parameters appear in the same relative order + // (matched by variable name and type), with every "extra" parameter being optional and non-body. + int previousIndex = 0; + for (int currentIndex = 0; currentIndex < currentSignature.Parameters.Count; currentIndex++) + { + var currentParam = currentSignature.Parameters[currentIndex]; + + if (previousIndex < previousSignature.Parameters.Count) + { + var previousParam = previousSignature.Parameters[previousIndex]; + if (currentParam.Name.ToVariableName() == previousParam.Name.ToVariableName() && + currentParam.Type.AreNamesEqual(previousParam.Type)) + { + previousIndex++; + continue; + } + } + + if (currentParam.DefaultValue is null) + { + return false; + } + + if (currentParam.Location is ParameterLocation.Body or ParameterLocation.Unknown) + { + return false; + } + } + + return previousIndex == previousSignature.Parameters.Count; + } + + private static MethodProvider BuildNewOptionalParameterOverload( + TypeProvider enclosingType, + MethodProvider previousMethod, + MethodProvider currentMethod) + { + var previousSignature = previousMethod.Signature; + var currentSignature = currentMethod.Signature; + + var previousParametersByName = new Dictionary(); + foreach (var parameter in previousSignature.Parameters) + { + previousParametersByName.TryAdd(parameter.Name.ToVariableName(), parameter); + } + + // Build the delegating call: forward each previous parameter and pass default for the new ones. + // Named argument syntax cannot be combined with 'ref'/'out', so when any parameter is passed by + // reference every argument is forwarded positionally instead (the arguments are already built in + // the current method's parameter order). + bool hasByRefParameter = false; + foreach (var currentParam in currentSignature.Parameters) + { + if (currentParam.IsRef || currentParam.IsOut) + { + hasByRefParameter = true; + break; + } + } + + var arguments = new List(currentSignature.Parameters.Count); + foreach (var currentParam in currentSignature.Parameters) + { + var variableName = currentParam.Name.ToVariableName(); + ValueExpression value = previousParametersByName.TryGetValue(variableName, out var previousParam) + ? previousParam + : currentParam.DefaultValue ?? Default; + + if (hasByRefParameter) + { + arguments.Add(currentParam.IsRef || currentParam.IsOut + ? value.AsArgument(isRef: currentParam.IsRef, isOut: currentParam.IsOut) + : value); + } + else + { + arguments.Add(PositionalReference(variableName, value)); + } + } + + var invocationTarget = currentSignature.Modifiers.HasFlag(MethodSignatureModifiers.Static) + ? Static(enclosingType.Type) + : This; + var delegatingCall = invocationTarget.Invoke(currentSignature.Name, arguments); + MethodBodyStatement body = IsVoidReturnType(currentSignature.ReturnType) + ? delegatingCall.Terminate() + : Return(delegatingCall); + + // The shim delegates without awaiting, so it must not be declared 'async'. + var signature = MethodSignatureHelper.BuildBackCompatMethodSignature(previousSignature, hideMethod: true, shouldNotBeAsync: true); + + return new MethodProvider( + signature, + body, + enclosingType, + previousMethod.XmlDocs); + } + + private static bool IsVoidReturnType(CSharpType? returnType) => + returnType is null || (returnType.IsFrameworkType && returnType.FrameworkType == typeof(void)); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs index 3bbc8cb463e..fe18ff059a3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// cspell:ignore readded + using System; using System.Linq; using System.Threading.Tasks; @@ -394,9 +396,9 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.AreEqual("Recover", fields[0].Name); Assert.AreEqual("Default", fields[1].Name); - // No explicit initialization values - compiler auto-assigns based on order - Assert.IsNull(fields[0].InitializationValue); - Assert.IsNull(fields[1].InitializationValue); + // Shared members keep their explicit values from the last contract (Recover = 0, Default = 1). + Assert.AreEqual(0, (fields[0].InitializationValue as LiteralExpression)?.Literal); + Assert.AreEqual(1, (fields[1].InitializationValue as LiteralExpression)?.Literal); } // Validates that int enum member order is preserved and new values are appended @@ -429,18 +431,75 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.AreEqual("Default", fields[1].Name); Assert.AreEqual("Third", fields[2].Name); - // No explicit initialization values for reordered members - compiler auto-assigns based on order - Assert.IsNull(fields[0].InitializationValue); - Assert.IsNull(fields[1].InitializationValue); + // Shared members keep their explicit values from the last contract (Recover = 0, Default = 1). + Assert.AreEqual(0, (fields[0].InitializationValue as LiteralExpression)?.Literal); + Assert.AreEqual(1, (fields[1].InitializationValue as LiteralExpression)?.Literal); // New value keeps its initialization value from the input var value3 = fields[2].InitializationValue as LiteralExpression; Assert.IsNotNull(value3); Assert.AreEqual(2, value3?.Literal); } - // Validates that removed enum values from last contract are not included + // Verifies that the last contract (reconstructed from Roslyn) exposes each enum member's + // explicit numeric value, so back-compat can preserve non-contiguous values (e.g. 100, 200, + // 500) rather than reassigning positional ordinals. + [Test] + public async Task BackCompat_LastContractExposesEnumMemberValues() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var input = InputFactory.Int32Enum("mockInputEnum", [ + ("OneHundred", 100), + ("TwoHundred", 200), + ("FiveHundred", 500), + ]); + + var enumType = EnumProvider.Create(input); + enumType.EnsureBuilt(); + + var lastContractFields = enumType.LastContractView?.Fields; + Assert.IsNotNull(lastContractFields); + Assert.AreEqual(3, lastContractFields!.Count); + + var values = lastContractFields.Select(f => (f.InitializationValue as LiteralExpression)?.Literal).ToArray(); + CollectionAssert.AreEqual(new object[] { 100, 200, 500 }, values); + } + [Test] - public async Task BackCompat_IntEnumValueRemoved() + public async Task BackCompat_IntEnumNonContiguousValuesPreserved() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var input = InputFactory.Int32Enum("mockInputEnum", [ + ("OneHundred", 100), + ("TwoHundred", 200), + ("FiveHundred", 500), + ]); + + var enumType = EnumProvider.Create(input); + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + Assert.AreEqual(3, fields.Count); + Assert.AreEqual("OneHundred", fields[0].Name); + Assert.AreEqual("TwoHundred", fields[1].Name); + Assert.AreEqual("FiveHundred", fields[2].Name); + + // Each member keeps its exact explicit value from the last contract. + Assert.AreEqual(100, (fields[0].InitializationValue as LiteralExpression)?.Literal); + Assert.AreEqual(200, (fields[1].InitializationValue as LiteralExpression)?.Literal); + Assert.AreEqual(500, (fields[2].InitializationValue as LiteralExpression)?.Literal); + } + + // Validates that an integer enum value removed from the current spec is re-added from the + // last contract (preserving its explicit numeric value) to keep the previously shipped API. + [Test] + public async Task BackCompat_IntEnumRemovedValueReadded() { await MockHelpers.LoadMockGeneratorAsync( createCSharpTypeCore: (inputType) => typeof(int), @@ -459,18 +518,211 @@ await MockHelpers.LoadMockGeneratorAsync( enumType.EnsureBuilt(); enumType.ProcessTypeForBackCompatibility(); + var fields = enumType.Fields; + Assert.AreEqual(3, fields.Count); + + // Order preserved from last contract, and the removed "Third" is re-added at its + // original position. + Assert.AreEqual("Recover", fields[0].Name); + Assert.AreEqual("Default", fields[1].Name); + Assert.AreEqual("Third", fields[2].Name); + + // Shared members keep their explicit values from the last contract (Recover = 0, Default = 1). + Assert.AreEqual(0, (fields[0].InitializationValue as LiteralExpression)?.Literal); + Assert.AreEqual(1, (fields[1].InitializationValue as LiteralExpression)?.Literal); + + // The re-added member keeps its explicit numeric value from the last contract. + var readdedValue = fields[2].InitializationValue as LiteralExpression; + Assert.IsNotNull(readdedValue); + Assert.AreEqual(2, readdedValue?.Literal); + } + + // Validates that a value removed from the MIDDLE of an integer enum is re-added at its + // original position, preserving both surrounding order and its explicit numeric value. + [Test] + public async Task BackCompat_IntEnumRemovedMiddleValueReadded() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // Last contract: Alpha = 0, Beta = 1, Gamma = 2. Current input removes the middle "Beta". + var input = InputFactory.Int32Enum("mockInputEnum", [ + ("Alpha", 0), + ("Gamma", 2), + ]); + + var enumType = EnumProvider.Create(input); + Assert.IsFalse(enumType is ApiVersionEnumProvider); + + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + Assert.AreEqual(3, fields.Count); + + // "Beta" is re-added at its original middle position. + Assert.AreEqual("Alpha", fields[0].Name); + Assert.AreEqual("Beta", fields[1].Name); + Assert.AreEqual("Gamma", fields[2].Name); + + // All members keep their explicit last-contract values (Alpha = 0, Beta = 1, Gamma = 2). + Assert.AreEqual(0, (fields[0].InitializationValue as LiteralExpression)?.Literal); + var betaValue = fields[1].InitializationValue as LiteralExpression; + Assert.IsNotNull(betaValue); + Assert.AreEqual(1, betaValue?.Literal); + Assert.AreEqual(2, (fields[2].InitializationValue as LiteralExpression)?.Literal); + } + + // Validates that a value removed from a long-backed integer enum is re-added with its exact + // (potentially > int.MaxValue) numeric value preserved from the last contract. + [Test] + public async Task BackCompat_LongEnumRemovedValueReadded() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(long), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // Last contract: Small = 0, Large = 5000000000 (> int.MaxValue). Current removes "Large". + var input = InputFactory.Int64Enum("mockInputEnum", [ + ("Small", 0), + ]); + + var enumType = EnumProvider.Create(input); + Assert.IsFalse(enumType is ApiVersionEnumProvider); + + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + var fields = enumType.Fields; Assert.AreEqual(2, fields.Count); - // Order should be preserved from last contract for members that still exist + Assert.AreEqual("Small", fields[0].Name); + Assert.AreEqual("Large", fields[1].Name); + + // The shared member keeps its explicit last-contract value (Small = 0, as a long). + Assert.AreEqual(0L, (fields[0].InitializationValue as LiteralExpression)?.Literal); + + // The re-added member preserves its long value exactly (not truncated to int). + var largeValue = fields[1].InitializationValue as LiteralExpression; + Assert.IsNotNull(largeValue); + Assert.AreEqual(5000000000L, largeValue?.Literal); + Assert.IsInstanceOf(largeValue?.Literal); + } + + // Validates that removed members are NOT re-added for string-backed enums, because the + // serialized wire value is not recoverable from the last contract (only the C# ordinal is). + [Test] + public async Task BackCompat_StringEnumRemovedValueNotReadded() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(string), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // Last contract: Recover, Default, Third. Current input removes "Third". + var input = InputFactory.StringEnum("mockInputEnum", [ + ("Default", "default"), + ("Recover", "recover"), + ]); + + var enumType = EnumProvider.Create(input); + Assert.IsFalse(enumType is ApiVersionEnumProvider); + + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + + // "Third" must NOT be re-added for a string-based enum; only the two current members remain. + Assert.AreEqual(2, fields.Count); Assert.AreEqual("Recover", fields[0].Name); Assert.AreEqual("Default", fields[1].Name); + Assert.IsFalse(fields.Any(f => f.Name == "Third")); - // No explicit initialization values - compiler auto-assigns based on order + // String-based enum members never carry an explicit initialization value. Assert.IsNull(fields[0].InitializationValue); Assert.IsNull(fields[1].InitializationValue); } + // Validates that a removed integer enum member is NOT re-added when its removal is accepted + // in the ApiCompat baseline (here recorded as an EnumValuesMustMatch suppression), so the + // generator honors the intentional removal instead of resurrecting it. + [Test] + public async Task BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(); + + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + apiCompatBaseline: baseline); + + // Last contract: Recover, Default, Third. Current input removes "Third", but the baseline + // accepts that removal, so it must NOT be re-added. + var input = InputFactory.Int32Enum("mockInputEnum", [ + ("Default", 0), + ("Recover", 1), + ]); + + var enumType = EnumProvider.Create(input); + Assert.IsFalse(enumType is ApiVersionEnumProvider); + + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + Assert.AreEqual(2, fields.Count); + Assert.IsFalse(fields.Any(f => f.Name == "Third")); + Assert.AreEqual("Recover", fields[0].Name); + Assert.AreEqual("Default", fields[1].Name); + + // The surviving shared members keep their explicit last-contract values (Recover = 0, Default = 1). + Assert.AreEqual(0, (fields[0].InitializationValue as LiteralExpression)?.Literal); + Assert.AreEqual(1, (fields[1].InitializationValue as LiteralExpression)?.Literal); + } + + // Validates that when a shared integer enum member's value was intentionally changed and the + // baseline accepts it (recorded as an EnumValuesMustMatch suppression), back-compat honors the + // CURRENT value instead of restoring the old last-contract value. + [Test] + public async Task BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(); + + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + apiCompatBaseline: baseline); + + // Last contract: Recover = 0, Default = 5. Current changes Default to 1; the baseline accepts + // the value change, so back-compat must keep the current value (1) rather than restoring 5. + var input = InputFactory.Int32Enum("mockInputEnum", [ + ("Default", 1), + ("Recover", 0), + ]); + + var enumType = EnumProvider.Create(input); + Assert.IsFalse(enumType is ApiVersionEnumProvider); + + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + Assert.AreEqual(2, fields.Count); + + // Order is preserved from the last contract: Recover first, Default second. + Assert.AreEqual("Recover", fields[0].Name); + Assert.AreEqual("Default", fields[1].Name); + + // Recover was unchanged, so it keeps its (identical) value of 0. + Assert.AreEqual(0, (fields[0].InitializationValue as LiteralExpression)?.Literal); + + // Default's accepted value change is honored: the CURRENT value (1) is kept, not the old (5). + var defaultValue = fields[1].InitializationValue as LiteralExpression; + Assert.IsNotNull(defaultValue); + Assert.AreEqual(1, defaultValue?.Literal); + } + // Validates that string enum order is also preserved from last contract [Test] public async Task BackCompat_StringEnumOrderPreserved() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts.txt b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts.txt new file mode 100644 index 00000000000..ea63b24a4c6 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts.txt @@ -0,0 +1,4 @@ +# The Default member's value was intentionally changed from 5 (contract) to 1 (implementation). +# Accepting the difference in the baseline means back-compat must honor the new value instead of +# restoring the old one. +EnumValuesMustMatch : Enum value 'Sample.Models.MockInputEnum Sample.Models.MockInputEnum.Default' is (System.Int32)1 in the implementation but (System.Int32)5 in the contract. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts/MockInputEnum.cs new file mode 100644 index 00000000000..cc5d8599434 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumChangedValueHonoredWhenBaselineAccepts/MockInputEnum.cs @@ -0,0 +1,10 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Recover = 0, + Default = 5, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumNonContiguousValuesPreserved/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumNonContiguousValuesPreserved/MockInputEnum.cs new file mode 100644 index 00000000000..6a1ca3ff51b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumNonContiguousValuesPreserved/MockInputEnum.cs @@ -0,0 +1,11 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + OneHundred = 100, + TwoHundred = 200, + FiveHundred = 500, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedMiddleValueReadded/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedMiddleValueReadded/MockInputEnum.cs new file mode 100644 index 00000000000..4c8303d7c42 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedMiddleValueReadded/MockInputEnum.cs @@ -0,0 +1,11 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Alpha = 0, + Beta = 1, + Gamma = 2, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts.txt b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts.txt new file mode 100644 index 00000000000..a49039dcdac --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts.txt @@ -0,0 +1,4 @@ +# The Third enum member was intentionally removed during migration; suppress the difference so the +# back-compat system honors the removal instead of re-adding it. ApiCompat reports a removed enum +# member as a MembersMustExist difference. +MembersMustExist : Member 'public Sample.Models.MockInputEnum Sample.Models.MockInputEnum.Third' does not exist in the implementation but it does exist in the contract. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumValueRemoved/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts/MockInputEnum.cs similarity index 100% rename from packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumValueRemoved/MockInputEnum.cs rename to packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueNotReaddedWhenBaselineAccepts/MockInputEnum.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueReadded/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueReadded/MockInputEnum.cs new file mode 100644 index 00000000000..e93e6f85a4a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_IntEnumRemovedValueReadded/MockInputEnum.cs @@ -0,0 +1,11 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Recover = 0, + Default = 1, + Third = 2, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LastContractExposesEnumMemberValues/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LastContractExposesEnumMemberValues/MockInputEnum.cs new file mode 100644 index 00000000000..6a1ca3ff51b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LastContractExposesEnumMemberValues/MockInputEnum.cs @@ -0,0 +1,11 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + OneHundred = 100, + TwoHundred = 200, + FiveHundred = 500, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LongEnumRemovedValueReadded/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LongEnumRemovedValueReadded/MockInputEnum.cs new file mode 100644 index 00000000000..507bb126c3f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_LongEnumRemovedValueReadded/MockInputEnum.cs @@ -0,0 +1,10 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum : long + { + Small = 0, + Large = 5000000000, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_StringEnumRemovedValueNotReadded/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_StringEnumRemovedValueNotReadded/MockInputEnum.cs new file mode 100644 index 00000000000..e93e6f85a4a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_StringEnumRemovedValueNotReadded/MockInputEnum.cs @@ -0,0 +1,11 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Recover = 0, + Default = 1, + Third = 2, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityKeepsModifierOnNonAbstractType/KeepCtorType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityKeepsModifierOnNonAbstractType/KeepCtorType.cs new file mode 100644 index 00000000000..9b45621f6df --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityKeepsModifierOnNonAbstractType/KeepCtorType.cs @@ -0,0 +1,9 @@ +namespace Test +{ + public class KeepCtorType + { + public KeepCtorType(string baseProp) + { + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityPromotesPrivateProtectedToPublic/PromoteCtorType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityPromotesPrivateProtectedToPublic/PromoteCtorType.cs new file mode 100644 index 00000000000..180db065877 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildConstructorsForBackCompatibilityPromotesPrivateProtectedToPublic/PromoteCtorType.cs @@ -0,0 +1,9 @@ +namespace Test +{ + public abstract class PromoteCtorType + { + public PromoteCtorType(string baseProp) + { + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildDeclarationModifiersPreservesNonAbstractFromLastContract/NonAbstractPreservedType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildDeclarationModifiersPreservesNonAbstractFromLastContract/NonAbstractPreservedType.cs new file mode 100644 index 00000000000..688e1888072 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildDeclarationModifiersPreservesNonAbstractFromLastContract/NonAbstractPreservedType.cs @@ -0,0 +1,6 @@ +namespace Test +{ + public class NonAbstractPreservedType + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter.cs new file mode 100644 index 00000000000..8711e5b406f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ComponentModel; +using System.Threading.Tasks; + +namespace Test +{ + public partial class AsyncOverloadType + { + public async global::System.Threading.Tasks.Task GetDataAsync(int param1, bool param2 = default) + { + return null; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public global::System.Threading.Tasks.Task GetDataAsync(int param1) + { + return this.GetDataAsync(param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter/AsyncOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter/AsyncOverloadType.cs new file mode 100644 index 00000000000..c8edc09a2e5 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter/AsyncOverloadType.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace Test +{ + public class AsyncOverloadType + { + public async Task GetDataAsync(int param1) + { + return await Task.FromResult(null); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter.cs new file mode 100644 index 00000000000..08e420fbdb5 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ComponentModel; +using System.Threading.Tasks; + +namespace Test +{ + public partial class AsyncTaskOverloadType + { + public async global::System.Threading.Tasks.Task DoWorkAsync(int param1, bool param2 = default) + { + return null; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public global::System.Threading.Tasks.Task DoWorkAsync(int param1) + { + return this.DoWorkAsync(param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter/AsyncTaskOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter/AsyncTaskOverloadType.cs new file mode 100644 index 00000000000..80d1dea1fce --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter/AsyncTaskOverloadType.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace Test +{ + public class AsyncTaskOverloadType + { + public async Task DoWorkAsync(int param1) + { + await Task.CompletedTask; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter.cs new file mode 100644 index 00000000000..27ada66502b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter.cs @@ -0,0 +1,22 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class NewOptionalParamType + { + public string GetData(int param1, bool param2 = default) + { + return null; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public string GetData(int param1) + { + return this.GetData(param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter/NewOptionalParamType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter/NewOptionalParamType.cs new file mode 100644 index 00000000000..69e7f0621e2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter/NewOptionalParamType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class NewOptionalParamType + { + public string GetData(int param1) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.cs new file mode 100644 index 00000000000..5e33da0c504 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.cs @@ -0,0 +1,22 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class DifferentOverloadRemovalType + { + public string GetData(int param1, bool param2 = default) + { + return null; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public string GetData(int param1) + { + return this.GetData(param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.txt b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.txt new file mode 100644 index 00000000000..db4dfd3dcef --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted.txt @@ -0,0 +1 @@ +MembersMustExist : Member 'public System.String Test.DifferentOverloadRemovalType.GetData(System.String)' does not exist in the implementation but it does exist in the contract. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted/DifferentOverloadRemovalType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted/DifferentOverloadRemovalType.cs new file mode 100644 index 00000000000..683dd861592 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted/DifferentOverloadRemovalType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class DifferentOverloadRemovalType + { + public string GetData(int param1) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter.cs new file mode 100644 index 00000000000..4c768fd2b46 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter.cs @@ -0,0 +1,22 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class StaticOverloadType + { + public static string GetData(int param1, bool param2 = default) + { + return null; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public static string GetData(int param1) + { + return global::Test.StaticOverloadType.GetData(param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter/StaticOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter/StaticOverloadType.cs new file mode 100644 index 00000000000..514ea6bdb9c --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter/StaticOverloadType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class StaticOverloadType + { + public static string GetData(int param1) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter.cs new file mode 100644 index 00000000000..027f0f2b3cd --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class VoidOverloadType + { + public void DoWork(int param1, bool param2 = default) + { + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public void DoWork(int param1) + { + this.DoWork(param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter/VoidOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter/VoidOverloadType.cs new file mode 100644 index 00000000000..e4890ff568f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter/VoidOverloadType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class VoidOverloadType + { + public void DoWork(int param1) { } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName.cs new file mode 100644 index 00000000000..a1fadf5dd08 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName.cs @@ -0,0 +1,18 @@ +// + +#nullable disable + +using Sample; + +namespace Test +{ + public partial class TestClient + { + public string Foo(string brandNewParam) + { + global::Sample.Argument.AssertNotNullOrEmpty(brandNewParam, nameof(brandNewParam)); + + return brandNewParam; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName/TestClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName/TestClient.cs new file mode 100644 index 00000000000..afe96ffaaf7 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName/TestClient.cs @@ -0,0 +1,10 @@ +namespace Test +{ + /// + /// Previously-published contract that does not contain the "brandNewParam" parameter. + /// + public class TestClient + { + public string Foo(string oldParam) { return null; } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword.cs new file mode 100644 index 00000000000..f6dd979ea1b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword.cs @@ -0,0 +1,22 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class ExtensionOverloadType + { + public static string GetData(this object client, int param1, bool param2 = default) + { + return "foo"; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public static string GetData(this object client, int param1) + { + return global::Test.ExtensionOverloadType.GetData(client: client, param1: param1, param2: default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword/ExtensionOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword/ExtensionOverloadType.cs new file mode 100644 index 00000000000..61b2784d108 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword/ExtensionOverloadType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public static class ExtensionOverloadType + { + public static string GetData(this object client, int param1) => "foo"; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword.cs new file mode 100644 index 00000000000..dfc3c6d1cbe --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class OutOverloadType + { + public bool TryParse(string value, out int result, bool param2 = default) + { + result = 0; + return false; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public bool TryParse(string value, out int result) + { + return this.TryParse(value, out result, default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword/OutOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword/OutOverloadType.cs new file mode 100644 index 00000000000..4b73ed4eced --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesOutKeyword/OutOverloadType.cs @@ -0,0 +1,11 @@ +namespace Test +{ + public class OutOverloadType + { + public bool TryParse(string value, out int result) + { + result = 0; + return false; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword.cs new file mode 100644 index 00000000000..09ad7fba438 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword.cs @@ -0,0 +1,22 @@ +// + +#nullable disable + +using System.ComponentModel; + +namespace Test +{ + public partial class RefOverloadType + { + public bool TryGetData(string value, ref int result, bool param2 = default) + { + return false; + } + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public bool TryGetData(string value, ref int result) + { + return this.TryGetData(value, ref result, default); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword/RefOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword/RefOverloadType.cs new file mode 100644 index 00000000000..f3d321b2a65 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityPreservesRefKeyword/RefOverloadType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class RefOverloadType + { + public bool TryGetData(string value, ref int result) => false; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations.cs new file mode 100644 index 00000000000..c611ba3d45d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using Sample; + +namespace Test +{ + public partial class TestClient + { + public string Foo(string oldParam) + { + global::Sample.Argument.AssertNotNullOrEmpty(oldParam, nameof(oldParam)); + + this.Validate(oldParam); + return oldParam; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations/TestClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations/TestClient.cs new file mode 100644 index 00000000000..c413df7e7f8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations/TestClient.cs @@ -0,0 +1,10 @@ +namespace Test +{ + /// + /// Previously-published contract: the parameter was published as "oldParam". + /// + public class TestClient + { + public string Foo(string oldParam) { return null; } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName.cs new file mode 100644 index 00000000000..c611ba3d45d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName.cs @@ -0,0 +1,19 @@ +// + +#nullable disable + +using Sample; + +namespace Test +{ + public partial class TestClient + { + public string Foo(string oldParam) + { + global::Sample.Argument.AssertNotNullOrEmpty(oldParam, nameof(oldParam)); + + this.Validate(oldParam); + return oldParam; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName/TestClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName/TestClient.cs new file mode 100644 index 00000000000..c413df7e7f8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilityRestoresPreviousParameterName/TestClient.cs @@ -0,0 +1,10 @@ +namespace Test +{ + /// + /// Previously-published contract: the parameter was published as "oldParam". + /// + public class TestClient + { + public string Foo(string oldParam) { return null; } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval.txt b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval.txt new file mode 100644 index 00000000000..ec668690582 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval.txt @@ -0,0 +1 @@ +MembersMustExist : Member 'public System.String Test.SkipOverloadType.GetData(System.Int32)' does not exist in the implementation but it does exist in the contract. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval/SkipOverloadType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval/SkipOverloadType.cs new file mode 100644 index 00000000000..1e1b8d634c4 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval/SkipOverloadType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class SkipOverloadType + { + public string GetData(int param1) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.cs new file mode 100644 index 00000000000..c0647c0cd30 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Test +{ + public partial class SkipReorderType + { + public string Foo(int second, string first) + { + return null; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.txt b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.txt new file mode 100644 index 00000000000..7e78b1188d0 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline.txt @@ -0,0 +1 @@ +MembersMustExist : Member 'public System.String Test.SkipReorderType.Foo(System.String, System.Int32)' does not exist in the implementation but it does exist in the contract. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline/SkipReorderType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline/SkipReorderType.cs new file mode 100644 index 00000000000..0374f273cfb --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline/SkipReorderType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class SkipReorderType + { + public string Foo(string first, int second) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat.cs new file mode 100644 index 00000000000..a4c2bd4cf62 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Test +{ + public partial class CustomReorderType + { + public string Foo(string first, int second) + { + return null; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat/CustomReorderType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat/CustomReorderType.cs new file mode 100644 index 00000000000..0c0a8860a69 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderInheritsParameterReorderBackCompat/CustomReorderType.cs @@ -0,0 +1,7 @@ +namespace Test +{ + public class CustomReorderType + { + public string Foo(string first, int second) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults.cs new file mode 100644 index 00000000000..f41eb686ec3 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Test +{ + public partial class CustomReorderValueTypeDefaultsType + { + public string Foo(int count = 0, bool flag = false) + { + return null; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults/CustomReorderValueTypeDefaultsType.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults/CustomReorderValueTypeDefaultsType.cs new file mode 100644 index 00000000000..d45afd10149 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/CustomTypeProviderReorderPreservesValueTypeDefaults/CustomReorderValueTypeDefaultsType.cs @@ -0,0 +1,13 @@ +namespace Test +{ + /// + /// Previous contract whose Foo method declares value-type optional parameters with literal + /// defaults (count = 0, flag = false) in the order (count, flag). The current generation + /// declares them in a different order with `default`-keyword defaults; restoring the order must + /// also preserve the previously published literal default representation. + /// + public class CustomReorderValueTypeDefaultsType + { + public string Foo(int count = 0, bool flag = false) => null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/FindPreviousParameterNameLooksUpLastContract/TestClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/FindPreviousParameterNameLooksUpLastContract/TestClient.cs new file mode 100644 index 00000000000..2c11ceaee1e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TestData/TypeProviderTests/FindPreviousParameterNameLooksUpLastContract/TestClient.cs @@ -0,0 +1,15 @@ +namespace Test +{ + /// + /// Represents the previously-published contract for a type whose parameters may have since + /// been renamed by the generator. + /// + public class TestClient + { + public void Foo(string oldParam) { } + + public void BarAsync(string oldAsyncParam) { } + + public void Other(string otherParam) { } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs index 9ec0b21c32d..34e119f008a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs @@ -12,6 +12,7 @@ using Microsoft.TypeSpec.Generator.Snippets; using Microsoft.TypeSpec.Generator.Statements; using Microsoft.TypeSpec.Generator.Tests.Common; +using Microsoft.TypeSpec.Generator.Utilities; using NUnit.Framework; namespace Microsoft.TypeSpec.Generator.Tests.Providers @@ -57,6 +58,676 @@ public async Task TestLoadLastContractView() Assert.AreEqual("p1", signature.Parameters[0].Name); } + // Validates that a custom TypeProvider inherits the parameter-reordering back-compat behavior + // from the base TypeProvider. + [Test] + public async Task CustomTypeProviderInheritsParameterReorderBackCompat() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // Current generation declares Foo(second, first) — the reverse of the last contract's + // Foo(first, second). + var first = new ParameterProvider("first", $"", new CSharpType(typeof(string))); + var second = new ParameterProvider("second", $"", new CSharpType(typeof(int))); + var currentFoo = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [second, first]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "CustomReorderType", ns: "Test", methods: [currentFoo]); + + // The custom type does not override BuildMethodsForBackCompatibility; the base default + // restores the previous parameter order in place. + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // Validates that when restoring a previous parameter order, the previously published default + // value representation is preserved (e.g. a value-type parameter keeps its literal `= 0` + // rather than flipping to `= default`). + [Test] + public async Task CustomTypeProviderReorderPreservesValueTypeDefaults() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // Current generation declares Foo(flag, count) with `default`-keyword defaults — the + // reverse of the last contract's Foo(int count = 0, bool flag = false). + var flag = new ParameterProvider("flag", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default); + var count = new ParameterProvider("count", $"", new CSharpType(typeof(int)), defaultValue: Snippet.Default); + var currentFoo = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [flag, count]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "CustomReorderValueTypeDefaultsType", ns: "Test", methods: [currentFoo]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // Validates that the base BuildMethodsForBackCompatibility default does NOT restore the + // previous parameter order when that removal has been accepted in the ApiCompat baseline. + [Test] + public async Task BuildMethodsForBackCompatibilitySkipsReorderAcceptedInBaseline() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(); + + await MockHelpers.LoadMockGeneratorAsync( + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + apiCompatBaseline: baseline); + + // Current generation declares Foo(second, first) — the reverse of the last contract's + // Foo(first, second) — but the reorder is an accepted removal in the ApiCompat baseline, + // so the base default must leave the current order untouched. + var first = new ParameterProvider("first", $"", new CSharpType(typeof(string))); + var second = new ParameterProvider("second", $"", new CSharpType(typeof(int))); + var currentFoo = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [second, first]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "SkipReorderType", ns: "Test", methods: [currentFoo]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // Validates that the base TypeProvider generalizes the non-abstract base model back-compat to + // any TypeProvider: a type the current generation would declare abstract is kept non-abstract + // when the last contract published it as a non-abstract class. + [Test] + public async Task BuildDeclarationModifiersPreservesNonAbstractFromLastContract() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var typeProvider = new TestTypeProvider( + name: "NonAbstractPreservedType", + ns: "Test", + declarationModifiers: TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract | TypeSignatureModifiers.Class); + + Assert.IsFalse( + typeProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract), + "Expected the abstract modifier to be removed to match the non-abstract last contract."); + } + + // Validates the negative case: without a last contract, a type the current generation declares + // abstract stays abstract (the preservation only applies against a non-abstract last contract). + [Test] + public void BuildDeclarationModifiersKeepsAbstractWithoutLastContract() + { + var typeProvider = new TestTypeProvider( + name: "AbstractNoContractType", + ns: "Test", + declarationModifiers: TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract | TypeSignatureModifiers.Class); + + Assert.IsTrue(typeProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Abstract)); + } + + // Validates that the base TypeProvider generalizes the model-constructor back-compat to any + // abstract TypeProvider: a private-protected constructor is promoted to public when the last + // contract published a matching public constructor. + [Test] + public async Task BuildConstructorsForBackCompatibilityPromotesPrivateProtectedToPublic() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var baseProp = new ParameterProvider("baseProp", $"", new CSharpType(typeof(string))); + var currentConstructor = new ConstructorProvider( + new ConstructorSignature( + new CSharpType(typeof(object)), + $"", + MethodSignatureModifiers.Private | MethodSignatureModifiers.Protected, + [baseProp]), + Snippet.ThrowExpression(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider( + name: "PromoteCtorType", + ns: "Test", + declarationModifiers: TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract | TypeSignatureModifiers.Class, + constructors: [currentConstructor]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var promoted = typeProvider.Constructors.Single(); + Assert.IsTrue(promoted.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Public)); + Assert.IsFalse(promoted.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Private)); + Assert.IsFalse(promoted.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Protected)); + } + + // Validates the negative case: a non-abstract type does not get its private-protected + // constructor promoted, even with a matching public constructor in the last contract. + [Test] + public async Task BuildConstructorsForBackCompatibilityKeepsModifierOnNonAbstractType() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var baseProp = new ParameterProvider("baseProp", $"", new CSharpType(typeof(string))); + var currentConstructor = new ConstructorProvider( + new ConstructorSignature( + new CSharpType(typeof(object)), + $"", + MethodSignatureModifiers.Private | MethodSignatureModifiers.Protected, + [baseProp]), + Snippet.ThrowExpression(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider( + name: "KeepCtorType", + ns: "Test", + declarationModifiers: TypeSignatureModifiers.Public | TypeSignatureModifiers.Class, + constructors: [currentConstructor]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var constructor = typeProvider.Constructors.Single(); + Assert.IsTrue(constructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Private)); + Assert.IsTrue(constructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Protected)); + Assert.IsFalse(constructor.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Public)); + } + + // Validates that the base TypeProvider generalizes the new-optional-parameter back-compat to any + // TypeProvider: a public method that gained an optional non-body parameter relative to the last + // contract gets a hidden overload matching the previous signature that delegates to the current one. + [Test] + public async Task BuildMethodsForBackCompatibilityAddsOverloadForNewOptionalParameter() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published GetData(int param1); the current generation adds an optional + // non-body parameter param2. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var getData = new MethodProvider( + new MethodSignature("GetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [param1, param2]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "NewOptionalParamType", ns: "Test", methods: [getData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: a STATIC method that gained an optional non-body parameter gets a hidden overload + // whose body delegates through the declaring type (not `this`), since a static method cannot use + // an instance receiver. + [Test] + public async Task BuildMethodsForBackCompatibilityAddsStaticOverloadForNewOptionalParameter() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published static GetData(int param1); the current generation adds an + // optional non-body parameter param2. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var getData = new MethodProvider( + new MethodSignature("GetData", $"", MethodSignatureModifiers.Public | MethodSignatureModifiers.Static, new CSharpType(typeof(string)), $"", [param1, param2]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "StaticOverloadType", ns: "Test", methods: [getData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: a VOID method that gained an optional non-body parameter gets a hidden overload + // whose body invokes the current method as a statement (no `return`), since a void method has no + // value to return. + [Test] + public async Task BuildMethodsForBackCompatibilityAddsVoidOverloadForNewOptionalParameter() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published void DoWork(int param1); the current generation adds an + // optional non-body parameter param2. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var doWork = new MethodProvider( + new MethodSignature("DoWork", $"", MethodSignatureModifiers.Public, null, $"", [param1, param2]), + MethodBodyStatement.Empty, + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "VoidOverloadType", ns: "Test", methods: [doWork]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: an async Task method that gained an optional non-body parameter gets a hidden + // overload that is NOT declared 'async' (it returns the delegated task directly). An async shim + // would emit `return this.FooAsync(...);` from an `async Task` method, which is CS4016. + [Test] + public async Task BuildMethodsForBackCompatibilityAddsAsyncTaskOfTOverloadForNewOptionalParameter() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published async Task GetDataAsync(int param1); the current + // generation adds an optional non-body parameter param2. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var getData = new MethodProvider( + new MethodSignature("GetDataAsync", $"", MethodSignatureModifiers.Public | MethodSignatureModifiers.Async, new CSharpType(typeof(Task)), $"", [param1, param2]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "AsyncOverloadType", ns: "Test", methods: [getData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: an async Task (non-generic) method that gained an optional non-body parameter + // gets a hidden overload that is NOT declared 'async' and returns the delegated task. + [Test] + public async Task BuildMethodsForBackCompatibilityAddsAsyncTaskOverloadForNewOptionalParameter() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published async Task DoWorkAsync(int param1); the current generation adds + // an optional non-body parameter param2. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var doWork = new MethodProvider( + new MethodSignature("DoWorkAsync", $"", MethodSignatureModifiers.Public | MethodSignatureModifiers.Async, new CSharpType(typeof(Task)), $"", [param1, param2]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "AsyncTaskOverloadType", ns: "Test", methods: [doWork]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: accepting the removal of ONE overload in the ApiCompat baseline must not suppress + // the optional-parameter overload for a DIFFERENT overload with the same arity but different + // parameter types. The baseline accepts removal of GetData(string); the current GetData(int) + // gained an optional parameter and must still receive its back-compat overload. + [Test] + public async Task BuildMethodsForBackCompatibilityAddsOverloadWhenDifferentOverloadRemovalAccepted() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(); + + await MockHelpers.LoadMockGeneratorAsync( + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + apiCompatBaseline: baseline); + + // The last contract published GetData(int param1); the current generation adds an optional + // param2. The baseline accepts removal of the unrelated GetData(string) overload only. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var getData = new MethodProvider( + new MethodSignature("GetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [param1, param2]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "DifferentOverloadRemovalType", ns: "Test", methods: [getData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + // The GetData(int) overload is still added because only GetData(string) removal was accepted. + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: a back-compat overload for a static extension method must preserve the extension + // 'this' modifier so the generated shim is still an extension method (a common scenario is a + // static "Extensions" class that gained an optional parameter). + [Test] + public async Task BuildMethodsForBackCompatibilityPreservesExtensionThisKeyword() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published a static extension method GetData(this object client, int param1); + // the current generation adds an optional non-body parameter param2. + var client = new ParameterProvider("client", $"", new CSharpType(typeof(object))); + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var getData = new MethodProvider( + new MethodSignature( + "GetData", + $"", + MethodSignatureModifiers.Public | MethodSignatureModifiers.Static | MethodSignatureModifiers.Extension, + new CSharpType(typeof(string)), + $"", + [client, param1, param2]), + Snippet.Return(Snippet.Literal("foo")), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "ExtensionOverloadType", ns: "Test", methods: [getData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: a back-compat overload for a method with a 'ref' parameter must preserve the + // 'ref' modifier on that parameter in the generated shim signature. + [Test] + public async Task BuildMethodsForBackCompatibilityPreservesRefKeyword() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published TryGetData(string value, ref int result); the current generation + // adds an optional non-body parameter param2. + var value = new ParameterProvider("value", $"", new CSharpType(typeof(string))); + var result = new ParameterProvider("result", $"", new CSharpType(typeof(int)), isRef: true); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var tryGetData = new MethodProvider( + new MethodSignature("TryGetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(bool)), $"", [value, result, param2]), + Snippet.Return(Snippet.False), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "RefOverloadType", ns: "Test", methods: [tryGetData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + // The back-compat shim reproduces the previous signature TryGetData(string value, ref int result) + // with the 'ref' modifier retained on both the parameter and the delegating call. + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: a back-compat overload for a method with an 'out' parameter must preserve the + // 'out' modifier on both the parameter and the delegating call so the generated code compiles. + [Test] + public async Task BuildMethodsForBackCompatibilityPreservesOutKeyword() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // The last contract published TryParse(string value, out int result); the current generation + // adds an optional non-body parameter param2. + var value = new ParameterProvider("value", $"", new CSharpType(typeof(string))); + var result = new ParameterProvider("result", $"", new CSharpType(typeof(int)), isOut: true); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var tryParse = new MethodProvider( + new MethodSignature("TryParse", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(bool)), $"", [value, result, param2]), + new MethodBodyStatement[] + { + // Assign the out parameter so the generated method body is valid C#. + result.Assign(Snippet.Literal(0)).Terminate(), + Snippet.Return(Snippet.False), + }, + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "OutOverloadType", ns: "Test", methods: [tryParse]); + + typeProvider.ProcessTypeForBackCompatibility(); + + // The back-compat shim reproduces the previous signature TryParse(string value, out int result) + // with the 'out' modifier retained on both the parameter and the delegating call. + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // TypeProvider: when a previous signature's removal is accepted in the ApiCompat baseline, the + // optional-parameter overload pass must NOT resurrect it even though the replacement method added + // optional parameters. + [Test] + public async Task BuildMethodsForBackCompatibilitySkipsOverloadForBaselineAcceptedRemoval() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(); + + await MockHelpers.LoadMockGeneratorAsync( + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + apiCompatBaseline: baseline); + + // The last contract published GetData(int param1); the current generation adds an optional + // param2. The baseline accepts the removal of GetData(int), so no overload must be added. + var param1 = new ParameterProvider("param1", $"", new CSharpType(typeof(int))); + var param2 = new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query); + var getData = new MethodProvider( + new MethodSignature("GetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [param1, param2]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "SkipOverloadType", ns: "Test", methods: [getData]); + + typeProvider.ProcessTypeForBackCompatibility(); + + // Only the current method remains; the accepted removal is not resurrected as an overload. + Assert.AreEqual(1, typeProvider.Methods.Count); + Assert.AreEqual(2, typeProvider.Methods[0].Signature.Parameters.Count); + } + + // Validates the shared lookup that any provider can use to restore a previously-published + // parameter name from its last contract. + [Test] + public async Task FindPreviousParameterNameLooksUpLastContract() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + var lastContractView = new TestTypeProvider(name: "TestClient").LastContractView; + + // The last contract published Foo(string oldParam); scoped to that method it is found. + Assert.AreEqual("oldParam", BackCompatHelper.FindPreviousParameterName(lastContractView, "oldParam", "Foo")); + + // The exact casing from the contract is returned even when the lookup name differs only in casing. + Assert.AreEqual("oldParam", BackCompatHelper.FindPreviousParameterName(lastContractView, "oldparam", "Foo")); + + // The lookup is scoped: "oldParam" is not published on Other. + Assert.IsNull(BackCompatHelper.FindPreviousParameterName(lastContractView, "oldParam", "Other")); + + // An unscoped lookup finds the parameter on any last-contract method. + Assert.AreEqual("oldParam", BackCompatHelper.FindPreviousParameterName(lastContractView, "oldParam")); + + // A parameter that does not exist in the last contract returns null. + Assert.IsNull(BackCompatHelper.FindPreviousParameterName(lastContractView, "missing", "Foo")); + + // A sync method name matches its async counterpart (BarAsync) in the contract. + Assert.AreEqual("oldAsyncParam", BackCompatHelper.FindPreviousParameterName(lastContractView, "oldAsyncParam", "Bar")); + } + + // Validates that the lookup returns null when there is no last contract. + [Test] + public void FindPreviousParameterNameReturnsNullWithoutLastContract() + { + var typeProvider = new TestTypeProvider(name: "TestClient"); + Assert.IsNull(typeProvider.LastContractView); + Assert.IsNull(BackCompatHelper.FindPreviousParameterName(typeProvider.LastContractView, "oldParam", "Foo")); + } + + [Test] + public async Task TryRestorePreviousParameterOrderMatchesNonCanonicalParameterNames() + { + await MockHelpers.LoadMockGeneratorAsync(); + + // Current generation declares Foo(second_param, first_param) — the reverse of the + // previous Foo(first_param, second_param). The raw names are snake_case, so matching + // requires normalizing both sides via ToVariableName. + var firstParam = new ParameterProvider("first_param", $"", new CSharpType(typeof(string))); + var secondParam = new ParameterProvider("second_param", $"", new CSharpType(typeof(int))); + var currentFoo = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [secondParam, firstParam]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + var previousSignature = new MethodSignature( + "Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", + [ + new ParameterProvider("first_param", $"", new CSharpType(typeof(string))), + new ParameterProvider("second_param", $"", new CSharpType(typeof(int))), + ]); + + var reordered = BackCompatHelper.TryRestorePreviousParameterOrder(currentFoo, previousSignature); + + Assert.IsTrue(reordered); + CollectionAssert.AreEqual( + new[] { "first_param", "second_param" }, + currentFoo.Signature.Parameters.Select(p => p.Name).ToArray()); + } + + // Validates that the default-value preservation performed while reordering also matches by + // the normalized parameter identifier, restoring the previously-published default onto the + // current parameter even when the raw name is snake_case. + [Test] + public async Task TryRestorePreviousParameterOrderPreservesPreviousDefaultForNonCanonicalNames() + { + await MockHelpers.LoadMockGeneratorAsync(); + + // Current declares Foo(second_param = default, first_param) — reverse of previous order. + var firstParam = new ParameterProvider("first_param", $"", new CSharpType(typeof(string))); + var secondParam = new ParameterProvider("second_param", $"", new CSharpType(typeof(int)), defaultValue: Snippet.Default); + var currentFoo = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [secondParam, firstParam]), + Snippet.Return(Snippet.Null), + new TestTypeProvider()); + + // The previously-published second_param carried a distinct default representation. + var previousDefault = Snippet.Literal(0); + var previousSignature = new MethodSignature( + "Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", + [ + new ParameterProvider("first_param", $"", new CSharpType(typeof(string))), + new ParameterProvider("second_param", $"", new CSharpType(typeof(int)), defaultValue: previousDefault), + ]); + + var reordered = BackCompatHelper.TryRestorePreviousParameterOrder(currentFoo, previousSignature); + + Assert.IsTrue(reordered); + CollectionAssert.AreEqual( + new[] { "first_param", "second_param" }, + currentFoo.Signature.Parameters.Select(p => p.Name).ToArray()); + + // The current second_param's default was restored from the previous contract. + var restoredSecond = currentFoo.Signature.Parameters.Single(p => p.Name == "second_param"); + Assert.AreSame(previousDefault, restoredSecond.DefaultValue); + } + + // Validates that a new optional parameter with an Unknown location is not treated as a + // non-body parameter, so no back-compat overload is produced for it. + [Test] + public void HasNewOptionalNonBodyParametersOnlyRejectsUnknownLocation() + { + var previousSignature = new MethodSignature( + "GetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", + [new ParameterProvider("param1", $"", new CSharpType(typeof(int)))]); + + // A new optional parameter whose location is Unknown must not qualify. + var unknownLocationSignature = new MethodSignature( + "GetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", + [ + new ParameterProvider("param1", $"", new CSharpType(typeof(int))), + new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Unknown), + ]); + + Assert.IsFalse(BackCompatHelper.HasNewOptionalNonBodyParametersOnly(previousSignature, unknownLocationSignature)); + + // The same shape with an explicit non-body location does qualify. + var queryLocationSignature = new MethodSignature( + "GetData", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", + [ + new ParameterProvider("param1", $"", new CSharpType(typeof(int))), + new ParameterProvider("param2", $"", new CSharpType(typeof(bool)), defaultValue: Snippet.Default, location: ParameterLocation.Query), + ]); + + Assert.IsTrue(BackCompatHelper.HasNewOptionalNonBodyParametersOnly(previousSignature, queryLocationSignature)); + } + + // Validates that the base BuildMethodsForBackCompatibility default automatically restores a + // previously-published parameter name on any derived type — keyed on the parameter's spec + // original name — and that the rename propagates into the already-built method body. + [Test] + public async Task BuildMethodsForBackCompatibilityRestoresPreviousParameterName() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // A spec parameter "oldParam" that the generator renamed to "newParam". + var inputParameter = InputFactory.QueryParameter("oldParam", InputPrimitiveType.String, isRequired: true); + inputParameter.Update(name: "newParam"); + + var parameter = new ParameterProvider(inputParameter); + var fooMethod = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [parameter]), + new MethodBodyStatement[] + { + // Passing the parameter as an argument to another method exercises propagation + // of the restored name into invocation arguments, not just the return. + Snippet.This.Invoke("Validate", parameter).Terminate(), + Snippet.Return(parameter), + }, + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "TestClient", methods: [fooMethod]); + + // The default has no override here; the base restores the previously-published name and + // the rename propagates into the already-built body. + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // Validates that a parameter whose spec name is not in the last contract keeps its current name. + [Test] + public async Task BuildMethodsForBackCompatibilityKeepsUnpublishedParameterName() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + // "brandNewParam" has no counterpart in the last contract (TestClient.Foo(oldParam)). + var inputParameter = InputFactory.QueryParameter("brandNewParam", InputPrimitiveType.String, isRequired: true); + var parameter = new ParameterProvider(inputParameter); + var fooMethod = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [parameter]), + Snippet.Return(parameter), + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "TestClient", methods: [fooMethod]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + // When the restored name is used both as an argument (AsArgument -> _asArgument) and + // as a variable (-> _asVariable), materializing both cached expressions before the rename, the + // rename must keep them sharing one declaration. Otherwise the writer renames the two + // declarations of the same name to "oldParam0"/"oldParam1", producing non-compiling code. + [Test] + public async Task BuildMethodsForBackCompatibilityRestoredNameDoesNotSplitDeclarations() + { + await MockHelpers.LoadMockGeneratorAsync(lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var inputParameter = InputFactory.QueryParameter("oldParam", InputPrimitiveType.String, isRequired: true); + inputParameter.Update(name: "newParam"); + + var parameter = new ParameterProvider(inputParameter); + var fooMethod = new MethodProvider( + new MethodSignature("Foo", $"", MethodSignatureModifiers.Public, new CSharpType(typeof(string)), $"", [parameter]), + new MethodBodyStatement[] + { + Snippet.This.Invoke("Validate", parameter.AsArgument()).Terminate(), + Snippet.Return(parameter), + }, + new TestTypeProvider()); + + var typeProvider = new TestTypeProvider(name: "TestClient", methods: [fooMethod]); + + typeProvider.ProcessTypeForBackCompatibility(); + + var actual = new TypeProviderWriter(typeProvider).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), actual); + } + + [Test] public async Task LastContractViewLoadedForRenamedType() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Shared/MethodSignatureHelperTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Shared/MethodSignatureHelperTests.cs index c07b3d131ce..8646fac594f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Shared/MethodSignatureHelperTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Shared/MethodSignatureHelperTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; using Microsoft.TypeSpec.Generator.Statements; @@ -285,6 +286,51 @@ public void BuildBackCompatMethodSignature_PreservesNameAndModifiers() Assert.AreEqual(typeof(string), backCompatSignature.ReturnType?.FrameworkType); } + [Test] + public void BuildBackCompatMethodSignature_ShouldNotBeAsyncFalse_PreservesAsyncModifier() + { + var originalSignature = CreateMethodSignature( + "TestMethodAsync", + modifiers: MethodSignatureModifiers.Public | MethodSignatureModifiers.Async, + returnType: typeof(Task), + parameters: [new ParameterProvider("param1", $"", typeof(int))]); + + // The default (shouldNotBeAsync: false) keeps the async modifier. + var backCompatSignature = MethodSignatureHelper.BuildBackCompatMethodSignature(originalSignature, hideMethod: false); + + Assert.IsTrue(backCompatSignature.Modifiers.HasFlag(MethodSignatureModifiers.Async)); + } + + [Test] + public void BuildBackCompatMethodSignature_ShouldNotBeAsyncTrue_RemovesAsyncModifier() + { + var originalSignature = CreateMethodSignature( + "TestMethodAsync", + modifiers: MethodSignatureModifiers.Public | MethodSignatureModifiers.Async, + returnType: typeof(Task), + parameters: [new ParameterProvider("param1", $"", typeof(int))]); + + var backCompatSignature = MethodSignatureHelper.BuildBackCompatMethodSignature(originalSignature, hideMethod: false, shouldNotBeAsync: true); + + // The async modifier is removed while the other modifiers are preserved. + Assert.IsFalse(backCompatSignature.Modifiers.HasFlag(MethodSignatureModifiers.Async)); + Assert.IsTrue(backCompatSignature.Modifiers.HasFlag(MethodSignatureModifiers.Public)); + } + + [Test] + public void BuildBackCompatMethodSignature_ShouldNotBeAsyncTrue_OnNonAsyncSignature_IsNoOp() + { + var originalSignature = CreateMethodSignature( + "TestMethod", + modifiers: MethodSignatureModifiers.Public | MethodSignatureModifiers.Virtual, + returnType: typeof(string), + parameters: [new ParameterProvider("param1", $"", typeof(int))]); + + var backCompatSignature = MethodSignatureHelper.BuildBackCompatMethodSignature(originalSignature, hideMethod: false, shouldNotBeAsync: true); + + Assert.AreEqual(MethodSignatureModifiers.Public | MethodSignatureModifiers.Virtual, backCompatSignature.Modifiers); + } + [Test] public void BuildBackCompatMethodSignature_HideMethodTrue_WithMultipleParameters_RemovesAllDefaults() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/ApiCompatBaselineTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/ApiCompatBaselineTests.cs index b50f507ce00..bddec2f1797 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/ApiCompatBaselineTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/ApiCompatBaselineTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; +using Microsoft.TypeSpec.Generator.Input; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.SourceInput; using Microsoft.TypeSpec.Generator.Tests.Common; @@ -11,6 +12,12 @@ namespace Microsoft.TypeSpec.Generator.Tests.SourceInput { public class ApiCompatBaselineTests { + [SetUp] + public void Setup() + { + MockHelpers.LoadMockGenerator(); + } + [Test] public void EmptyBaselineSuppressesNothing() { @@ -92,6 +99,26 @@ public void CountsGenericParametersAsSingleArgument() Assert.IsTrue(baseline.IsMemberSuppressed("Ns.Foo", "Configure", 2)); } + [Test] + public void ParsesMembersMustExistField() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // A removed field/enum member has no parameter list; it is recorded with arity 0. + Assert.IsTrue(baseline.IsMemberSuppressed("Ns.Foo", "LegacyField", 0)); + } + + [Test] + public void ParsesEnumValuesMustMatch() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // An accepted enum value difference suppresses back-compat handling for that member. + Assert.IsTrue(baseline.IsMemberSuppressed("Ns.CapacityLevel", "FiftyThousand", 0)); + // A different member on the same enum must not match. + Assert.IsFalse(baseline.IsMemberSuppressed("Ns.CapacityLevel", "OneHundred", 0)); + } + [Test] public void IgnoresUnknownRulesAndMalformedLines() { @@ -100,6 +127,218 @@ public void IgnoresUnknownRulesAndMalformedLines() Assert.IsTrue(baseline.IsEmpty); } + [Test] + public void IsMethodRemovalSuppressedDistinguishesOverloadsByParameterType() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // The baseline accepts removal of Get(string). Only that overload is suppressed; a Get(int) + // overload with the same arity must NOT be treated as suppressed. + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Overloads", "Get", [new CSharpType(typeof(string))])); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Overloads", "Get", [new CSharpType(typeof(int))])); + + // A different declaring type or member name must not match. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Other", "Get", [new CSharpType(typeof(string))])); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Overloads", "Set", [new CSharpType(typeof(string))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesGenericParameterTypes() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Foo.Configure(IDictionary, string) is suppressed; the query builds the same + // canonical signature from CSharpType parameters (including nested generic arguments). + var dictionary = new CSharpType(typeof(IDictionary<,>), new CSharpType(typeof(string)), new CSharpType(typeof(int))); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed( + "Ns.Foo", + "Configure", + [dictionary, new CSharpType(typeof(string))])); + + // Same arity but different generic argument types must not match. + var wrongDictionary = new CSharpType(typeof(IDictionary<,>), new CSharpType(typeof(string)), new CSharpType(typeof(string))); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed( + "Ns.Foo", + "Configure", + [wrongDictionary, new CSharpType(typeof(string))])); + } + + [Test] + public void IsMethodRemovalSuppressedHonorsTypeSuppression() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // The whole type is suppressed via TypesMustExist, so any method on it is suppressed + // regardless of parameter types. + Assert.IsTrue(baseline.IsMethodRemovalSuppressed( + "Azure.AI.Projects.Agents.ProjectsAgentProtocol", + "AnyMethod", + [new CSharpType(typeof(int))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesNullableValueTypeParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithNullable(System.Nullable) is suppressed. A nullable value type + // is rendered as System.Nullable on both sides. + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithNullable", [new CSharpType(typeof(int?))])); + + // The non-nullable int overload is a different signature and must not match. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithNullable", [new CSharpType(typeof(int))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesArrayParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithArray(System.String[]) is suppressed. + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithArray", [new CSharpType(typeof(string[]))])); + + // A non-array string parameter is a different signature. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithArray", [new CSharpType(typeof(string))])); + + // An array of a different element type must not match. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithArray", [new CSharpType(typeof(int[]))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesGenericListParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithList(System.Collections.Generic.List) is suppressed. + var listOfString = new CSharpType(typeof(List<>), new CSharpType(typeof(string))); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithList", [listOfString])); + + // The same generic definition with a different argument type must not match. + var listOfInt = new CSharpType(typeof(List<>), new CSharpType(typeof(int))); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithList", [listOfInt])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesNestedGenericParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithNestedGeneric(IList>) is suppressed; nested generic + // arguments are rendered recursively on both sides. + var nested = new CSharpType( + typeof(IList<>), + new CSharpType(typeof(IDictionary<,>), new CSharpType(typeof(string)), new CSharpType(typeof(int)))); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithNestedGeneric", [nested])); + + // A difference in the innermost argument type must not match. + var wrongNested = new CSharpType( + typeof(IList<>), + new CSharpType(typeof(IDictionary<,>), new CSharpType(typeof(string)), new CSharpType(typeof(string)))); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithNestedGeneric", [wrongNested])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesMultipleParametersInOrder() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithMany(int, string, bool) is suppressed. + Assert.IsTrue(baseline.IsMethodRemovalSuppressed( + "Ns.Types", + "WithMany", + [new CSharpType(typeof(int)), new CSharpType(typeof(string)), new CSharpType(typeof(bool))])); + + // The same types in a different order are a different signature. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed( + "Ns.Types", + "WithMany", + [new CSharpType(typeof(string)), new CSharpType(typeof(int)), new CSharpType(typeof(bool))])); + + // A different parameter count must not match. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed( + "Ns.Types", + "WithMany", + [new CSharpType(typeof(int)), new CSharpType(typeof(string))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesParameterlessOverload() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Foo.Reset() has no parameters; the canonical signature is empty on both sides. + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Foo", "Reset", [])); + + // The parameterless overload must not match an overload that takes an argument. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Foo", "Reset", [new CSharpType(typeof(int))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesEnumParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithEnum(Sample.Models.MyKind) is suppressed. The enum's output type is produced + // by the TypeFactory from the input enum and renders as its fully-qualified name. + var kindInput = InputFactory.Int32Enum("myKind", [("One", 1), ("Two", 2)]); + var kind = CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(kindInput); + Assert.IsNotNull(kind); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithEnum", [kind!])); + + // A different (framework) type must not match. + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithEnum", [new CSharpType(typeof(int))])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesNullableEnumParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithNullableEnum(System.Nullable) is suppressed. A nullable + // enum renders as System.Nullable. + var kindInput = InputFactory.Int32Enum("myKind", [("One", 1), ("Two", 2)]); + var nullableKind = CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(new InputNullableType(kindInput)); + Assert.IsNotNull(nullableKind); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithNullableEnum", [nullableKind!])); + + // The non-nullable enum overload is a different signature. + var kind = CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(kindInput); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithNullableEnum", [kind!])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesModelParameter() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithModel(Sample.Models.MyModel) is suppressed. The model's output type is produced + // by the TypeFactory and renders as its fully-qualified name. + var model = CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(InputFactory.Model("myModel")); + Assert.IsNotNull(model); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithModel", [model!])); + + // A different model type must not match. + var otherModel = CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(InputFactory.Model("otherModel")); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithModel", [otherModel!])); + } + + [Test] + public void IsMethodRemovalSuppressedMatchesDictionaryWithModelValue() + { + var baseline = Helpers.GetApiCompatBaselineFromFile(method: "Baseline"); + + // Ns.Types.WithDictionary(Dictionary) is suppressed. The model + // appears as a generic argument and is rendered recursively. + var model = CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(InputFactory.Model("myModel")); + Assert.IsNotNull(model); + var dictionaryOfModel = new CSharpType(typeof(Dictionary<,>), new CSharpType(typeof(string)), model!); + Assert.IsTrue(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithDictionary", [dictionaryOfModel])); + + // A dictionary with a different value type must not match. + var dictionaryOfInt = new CSharpType(typeof(Dictionary<,>), new CSharpType(typeof(string)), new CSharpType(typeof(int))); + Assert.IsFalse(baseline.IsMethodRemovalSuppressed("Ns.Types", "WithDictionary", [dictionaryOfInt])); + } + [Test] public void ReferencesSuppressedTypeMatchesDirectType() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/TestData/ApiCompatBaselineTests/Baseline.txt b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/TestData/ApiCompatBaselineTests/Baseline.txt index f2e71a155c5..725b47e3795 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/TestData/ApiCompatBaselineTests/Baseline.txt +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/SourceInput/TestData/ApiCompatBaselineTests/Baseline.txt @@ -6,3 +6,15 @@ MembersMustExist : Member 'public Ns.Foo..ctor(Ns.Kind, System.String)' does not MembersMustExist : Member 'public Ns.Kind Ns.Foo.Kind.get()' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'public System.Void Ns.Foo.Kind.set(Ns.Kind)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'public System.Void Ns.Foo.Configure(System.Collections.Generic.IDictionary, System.String)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public Ns.Kind Ns.Foo.LegacyField' does not exist in the implementation but it does exist in the contract. +EnumValuesMustMatch : Enum value 'Ns.CapacityLevel Ns.CapacityLevel.FiftyThousand' is (System.Int32)10 in the implementation but (System.Int32)50000 in the contract. +MembersMustExist : Member 'public System.String Ns.Overloads.Get(System.String)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithNullable(System.Nullable)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithArray(System.String[])' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithList(System.Collections.Generic.List)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithNestedGeneric(System.Collections.Generic.IList>)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithMany(System.Int32, System.String, System.Boolean)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithEnum(Sample.Models.MyKind)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithNullableEnum(System.Nullable)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithModel(Sample.Models.MyModel)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Void Ns.Types.WithDictionary(System.Collections.Generic.Dictionary)' does not exist in the implementation but it does exist in the contract. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestTypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestTypeProvider.cs index e142850b002..4b339e7bff4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestTypeProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestTypeProvider.cs @@ -13,6 +13,7 @@ internal class TestTypeProvider : TypeProvider private readonly TypeSignatureModifiers? _declarationModifiers; private readonly MethodProvider[] _methods; private readonly PropertyProvider[] _properties; + private readonly ConstructorProvider[] _constructors; private readonly string _name; private readonly string _namespace; protected override string BuildRelativeFilePath() => $"{Name}.cs"; @@ -24,6 +25,8 @@ internal class TestTypeProvider : TypeProvider protected internal override PropertyProvider[] BuildProperties() => _properties; protected internal override MethodProvider[] BuildMethods() => _methods; + + protected internal override ConstructorProvider[] BuildConstructors() => _constructors; protected override TypeProvider[] BuildNestedTypes() => NestedTypesInternal ?? base.BuildNestedTypes(); public static readonly TypeProvider Empty = new TestTypeProvider(); @@ -33,11 +36,13 @@ internal TestTypeProvider( TypeSignatureModifiers? declarationModifiers = null, IEnumerable? methods = null, IEnumerable? properties = null, - string? ns = null) + string? ns = null, + IEnumerable? constructors = null) { _declarationModifiers = declarationModifiers; _methods = methods?.ToArray() ?? []; _properties = properties?.ToArray() ?? []; + _constructors = constructors?.ToArray() ?? []; _name = name ?? "TestName"; _namespace = ns ?? "Test"; } diff --git a/packages/http-client-csharp/generator/docs/backward-compatibility.md b/packages/http-client-csharp/generator/docs/backward-compatibility.md index 75a6fe512ee..6ca83258649 100644 --- a/packages/http-client-csharp/generator/docs/backward-compatibility.md +++ b/packages/http-client-csharp/generator/docs/backward-compatibility.md @@ -12,6 +12,10 @@ - [New Property Added Together with a Rename](#scenario-new-property-added-together-with-a-rename) - [Model Properties](#model-properties) - [AdditionalProperties Type Preservation](#additionalproperties-type-preservation) + - [Fixed Enum Members](#fixed-enum-members) + - [Explicit (Non-contiguous) Values Preserved](#scenario-explicit-non-contiguous-values-preserved) + - [Removed Integer Enum Member Re-added](#scenario-removed-integer-enum-member-re-added) + - [Baseline-Accepted Removal Honored](#scenario-baseline-accepted-removal-honored) - [API Version Enum](#api-version-enum) - [Non-abstract Base Models](#non-abstract-base-models) - [Model Constructors](#model-constructors) @@ -42,13 +46,14 @@ When generating code, the generator can optionally receive a compiled assembly f Sometimes a breaking change (such as removing a model or a model factory method) is intentional and has already been reviewed and accepted. In the Azure SDK, such accepted breaking changes are recorded in an [ApiCompat](https://github.com/dotnet/sdk/tree/main/src/Compatibility) baseline (suppression) file, conventionally located at `eng/apicompatbaselines/.txt`. -Without awareness of these files, the back-compat system would resurrect every member present in the last contract — re-introducing the very API that was intentionally removed (and potentially referencing types that no longer exist). To prevent this, the generator discovers the baseline file by walking up from the project directory and parses its `TypesMustExist` and `MembersMustExist` suppressions. The back-compat code then consults the baseline in two ways: +Without awareness of these files, the back-compat system would resurrect every member present in the last contract — re-introducing the very API that was intentionally removed (and potentially referencing types that no longer exist). To prevent this, the generator discovers the baseline file by walking up from the project directory and parses its `TypesMustExist`, `MembersMustExist`, and `EnumValuesMustMatch` suppressions. The back-compat code then consults the baseline in the following ways: - **Skipping resurrected members:** before regenerating a compatibility shim for a removed member, it checks whether the removal has been accepted in the baseline (matched by declaring-type full name, member name, and parameter count) and, if so, skips it. - **Allowing property type changes:** the back-compat system normally preserves a property's previous (last-contract) type to avoid a breaking change. When that previous type — or a type nested within it (e.g. the element type of a collection) — has itself been intentionally removed and accepted in the baseline, preserving it would reference a now-deleted type. In that case the generator allows the property to take its current (spec) type instead. +- **Skipping re-added enum members:** before re-adding a fixed enum member that exists in the last contract but was dropped from the current spec, it checks whether that removal — or an accepted value difference recorded as `EnumValuesMustMatch` — has been accepted in the baseline (matched by the declaring enum's fully-qualified name and the member name) and, if so, omits the member. > [!NOTE] -> Baseline awareness is currently wired into the model factory back-compat path (`ModelFactoryProvider`) and the model property type-preservation path (`ModelProvider`). The other back-compat consumers (`ModelProvider` constructors, the enum providers, `ClientProvider`, and `RestClientProvider`) can be made baseline-aware in the same way as a follow-up. +> Baseline awareness is currently wired into the base method back-compat path in `TypeProvider` (the parameter reorder/removal loop, inherited by `ClientProvider` and also used directly by `ModelFactoryProvider`), the model property type-preservation path (`ModelProvider`), and the fixed enum member path (`FixedEnumProvider`). The remaining back-compat consumers (`ModelProvider` constructors and `RestClientProvider`) can be made baseline-aware in the same way as a follow-up. ## Supported Scenarios @@ -363,6 +368,85 @@ public partial class MyModel - For object types, serialization uses `Utf8JsonWriter.WriteObjectValue()` to handle arbitrary values - Binary compatibility is fully maintained - existing client code continues to work without recompilation +### Fixed Enum Members + +Fixed enums (C# `enum` types) preserve their previously shipped members and values by comparing the current spec against the last contract. Because the underlying value of an integer-backed enum member is part of its public API, the generator keeps those values stable across regenerations, aligns member order to the last contract, and re-adds members that were dropped from the current spec. + +> [!NOTE] +> These behaviors apply to **integer-backed** fixed enums (`int`/`long`). + +#### Scenario: Explicit (Non-contiguous) Values Preserved + +**Description:** When an integer enum's members carry explicit, non-contiguous values, the generator preserves each member's exact value from the last contract instead of reassigning positional ordinals. + +**Example:** + +Previous version (GA surface): + +```csharp +public enum CapacityReservationLevel +{ + OneHundred = 100, + TwoHundred = 200, + FiveHundred = 500, +} +``` + +**Generated Result:** The members keep their exact values (`100`, `200`, `500`) rather than being reassigned to `0`, `1`, `2`. + +#### Scenario: Removed Integer Enum Member Re-added + +**Description:** When an integer enum member present in the last contract is dropped from the current spec, the generator re-adds it — at its original position and with its original explicit value — to avoid removing a previously shipped member. + +**Example:** + +Previous version: + +```csharp +public enum SampleEnum +{ + Alpha = 0, + Beta = 1, + Gamma = 2, +} +``` + +Current TypeSpec removes `Beta`: + +```csharp +public enum SampleEnum +{ + Alpha = 0, + Gamma = 2, +} +``` + +**Generated Result:** `Beta` is re-added at its original position with its original value: + +```csharp +public enum SampleEnum +{ + Alpha = 0, + Beta = 1, + Gamma = 2, +} +``` + +**Key Points:** + +- Members shared between the current spec and the last contract are ordered to match the last contract and keep their last-contract values +- New members introduced by the current spec are appended after the last-contract members, keeping their spec values +- The re-added member's underlying value is read from the previously published assembly's metadata (no debug symbols required) + +#### Scenario: Baseline-Accepted Removal Honored + +**Description:** When the removal of an enum member has been intentionally accepted in the [ApiCompat baseline](#apicompat-baseline-awareness) — recorded as a `MembersMustExist` removal or an `EnumValuesMustMatch` value-difference suppression — the generator honors that decision and does **not** re-add the member. + +**Key Points:** + +- Suppressed members are matched by the declaring enum's fully-qualified name and the member name +- This lets a library intentionally drop a previously shipped enum member once the removal is reviewed and recorded in the baseline + ### API Version Enum Service version enums maintain backward compatibility by preserving version values from previous releases. From 8f8d3e53f767c34b32bc39e2cddcbf380f267ddf Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 16:35:10 +0000 Subject: [PATCH 005/249] Cleanup CSharp CODEOWNERS (#11266) ### Changes - Dropped `@ShivangiReja` from the three CSharp entries: - `/packages/http-client-csharp/` - `/docs/samples/client/csharp` - `/website/src/content/docs/docs/emitters/clients/http-client-csharp/` Remaining owners (`@m-nash`, `@JoshLove-msft`, `@jorgerangel-msft`, `@jsquire`, `@joseharriaga`) are unchanged. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f8f844c556a..219fe471303 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -15,9 +15,9 @@ cspell.yaml ###################### # CSharp ###################### -/packages/http-client-csharp/ @m-nash @JoshLove-msft @jorgerangel-msft @jsquire @ShivangiReja @joseharriaga -/docs/samples/client/csharp @JoshLove-msft @jorgerangel-msft @jsquire @ShivangiReja @joseharriaga -/website/src/content/docs/docs/emitters/clients/http-client-csharp/ @JoshLove-msft @jorgerangel-msft @jsquire @ShivangiReja @joseharriaga +/packages/http-client-csharp/ @m-nash @JoshLove-msft @jorgerangel-msft @jsquire @joseharriaga +/docs/samples/client/csharp @JoshLove-msft @jorgerangel-msft @jsquire @joseharriaga +/website/src/content/docs/docs/emitters/clients/http-client-csharp/ @JoshLove-msft @jorgerangel-msft @jsquire @joseharriaga ###################### # Java From 9f8694f3d8b66ba210fa24baf28a5566bac7357d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 10:42:54 -0700 Subject: [PATCH 006/249] Bump TCGC to 0.70.0 for http-client-csharp (#11264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps `@azure-tools/typespec-client-generator-core` to [0.70.0](https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/CHANGELOG.md#0700) and its related dependencies for the `http-client-csharp` package, then regenerates the Spector test projects. ### Dependency updates (`package.json`) - `@azure-tools/typespec-client-generator-core`: `0.69.2` → `0.70.0` - `@azure-tools/typespec-azure-core`: `0.69.0` → `0.70.0` - `@typespec/compiler`, `http`, `openapi`, `json-schema`: `1.13.0` → `1.14.0` - `@typespec/rest`, `sse`, `streams`, `versioning`, `xml`, `library-linter`: `0.83.0` → `0.84.0` - `@azure-tools/azure-http-specs`: `alpha.42` → `alpha.43`; `@typespec/http-specs`: `alpha.38` → `alpha.39`; `spector`: `alpha.25` → `alpha.26`; `spec-api`: `alpha.14` → `alpha.15`; `tspd`: `0.75.0` → `0.76.0` - Peer dependency ranges shifted to the matching `0.70`/`1.14`/`0.84` wave ### Regenerated output - Reran `Generate.ps1` to refresh the Spector test projects. Notable diffs: a new `encode/boolean` spec surfaced by the newer http-specs, plus updates under `encode/duration`, `parameters/query`, and `routes` (new `ExpandParameters`/`RoutesModelFactory`/`Lossy` files, `launchSettings.json` entry). No Chronus changelog entry is included, as `@typespec/http-client-csharp` is not registered in `.chronus/config.yaml`. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Properties/launchSettings.json | 5 + .../http/encode/boolean/Configuration.json | 3 + .../boolean/Encode.Boolean.NuGet.targets | 6 + .../http/encode/boolean/Encode.Boolean.slnx | 3 + .../encode/boolean/src/Encode.Boolean.csproj | 20 + .../boolean/src/Generated/BooleanClient.cs | 27 + .../src/Generated/BooleanClientOptions.cs | 18 + .../src/Generated/BooleanClientSettings.cs | 29 + .../Generated/EncodeBooleanModelFactory.cs | 13 + .../BoolAsStringProperty.Serialization.cs | 38 + .../Generated/Models/BoolAsStringProperty.cs | 17 + .../Generated/Models/EncodeBooleanContext.cs | 14 + .../encode/boolean/src/Generated/Property.cs | 53 + .../Generated/schema/ConfigurationSchema.json | 40 + .../http/encode/boolean/tspCodeModel.json | 1049 +++++++++++ .../duration/src/Generated/DurationClient.cs | 2 + .../encode/duration/src/Generated/Lossy.cs | 37 + .../http/encode/duration/tspCodeModel.json | 265 +++ .../http/parameters/query/tspCodeModel.json | 2 +- .../Models/ExpandParameters.Serialization.cs | 36 + .../src/Generated/Models/ExpandParameters.cs | 15 + .../src/Generated/Models/RoutesContext.cs | 1 + .../QueryParametersQueryExpansionExplode.cs | 9 + .../src/Generated/RoutesModelFactory.cs | 11 + .../Spector/http/routes/tspCodeModel.json | 1000 +++++----- packages/http-client-csharp/package-lock.json | 1601 ++++------------- packages/http-client-csharp/package.json | 52 +- 27 files changed, 2631 insertions(+), 1735 deletions(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.NuGet.targets create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.slnx create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Encode.Boolean.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientSettings.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/EncodeBooleanModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/EncodeBooleanContext.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Property.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/schema/ConfigurationSchema.json create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Lossy.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesModelFactory.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json index 695ba6fdd2a..004ecdd12e8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json @@ -55,6 +55,11 @@ "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.exe" }, + "http-encode-boolean": { + "commandLineArgs": "$(SolutionDir)/TestProjects/Spector/http/encode/boolean -g StubLibraryGenerator", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.exe" + }, "http-encode-bytes": { "commandLineArgs": "$(SolutionDir)/TestProjects/Spector/http/encode/bytes -g StubLibraryGenerator", "commandName": "Executable", diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Configuration.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Configuration.json new file mode 100644 index 00000000000..c4d244dedfa --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Configuration.json @@ -0,0 +1,3 @@ +{ + "package-name": "Encode.Boolean" +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.NuGet.targets b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.NuGet.targets new file mode 100644 index 00000000000..9df53f09f6f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.NuGet.targets @@ -0,0 +1,6 @@ + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.slnx b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.slnx new file mode 100644 index 00000000000..5ec367d84c1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/Encode.Boolean.slnx @@ -0,0 +1,3 @@ + + + diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Encode.Boolean.csproj b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Encode.Boolean.csproj new file mode 100644 index 00000000000..5f2e7713e76 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Encode.Boolean.csproj @@ -0,0 +1,20 @@ + + + This is the Encode.Boolean client library for developing .NET applications with rich experience. + SDK Code Generation Encode.Boolean + 1.0.0-beta.1 + Encode.Boolean + netstandard2.0;net8.0 + latest + true + + + + + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClient.cs new file mode 100644 index 00000000000..74ed7669995 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClient.cs @@ -0,0 +1,27 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Encode.Boolean._Property; + +namespace Encode.Boolean +{ + public partial class BooleanClient + { + public BooleanClient() : this(new Uri("http://localhost:3000"), new BooleanClientOptions()) => throw null; + + internal BooleanClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, BooleanClientOptions options) => throw null; + + public BooleanClient(Uri endpoint, BooleanClientOptions options) : this(null, endpoint, options) => throw null; + + [Experimental("SCME0002")] + public BooleanClient(BooleanClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual Property GetPropertyClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientOptions.cs new file mode 100644 index 00000000000..de3d5035ddb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientOptions.cs @@ -0,0 +1,18 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode.Boolean +{ + public partial class BooleanClientOptions : ClientPipelineOptions + { + public BooleanClientOptions() => throw null; + + [Experimental("SCME0002")] + internal BooleanClientOptions(IConfigurationSection section) : base(section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientSettings.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientSettings.cs new file mode 100644 index 00000000000..de251887b9d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/BooleanClientSettings.cs @@ -0,0 +1,29 @@ +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Configuration; + +namespace Encode.Boolean +{ + [Experimental("SCME0002")] + public partial class BooleanClientSettings : ClientSettings + { + public Uri Endpoint + { + get => throw null; + set => throw null; + } + + public BooleanClientOptions Options + { + get => throw null; + set => throw null; + } + + protected override void BindCore(IConfigurationSection section) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/EncodeBooleanModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/EncodeBooleanModelFactory.cs new file mode 100644 index 00000000000..40a7ca1bd06 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/EncodeBooleanModelFactory.cs @@ -0,0 +1,13 @@ +// + +#nullable disable + +using Encode.Boolean._Property; + +namespace Encode.Boolean +{ + public static partial class EncodeBooleanModelFactory + { + public static BoolAsStringProperty BoolAsStringProperty(bool value = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.Serialization.cs new file mode 100644 index 00000000000..1dba5b02d7c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.Serialization.cs @@ -0,0 +1,38 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Encode.Boolean._Property +{ + public partial class BoolAsStringProperty : IJsonModel + { + internal BoolAsStringProperty() => throw null; + + protected virtual BoolAsStringProperty PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + BoolAsStringProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(BoolAsStringProperty boolAsStringProperty) => throw null; + + public static explicit operator BoolAsStringProperty(ClientResult result) => throw null; + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + BoolAsStringProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual BoolAsStringProperty JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.cs new file mode 100644 index 00000000000..d47220b58a1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/BoolAsStringProperty.cs @@ -0,0 +1,17 @@ +// + +#nullable disable + +namespace Encode.Boolean._Property +{ + public partial class BoolAsStringProperty + { + public BoolAsStringProperty(bool value) => throw null; + + public bool Value + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/EncodeBooleanContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/EncodeBooleanContext.cs new file mode 100644 index 00000000000..c7978841308 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Models/EncodeBooleanContext.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; +using Encode.Boolean._Property; + +namespace Encode.Boolean +{ + [ModelReaderWriterBuildable(typeof(BoolAsStringProperty))] + public partial class EncodeBooleanContext : ModelReaderWriterContext + { + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Property.cs new file mode 100644 index 00000000000..6c997cd998b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/Property.cs @@ -0,0 +1,53 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Encode.Boolean._Property +{ + public partial class Property + { + protected Property() => throw null; + + internal Property(ClientPipeline pipeline, Uri endpoint) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult TrueLower(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task TrueLowerAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult TrueLower(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> TrueLowerAsync(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult FalseLower(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task FalseLowerAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult FalseLower(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> FalseLowerAsync(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult TrueUpper(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task TrueUpperAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult TrueUpper(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> TrueUpperAsync(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult FalseMixed(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task FalseMixedAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult FalseMixed(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + + public virtual Task> FalseMixedAsync(BoolAsStringProperty value, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/schema/ConfigurationSchema.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/schema/ConfigurationSchema.json new file mode 100644 index 00000000000..9abf69e0ecc --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Generated/schema/ConfigurationSchema.json @@ -0,0 +1,40 @@ +{ + "type": "object", + "properties": { + "Clients": { + "type": "object", + "properties": { + "BooleanClient": { + "type": "object", + "description": "Configuration for BooleanClient.", + "properties": { + "Endpoint": { + "type": "string", + "format": "uri", + "description": "Gets or sets the Endpoint." + }, + "Credential": { + "$ref": "#/definitions/credential" + }, + "Options": { + "$ref": "#/definitions/booleanClientOptions" + } + } + } + }, + "additionalProperties": { + "type": "object", + "description": "Configuration for a named client instance." + } + } + }, + "definitions": { + "booleanClientOptions": { + "allOf": [ + { + "$ref": "#/definitions/options" + } + ] + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/tspCodeModel.json new file mode 100644 index 00000000000..96237842dd7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/tspCodeModel.json @@ -0,0 +1,1049 @@ +{ + "name": "Encode.Boolean", + "apiVersions": [], + "enums": [], + "constants": [ + { + "$id": "1", + "kind": "constant", + "name": "TrueLowerContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "2", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "3", + "kind": "constant", + "name": "TrueLowerContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "4", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "5", + "kind": "constant", + "name": "TrueLowerContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "6", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "7", + "kind": "constant", + "name": "TrueLowerContentType3", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "8", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "9", + "kind": "constant", + "name": "TrueLowerContentType4", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "11", + "kind": "constant", + "name": "TrueLowerContentType5", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "13", + "kind": "constant", + "name": "TrueLowerContentType6", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + }, + { + "$id": "15", + "kind": "constant", + "name": "TrueLowerContentType7", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [], + "isExactName": false + } + ], + "models": [ + { + "$id": "17", + "kind": "model", + "name": "BoolAsStringProperty", + "namespace": "Encode.Boolean.Property", + "crossLanguageDefinitionId": "Encode.Boolean.Property.BoolAsStringProperty", + "usage": "Input,Output,Json", + "decorators": [], + "serializationOptions": { + "json": { + "name": "BoolAsStringProperty" + } + }, + "isExactName": false, + "properties": [ + { + "$id": "18", + "kind": "property", + "name": "value", + "serializedName": "value", + "type": { + "$id": "19", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.BoolAsStringProperty.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false, + "isExactName": false + } + ] + } + ], + "clients": [ + { + "$id": "20", + "kind": "client", + "name": "BooleanClient", + "isExactName": false, + "namespace": "Encode.Boolean", + "doc": "Test for encode decorator on boolean.", + "methods": [], + "parameters": [ + { + "$id": "21", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "22", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Boolean.endpoint", + "isExactName": false + } + ], + "initializedBy": 1, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean", + "apiVersions": [], + "children": [ + { + "$id": "24", + "kind": "client", + "name": "Property", + "isExactName": false, + "namespace": "Encode.Boolean.Property", + "methods": [ + { + "$id": "25", + "kind": "basic", + "name": "trueLower", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "26", + "name": "trueLower", + "isExactName": false, + "resourceName": "Property", + "accessibility": "public", + "parameters": [ + { + "$id": "27", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "1" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower.contentType", + "methodParameterSegments": [ + { + "$id": "28", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "1" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "29", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "3" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower.accept", + "methodParameterSegments": [ + { + "$id": "30", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "3" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "31", + "kind": "body", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower.value", + "methodParameterSegments": [ + { + "$id": "32", + "kind": "method", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower.value", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "value" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "17" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/encode/boolean/property/true-lower", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower", + "decorators": [], + "namespace": "Encode.Boolean.Property" + }, + "parameters": [ + { + "$ref": "32" + }, + { + "$ref": "28" + }, + { + "$ref": "30" + } + ], + "response": { + "type": { + "$ref": "17" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueLower" + }, + { + "$id": "33", + "kind": "basic", + "name": "falseLower", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "34", + "name": "falseLower", + "isExactName": false, + "resourceName": "Property", + "accessibility": "public", + "parameters": [ + { + "$id": "35", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "5" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower.contentType", + "methodParameterSegments": [ + { + "$id": "36", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "5" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "37", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "7" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower.accept", + "methodParameterSegments": [ + { + "$id": "38", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "7" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "39", + "kind": "body", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower.value", + "methodParameterSegments": [ + { + "$id": "40", + "kind": "method", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower.value", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "value" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "17" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/encode/boolean/property/false-lower", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower", + "decorators": [], + "namespace": "Encode.Boolean.Property" + }, + "parameters": [ + { + "$ref": "40" + }, + { + "$ref": "36" + }, + { + "$ref": "38" + } + ], + "response": { + "type": { + "$ref": "17" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseLower" + }, + { + "$id": "41", + "kind": "basic", + "name": "trueUpper", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "42", + "name": "trueUpper", + "isExactName": false, + "resourceName": "Property", + "accessibility": "public", + "parameters": [ + { + "$id": "43", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "9" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper.contentType", + "methodParameterSegments": [ + { + "$id": "44", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "9" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "45", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "11" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper.accept", + "methodParameterSegments": [ + { + "$id": "46", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "11" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "47", + "kind": "body", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper.value", + "methodParameterSegments": [ + { + "$id": "48", + "kind": "method", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper.value", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "value" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "17" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/encode/boolean/property/true-upper", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper", + "decorators": [], + "namespace": "Encode.Boolean.Property" + }, + "parameters": [ + { + "$ref": "48" + }, + { + "$ref": "44" + }, + { + "$ref": "46" + } + ], + "response": { + "type": { + "$ref": "17" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.trueUpper" + }, + { + "$id": "49", + "kind": "basic", + "name": "falseMixed", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "50", + "name": "falseMixed", + "isExactName": false, + "resourceName": "Property", + "accessibility": "public", + "parameters": [ + { + "$id": "51", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "13" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed.contentType", + "methodParameterSegments": [ + { + "$id": "52", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "13" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed.contentType", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "53", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "15" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed.accept", + "methodParameterSegments": [ + { + "$id": "54", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "15" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed.accept", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + }, + { + "$id": "55", + "kind": "body", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed.value", + "methodParameterSegments": [ + { + "$id": "56", + "kind": "method", + "name": "value", + "serializedName": "value", + "type": { + "$ref": "17" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed.value", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false, + "serializationOptions": { + "json": { + "name": "value" + } + } + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "17" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ], + "serializationOptions": { + "json": { + "name": "" + } + } + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/encode/boolean/property/false-mixed", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed", + "decorators": [], + "namespace": "Encode.Boolean.Property" + }, + "parameters": [ + { + "$ref": "56" + }, + { + "$ref": "52" + }, + { + "$ref": "54" + } + ], + "response": { + "type": { + "$ref": "17" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Encode.Boolean.Property.falseMixed" + } + ], + "parameters": [ + { + "$id": "57", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "58", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Boolean.Property.endpoint", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Boolean.Property", + "apiVersions": [], + "parent": { + "$ref": "20" + }, + "isMultiServiceClient": false + } + ], + "isMultiServiceClient": false + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs index efdd9208ab4..ebaf1be19c9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/DurationClient.cs @@ -29,5 +29,7 @@ public partial class DurationClient public virtual Property GetPropertyClient() => throw null; public virtual Header GetHeaderClient() => throw null; + + public virtual Lossy GetLossyClient() => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Lossy.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Lossy.cs new file mode 100644 index 00000000000..0fb59d8a519 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Generated/Lossy.cs @@ -0,0 +1,37 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Encode.Duration +{ + public partial class Lossy + { + protected Lossy() => throw null; + + internal Lossy(ClientPipeline pipeline, Uri endpoint) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult IntSeconds(TimeSpan input, RequestOptions options) => throw null; + + public virtual Task IntSecondsAsync(TimeSpan input, RequestOptions options) => throw null; + + public virtual ClientResult IntSeconds(TimeSpan input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task IntSecondsAsync(TimeSpan input, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult IntMilliseconds(TimeSpan input, RequestOptions options) => throw null; + + public virtual Task IntMillisecondsAsync(TimeSpan input, RequestOptions options) => throw null; + + public virtual ClientResult IntMilliseconds(TimeSpan input, CancellationToken cancellationToken = default) => throw null; + + public virtual Task IntMillisecondsAsync(TimeSpan input, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json index 080f7f7843e..23c7bd285d7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/tspCodeModel.json @@ -7138,6 +7138,271 @@ "$ref": "119" }, "isMultiServiceClient": false + }, + { + "$id": "475", + "kind": "client", + "name": "Lossy", + "isExactName": false, + "namespace": "Encode.Duration", + "doc": "Lossy encode scenarios.\n\nThese scenarios cover the case where the source `duration` carries more precision than the\ntarget encoding can represent (e.g. a sub-second value encoded as integer seconds). The client\nmust still serialize the value using the target number type (an integer), discarding the extra\nprecision, rather than emitting a floating point number. This is distinct from arbitrary type\nmismatches, which are already covered by the round-trip scenarios above.", + "methods": [ + { + "$id": "476", + "kind": "basic", + "name": "intSeconds", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "477", + "name": "intSeconds", + "isExactName": false, + "resourceName": "Lossy", + "accessibility": "public", + "parameters": [ + { + "$id": "478", + "kind": "query", + "name": "input", + "serializedName": "input", + "type": { + "$id": "479", + "kind": "duration", + "name": "duration", + "encode": "seconds", + "wireType": { + "$id": "480", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intSeconds.input", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "481", + "kind": "method", + "name": "input", + "serializedName": "input", + "type": { + "$id": "482", + "kind": "duration", + "name": "duration", + "encode": "seconds", + "wireType": { + "$id": "483", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intSeconds.input", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/encode/duration/lossy/int32-seconds", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intSeconds", + "decorators": [], + "namespace": "Encode.Duration" + }, + "parameters": [ + { + "$ref": "481" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intSeconds" + }, + { + "$id": "484", + "kind": "basic", + "name": "intMilliseconds", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "485", + "name": "intMilliseconds", + "isExactName": false, + "resourceName": "Lossy", + "accessibility": "public", + "parameters": [ + { + "$id": "486", + "kind": "query", + "name": "input", + "serializedName": "input", + "type": { + "$id": "487", + "kind": "duration", + "name": "duration", + "encode": "milliseconds", + "wireType": { + "$id": "488", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intMilliseconds.input", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "489", + "kind": "method", + "name": "input", + "serializedName": "input", + "type": { + "$id": "490", + "kind": "duration", + "name": "duration", + "encode": "milliseconds", + "wireType": { + "$id": "491", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.duration", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intMilliseconds.input", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/encode/duration/lossy/int32-milliseconds", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intMilliseconds", + "decorators": [], + "namespace": "Encode.Duration" + }, + "parameters": [ + { + "$ref": "489" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Encode.Duration.Lossy.intMilliseconds" + } + ], + "parameters": [ + { + "$id": "492", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "493", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "http://localhost:3000" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Encode.Duration.Lossy.endpoint", + "isExactName": false + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "Encode.Duration.Lossy", + "apiVersions": [], + "parent": { + "$ref": "119" + }, + "isMultiServiceClient": false } ], "isMultiServiceClient": false diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/tspCodeModel.json index 93d44df48b3..60b5e392f5c 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/tspCodeModel.json @@ -302,7 +302,7 @@ ], "httpMethod": "GET", "uri": "{endpoint}", - "path": "/parameters/query/special-char/dollarSign", + "path": "/parameters/query/special-char/dollar-sign", "bufferResponse": true, "generateProtocolMethod": true, "generateConvenienceMethod": true, diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.Serialization.cs new file mode 100644 index 00000000000..8f0d3bce135 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Routes +{ + public partial class ExpandParameters : IJsonModel + { + internal ExpandParameters() => throw null; + + protected virtual ExpandParameters PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + ExpandParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ExpandParameters expandParameters) => throw null; + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ExpandParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ExpandParameters JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.cs new file mode 100644 index 00000000000..48320a0364b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/ExpandParameters.cs @@ -0,0 +1,15 @@ +// + +#nullable disable + +namespace Routes +{ + public partial class ExpandParameters + { + public ExpandParameters(string @field, string value) => throw null; + + public string Field => throw null; + + public string Value => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/RoutesContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/RoutesContext.cs index 43932f5502c..ac26202d311 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/RoutesContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/Models/RoutesContext.cs @@ -6,6 +6,7 @@ namespace Routes { + [ModelReaderWriterBuildable(typeof(ExpandParameters))] public partial class RoutesContext : ModelReaderWriterContext { } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs index e8989434a9d..4fcbfdf9f58 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Routes; namespace Routes._QueryParameters.QueryExpansion.Explode { @@ -42,5 +43,13 @@ public partial class QueryParametersQueryExpansionExplode public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null; public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult Model(ExpandParameters @param, RequestOptions options) => throw null; + + public virtual Task ModelAsync(ExpandParameters @param, RequestOptions options) => throw null; + + public virtual ClientResult Model(ExpandParameters @param, CancellationToken cancellationToken = default) => throw null; + + public virtual Task ModelAsync(ExpandParameters @param, CancellationToken cancellationToken = default) => throw null; } } diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesModelFactory.cs new file mode 100644 index 00000000000..43dad9a54be --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Generated/RoutesModelFactory.cs @@ -0,0 +1,11 @@ +// + +#nullable disable + +namespace Routes +{ + public static partial class RoutesModelFactory + { + public static ExpandParameters ExpandParameters(string @field = default, string value = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/tspCodeModel.json index ff2b3abfb4b..48f41c3f17f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/routes/tspCodeModel.json @@ -3,10 +3,67 @@ "apiVersions": [], "enums": [], "constants": [], - "models": [], - "clients": [ + "models": [ { "$id": "1", + "kind": "model", + "name": "ExpandParameters", + "namespace": "Routes", + "crossLanguageDefinitionId": "Routes.ExpandParameters", + "usage": "Input", + "doc": "A named model used to verify explode expansion of a model-valued query parameter.", + "decorators": [], + "serializationOptions": {}, + "isExactName": false, + "properties": [ + { + "$id": "2", + "kind": "property", + "name": "field", + "type": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Routes.ExpandParameters.field", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + }, + { + "$id": "4", + "kind": "property", + "name": "value", + "type": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Routes.ExpandParameters.value", + "serializationOptions": {}, + "isHttpMetadata": false, + "isExactName": false + } + ] + } + ], + "clients": [ + { + "$id": "6", "kind": "client", "name": "RoutesClient", "isExactName": false, @@ -14,14 +71,14 @@ "doc": "Define scenario in building the http route/uri", "methods": [ { - "$id": "2", + "$id": "7", "kind": "basic", "name": "fixed", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "3", + "$id": "8", "name": "fixed", "isExactName": false, "resourceName": "Routes", @@ -57,13 +114,13 @@ ], "parameters": [ { - "$id": "4", + "$id": "9", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "5", + "$id": "10", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -74,7 +131,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "6", + "$id": "11", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -94,33 +151,33 @@ "apiVersions": [], "children": [ { - "$id": "7", + "$id": "12", "kind": "client", "name": "PathParameters", "isExactName": false, "namespace": "Routes.PathParameters", "methods": [ { - "$id": "8", + "$id": "13", "kind": "basic", "name": "templateOnly", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "9", + "$id": "14", "name": "templateOnly", "isExactName": false, "resourceName": "PathParameters", "accessibility": "public", "parameters": [ { - "$id": "10", + "$id": "15", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "11", + "$id": "16", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -138,12 +195,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.templateOnly.param", "methodParameterSegments": [ { - "$id": "12", + "$id": "17", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "13", + "$id": "18", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -185,7 +242,7 @@ }, "parameters": [ { - "$ref": "12" + "$ref": "17" } ], "response": {}, @@ -195,26 +252,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.templateOnly" }, { - "$id": "14", + "$id": "19", "kind": "basic", "name": "explicit", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "15", + "$id": "20", "name": "explicit", "isExactName": false, "resourceName": "PathParameters", "accessibility": "public", "parameters": [ { - "$id": "16", + "$id": "21", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "17", + "$id": "22", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -232,12 +289,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.explicit.param", "methodParameterSegments": [ { - "$id": "18", + "$id": "23", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "19", + "$id": "24", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -279,7 +336,7 @@ }, "parameters": [ { - "$ref": "18" + "$ref": "23" } ], "response": {}, @@ -289,26 +346,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.explicit" }, { - "$id": "20", + "$id": "25", "kind": "basic", "name": "annotationOnly", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "21", + "$id": "26", "name": "annotationOnly", "isExactName": false, "resourceName": "PathParameters", "accessibility": "public", "parameters": [ { - "$id": "22", + "$id": "27", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "23", + "$id": "28", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -326,12 +383,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.annotationOnly.param", "methodParameterSegments": [ { - "$id": "24", + "$id": "29", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "25", + "$id": "30", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -373,7 +430,7 @@ }, "parameters": [ { - "$ref": "24" + "$ref": "29" } ], "response": {}, @@ -385,13 +442,13 @@ ], "parameters": [ { - "$id": "26", + "$id": "31", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "27", + "$id": "32", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -402,7 +459,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "28", + "$id": "33", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -421,37 +478,37 @@ "crossLanguageDefinitionId": "Routes.PathParameters", "apiVersions": [], "parent": { - "$ref": "1" + "$ref": "6" }, "children": [ { - "$id": "29", + "$id": "34", "kind": "client", "name": "ReservedExpansion", "isExactName": false, "namespace": "Routes.PathParameters.ReservedExpansion", "methods": [ { - "$id": "30", + "$id": "35", "kind": "basic", "name": "template", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "31", + "$id": "36", "name": "template", "isExactName": false, "resourceName": "ReservedExpansion", "accessibility": "public", "parameters": [ { - "$id": "32", + "$id": "37", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "33", + "$id": "38", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -469,12 +526,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.ReservedExpansion.template.param", "methodParameterSegments": [ { - "$id": "34", + "$id": "39", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "35", + "$id": "40", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -516,7 +573,7 @@ }, "parameters": [ { - "$ref": "34" + "$ref": "39" } ], "response": {}, @@ -526,26 +583,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.ReservedExpansion.template" }, { - "$id": "36", + "$id": "41", "kind": "basic", "name": "annotation", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "37", + "$id": "42", "name": "annotation", "isExactName": false, "resourceName": "ReservedExpansion", "accessibility": "public", "parameters": [ { - "$id": "38", + "$id": "43", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "39", + "$id": "44", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -563,12 +620,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.ReservedExpansion.annotation.param", "methodParameterSegments": [ { - "$id": "40", + "$id": "45", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "41", + "$id": "46", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -610,7 +667,7 @@ }, "parameters": [ { - "$ref": "40" + "$ref": "45" } ], "response": {}, @@ -622,13 +679,13 @@ ], "parameters": [ { - "$id": "42", + "$id": "47", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "43", + "$id": "48", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -639,7 +696,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "44", + "$id": "49", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -658,12 +715,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.ReservedExpansion", "apiVersions": [], "parent": { - "$ref": "7" + "$ref": "12" }, "isMultiServiceClient": false }, { - "$id": "45", + "$id": "50", "kind": "client", "name": "SimpleExpansion", "isExactName": false, @@ -671,13 +728,13 @@ "methods": [], "parameters": [ { - "$id": "46", + "$id": "51", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "47", + "$id": "52", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -688,7 +745,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "48", + "$id": "53", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -707,37 +764,37 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion", "apiVersions": [], "parent": { - "$ref": "7" + "$ref": "12" }, "children": [ { - "$id": "49", + "$id": "54", "kind": "client", "name": "Standard", "isExactName": false, "namespace": "Routes.PathParameters.SimpleExpansion.Standard", "methods": [ { - "$id": "50", + "$id": "55", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "51", + "$id": "56", "name": "primitive", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "52", + "$id": "57", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "53", + "$id": "58", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -755,12 +812,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.primitive.param", "methodParameterSegments": [ { - "$id": "54", + "$id": "59", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "55", + "$id": "60", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -802,7 +859,7 @@ }, "parameters": [ { - "$ref": "54" + "$ref": "59" } ], "response": {}, @@ -812,30 +869,30 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.primitive" }, { - "$id": "56", + "$id": "61", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "57", + "$id": "62", "name": "array", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "58", + "$id": "63", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "59", + "$id": "64", "kind": "array", "name": "Array", "valueType": { - "$id": "60", + "$id": "65", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -856,12 +913,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.array.param", "methodParameterSegments": [ { - "$id": "61", + "$id": "66", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -899,7 +956,7 @@ }, "parameters": [ { - "$ref": "61" + "$ref": "66" } ], "response": {}, @@ -909,36 +966,36 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.array" }, { - "$id": "62", + "$id": "67", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "63", + "$id": "68", "name": "record", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "64", + "$id": "69", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "65", + "$id": "70", "kind": "dict", "keyType": { - "$id": "66", + "$id": "71", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", "decorators": [] }, "valueType": { - "$id": "67", + "$id": "72", "kind": "int32", "name": "int32", "crossLanguageDefinitionId": "TypeSpec.int32", @@ -958,12 +1015,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard.record.param", "methodParameterSegments": [ { - "$id": "68", + "$id": "73", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -1001,7 +1058,7 @@ }, "parameters": [ { - "$ref": "68" + "$ref": "73" } ], "response": {}, @@ -1013,13 +1070,13 @@ ], "parameters": [ { - "$id": "69", + "$id": "74", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "70", + "$id": "75", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -1030,7 +1087,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "71", + "$id": "76", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -1049,38 +1106,38 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Standard", "apiVersions": [], "parent": { - "$ref": "45" + "$ref": "50" }, "isMultiServiceClient": false }, { - "$id": "72", + "$id": "77", "kind": "client", "name": "Explode", "isExactName": false, "namespace": "Routes.PathParameters.SimpleExpansion.Explode", "methods": [ { - "$id": "73", + "$id": "78", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "74", + "$id": "79", "name": "primitive", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "75", + "$id": "80", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "76", + "$id": "81", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1098,12 +1155,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.primitive.param", "methodParameterSegments": [ { - "$id": "77", + "$id": "82", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "78", + "$id": "83", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1145,7 +1202,7 @@ }, "parameters": [ { - "$ref": "77" + "$ref": "82" } ], "response": {}, @@ -1155,26 +1212,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.primitive" }, { - "$id": "79", + "$id": "84", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "80", + "$id": "85", "name": "array", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "81", + "$id": "86", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": true, @@ -1188,12 +1245,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.array.param", "methodParameterSegments": [ { - "$id": "82", + "$id": "87", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -1231,7 +1288,7 @@ }, "parameters": [ { - "$ref": "82" + "$ref": "87" } ], "response": {}, @@ -1241,26 +1298,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.array" }, { - "$id": "83", + "$id": "88", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "84", + "$id": "89", "name": "record", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "85", + "$id": "90", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": true, @@ -1274,12 +1331,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode.record.param", "methodParameterSegments": [ { - "$id": "86", + "$id": "91", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -1317,7 +1374,7 @@ }, "parameters": [ { - "$ref": "86" + "$ref": "91" } ], "response": {}, @@ -1329,13 +1386,13 @@ ], "parameters": [ { - "$id": "87", + "$id": "92", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "88", + "$id": "93", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -1346,7 +1403,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "89", + "$id": "94", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -1365,7 +1422,7 @@ "crossLanguageDefinitionId": "Routes.PathParameters.SimpleExpansion.Explode", "apiVersions": [], "parent": { - "$ref": "45" + "$ref": "50" }, "isMultiServiceClient": false } @@ -1373,7 +1430,7 @@ "isMultiServiceClient": false }, { - "$id": "90", + "$id": "95", "kind": "client", "name": "PathExpansion", "isExactName": false, @@ -1381,13 +1438,13 @@ "methods": [], "parameters": [ { - "$id": "91", + "$id": "96", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "92", + "$id": "97", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -1398,7 +1455,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "93", + "$id": "98", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -1417,37 +1474,37 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion", "apiVersions": [], "parent": { - "$ref": "7" + "$ref": "12" }, "children": [ { - "$id": "94", + "$id": "99", "kind": "client", "name": "Standard", "isExactName": false, "namespace": "Routes.PathParameters.PathExpansion.Standard", "methods": [ { - "$id": "95", + "$id": "100", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "96", + "$id": "101", "name": "primitive", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "97", + "$id": "102", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "98", + "$id": "103", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1465,12 +1522,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.primitive.param", "methodParameterSegments": [ { - "$id": "99", + "$id": "104", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "100", + "$id": "105", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1512,7 +1569,7 @@ }, "parameters": [ { - "$ref": "99" + "$ref": "104" } ], "response": {}, @@ -1522,26 +1579,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.primitive" }, { - "$id": "101", + "$id": "106", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "102", + "$id": "107", "name": "array", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "103", + "$id": "108", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": false, @@ -1555,12 +1612,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.array.param", "methodParameterSegments": [ { - "$id": "104", + "$id": "109", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -1598,7 +1655,7 @@ }, "parameters": [ { - "$ref": "104" + "$ref": "109" } ], "response": {}, @@ -1608,26 +1665,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.array" }, { - "$id": "105", + "$id": "110", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "106", + "$id": "111", "name": "record", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "107", + "$id": "112", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": false, @@ -1641,12 +1698,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard.record.param", "methodParameterSegments": [ { - "$id": "108", + "$id": "113", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -1684,7 +1741,7 @@ }, "parameters": [ { - "$ref": "108" + "$ref": "113" } ], "response": {}, @@ -1696,13 +1753,13 @@ ], "parameters": [ { - "$id": "109", + "$id": "114", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "110", + "$id": "115", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -1713,7 +1770,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "111", + "$id": "116", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -1732,38 +1789,38 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Standard", "apiVersions": [], "parent": { - "$ref": "90" + "$ref": "95" }, "isMultiServiceClient": false }, { - "$id": "112", + "$id": "117", "kind": "client", "name": "Explode", "isExactName": false, "namespace": "Routes.PathParameters.PathExpansion.Explode", "methods": [ { - "$id": "113", + "$id": "118", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "114", + "$id": "119", "name": "primitive", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "115", + "$id": "120", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "116", + "$id": "121", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1781,12 +1838,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.primitive.param", "methodParameterSegments": [ { - "$id": "117", + "$id": "122", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "118", + "$id": "123", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -1828,7 +1885,7 @@ }, "parameters": [ { - "$ref": "117" + "$ref": "122" } ], "response": {}, @@ -1838,26 +1895,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.primitive" }, { - "$id": "119", + "$id": "124", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "120", + "$id": "125", "name": "array", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "121", + "$id": "126", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": true, @@ -1871,12 +1928,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.array.param", "methodParameterSegments": [ { - "$id": "122", + "$id": "127", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -1914,7 +1971,7 @@ }, "parameters": [ { - "$ref": "122" + "$ref": "127" } ], "response": {}, @@ -1924,26 +1981,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.array" }, { - "$id": "123", + "$id": "128", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "124", + "$id": "129", "name": "record", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "125", + "$id": "130", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": true, @@ -1957,12 +2014,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode.record.param", "methodParameterSegments": [ { - "$id": "126", + "$id": "131", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -2000,7 +2057,7 @@ }, "parameters": [ { - "$ref": "126" + "$ref": "131" } ], "response": {}, @@ -2012,13 +2069,13 @@ ], "parameters": [ { - "$id": "127", + "$id": "132", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "128", + "$id": "133", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2029,7 +2086,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "129", + "$id": "134", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2048,7 +2105,7 @@ "crossLanguageDefinitionId": "Routes.PathParameters.PathExpansion.Explode", "apiVersions": [], "parent": { - "$ref": "90" + "$ref": "95" }, "isMultiServiceClient": false } @@ -2056,7 +2113,7 @@ "isMultiServiceClient": false }, { - "$id": "130", + "$id": "135", "kind": "client", "name": "LabelExpansion", "isExactName": false, @@ -2064,13 +2121,13 @@ "methods": [], "parameters": [ { - "$id": "131", + "$id": "136", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "132", + "$id": "137", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2081,7 +2138,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "133", + "$id": "138", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2100,37 +2157,37 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion", "apiVersions": [], "parent": { - "$ref": "7" + "$ref": "12" }, "children": [ { - "$id": "134", + "$id": "139", "kind": "client", "name": "Standard", "isExactName": false, "namespace": "Routes.PathParameters.LabelExpansion.Standard", "methods": [ { - "$id": "135", + "$id": "140", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "136", + "$id": "141", "name": "primitive", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "137", + "$id": "142", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "138", + "$id": "143", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2148,12 +2205,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.primitive.param", "methodParameterSegments": [ { - "$id": "139", + "$id": "144", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "140", + "$id": "145", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2195,7 +2252,7 @@ }, "parameters": [ { - "$ref": "139" + "$ref": "144" } ], "response": {}, @@ -2205,26 +2262,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.primitive" }, { - "$id": "141", + "$id": "146", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "142", + "$id": "147", "name": "array", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "143", + "$id": "148", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": false, @@ -2238,12 +2295,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.array.param", "methodParameterSegments": [ { - "$id": "144", + "$id": "149", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -2281,7 +2338,7 @@ }, "parameters": [ { - "$ref": "144" + "$ref": "149" } ], "response": {}, @@ -2291,26 +2348,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.array" }, { - "$id": "145", + "$id": "150", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "146", + "$id": "151", "name": "record", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "147", + "$id": "152", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": false, @@ -2324,12 +2381,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard.record.param", "methodParameterSegments": [ { - "$id": "148", + "$id": "153", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -2367,7 +2424,7 @@ }, "parameters": [ { - "$ref": "148" + "$ref": "153" } ], "response": {}, @@ -2379,13 +2436,13 @@ ], "parameters": [ { - "$id": "149", + "$id": "154", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "150", + "$id": "155", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2396,7 +2453,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "151", + "$id": "156", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2415,38 +2472,38 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Standard", "apiVersions": [], "parent": { - "$ref": "130" + "$ref": "135" }, "isMultiServiceClient": false }, { - "$id": "152", + "$id": "157", "kind": "client", "name": "Explode", "isExactName": false, "namespace": "Routes.PathParameters.LabelExpansion.Explode", "methods": [ { - "$id": "153", + "$id": "158", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "154", + "$id": "159", "name": "primitive", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "155", + "$id": "160", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "156", + "$id": "161", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2464,12 +2521,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.primitive.param", "methodParameterSegments": [ { - "$id": "157", + "$id": "162", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "158", + "$id": "163", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2511,7 +2568,7 @@ }, "parameters": [ { - "$ref": "157" + "$ref": "162" } ], "response": {}, @@ -2521,26 +2578,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.primitive" }, { - "$id": "159", + "$id": "164", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "160", + "$id": "165", "name": "array", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "161", + "$id": "166", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": true, @@ -2554,12 +2611,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.array.param", "methodParameterSegments": [ { - "$id": "162", + "$id": "167", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -2597,7 +2654,7 @@ }, "parameters": [ { - "$ref": "162" + "$ref": "167" } ], "response": {}, @@ -2607,26 +2664,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.array" }, { - "$id": "163", + "$id": "168", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "164", + "$id": "169", "name": "record", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "165", + "$id": "170", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": true, @@ -2640,12 +2697,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode.record.param", "methodParameterSegments": [ { - "$id": "166", + "$id": "171", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -2683,7 +2740,7 @@ }, "parameters": [ { - "$ref": "166" + "$ref": "171" } ], "response": {}, @@ -2695,13 +2752,13 @@ ], "parameters": [ { - "$id": "167", + "$id": "172", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "168", + "$id": "173", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2712,7 +2769,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "169", + "$id": "174", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2731,7 +2788,7 @@ "crossLanguageDefinitionId": "Routes.PathParameters.LabelExpansion.Explode", "apiVersions": [], "parent": { - "$ref": "130" + "$ref": "135" }, "isMultiServiceClient": false } @@ -2739,7 +2796,7 @@ "isMultiServiceClient": false }, { - "$id": "170", + "$id": "175", "kind": "client", "name": "MatrixExpansion", "isExactName": false, @@ -2747,13 +2804,13 @@ "methods": [], "parameters": [ { - "$id": "171", + "$id": "176", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "172", + "$id": "177", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -2764,7 +2821,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "173", + "$id": "178", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -2783,37 +2840,37 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion", "apiVersions": [], "parent": { - "$ref": "7" + "$ref": "12" }, "children": [ { - "$id": "174", + "$id": "179", "kind": "client", "name": "Standard", "isExactName": false, "namespace": "Routes.PathParameters.MatrixExpansion.Standard", "methods": [ { - "$id": "175", + "$id": "180", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "176", + "$id": "181", "name": "primitive", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "177", + "$id": "182", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "178", + "$id": "183", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2831,12 +2888,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.primitive.param", "methodParameterSegments": [ { - "$id": "179", + "$id": "184", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "180", + "$id": "185", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -2878,7 +2935,7 @@ }, "parameters": [ { - "$ref": "179" + "$ref": "184" } ], "response": {}, @@ -2888,26 +2945,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.primitive" }, { - "$id": "181", + "$id": "186", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "182", + "$id": "187", "name": "array", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "183", + "$id": "188", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": false, @@ -2921,12 +2978,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.array.param", "methodParameterSegments": [ { - "$id": "184", + "$id": "189", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -2964,7 +3021,7 @@ }, "parameters": [ { - "$ref": "184" + "$ref": "189" } ], "response": {}, @@ -2974,26 +3031,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.array" }, { - "$id": "185", + "$id": "190", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "186", + "$id": "191", "name": "record", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "187", + "$id": "192", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": false, @@ -3007,12 +3064,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard.record.param", "methodParameterSegments": [ { - "$id": "188", + "$id": "193", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -3050,7 +3107,7 @@ }, "parameters": [ { - "$ref": "188" + "$ref": "193" } ], "response": {}, @@ -3062,13 +3119,13 @@ ], "parameters": [ { - "$id": "189", + "$id": "194", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "190", + "$id": "195", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3079,7 +3136,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "191", + "$id": "196", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3098,38 +3155,38 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Standard", "apiVersions": [], "parent": { - "$ref": "170" + "$ref": "175" }, "isMultiServiceClient": false }, { - "$id": "192", + "$id": "197", "kind": "client", "name": "Explode", "isExactName": false, "namespace": "Routes.PathParameters.MatrixExpansion.Explode", "methods": [ { - "$id": "193", + "$id": "198", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "194", + "$id": "199", "name": "primitive", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "195", + "$id": "200", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$id": "196", + "$id": "201", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3147,12 +3204,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.primitive.param", "methodParameterSegments": [ { - "$id": "197", + "$id": "202", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "198", + "$id": "203", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3194,7 +3251,7 @@ }, "parameters": [ { - "$ref": "197" + "$ref": "202" } ], "response": {}, @@ -3204,26 +3261,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.primitive" }, { - "$id": "199", + "$id": "204", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "200", + "$id": "205", "name": "array", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "201", + "$id": "206", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": true, @@ -3237,12 +3294,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.array.param", "methodParameterSegments": [ { - "$id": "202", + "$id": "207", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Path", "isApiVersion": false, @@ -3280,7 +3337,7 @@ }, "parameters": [ { - "$ref": "202" + "$ref": "207" } ], "response": {}, @@ -3290,26 +3347,26 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.array" }, { - "$id": "203", + "$id": "208", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "204", + "$id": "209", "name": "record", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "205", + "$id": "210", "kind": "path", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": true, @@ -3323,12 +3380,12 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode.record.param", "methodParameterSegments": [ { - "$id": "206", + "$id": "211", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Path", "isApiVersion": false, @@ -3366,7 +3423,7 @@ }, "parameters": [ { - "$ref": "206" + "$ref": "211" } ], "response": {}, @@ -3378,13 +3435,13 @@ ], "parameters": [ { - "$id": "207", + "$id": "212", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "208", + "$id": "213", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3395,7 +3452,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "209", + "$id": "214", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3414,7 +3471,7 @@ "crossLanguageDefinitionId": "Routes.PathParameters.MatrixExpansion.Explode", "apiVersions": [], "parent": { - "$ref": "170" + "$ref": "175" }, "isMultiServiceClient": false } @@ -3425,33 +3482,33 @@ "isMultiServiceClient": false }, { - "$id": "210", + "$id": "215", "kind": "client", "name": "QueryParameters", "isExactName": false, "namespace": "Routes.QueryParameters", "methods": [ { - "$id": "211", + "$id": "216", "kind": "basic", "name": "templateOnly", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "212", + "$id": "217", "name": "templateOnly", "isExactName": false, "resourceName": "QueryParameters", "accessibility": "public", "parameters": [ { - "$id": "213", + "$id": "218", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "214", + "$id": "219", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3466,12 +3523,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "215", + "$id": "220", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "216", + "$id": "221", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3513,7 +3570,7 @@ }, "parameters": [ { - "$ref": "215" + "$ref": "220" } ], "response": {}, @@ -3523,26 +3580,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.templateOnly" }, { - "$id": "217", + "$id": "222", "kind": "basic", "name": "explicit", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "218", + "$id": "223", "name": "explicit", "isExactName": false, "resourceName": "QueryParameters", "accessibility": "public", "parameters": [ { - "$id": "219", + "$id": "224", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "220", + "$id": "225", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3557,12 +3614,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "221", + "$id": "226", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "222", + "$id": "227", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3604,7 +3661,7 @@ }, "parameters": [ { - "$ref": "221" + "$ref": "226" } ], "response": {}, @@ -3614,26 +3671,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.explicit" }, { - "$id": "223", + "$id": "228", "kind": "basic", "name": "annotationOnly", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "224", + "$id": "229", "name": "annotationOnly", "isExactName": false, "resourceName": "QueryParameters", "accessibility": "public", "parameters": [ { - "$id": "225", + "$id": "230", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "226", + "$id": "231", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3648,12 +3705,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "227", + "$id": "232", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "228", + "$id": "233", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3695,7 +3752,7 @@ }, "parameters": [ { - "$ref": "227" + "$ref": "232" } ], "response": {}, @@ -3707,13 +3764,13 @@ ], "parameters": [ { - "$id": "229", + "$id": "234", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "230", + "$id": "235", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3724,7 +3781,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "231", + "$id": "236", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3743,11 +3800,11 @@ "crossLanguageDefinitionId": "Routes.QueryParameters", "apiVersions": [], "parent": { - "$ref": "1" + "$ref": "6" }, "children": [ { - "$id": "232", + "$id": "237", "kind": "client", "name": "QueryExpansion", "isExactName": false, @@ -3755,13 +3812,13 @@ "methods": [], "parameters": [ { - "$id": "233", + "$id": "238", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "234", + "$id": "239", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -3772,7 +3829,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "235", + "$id": "240", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -3791,37 +3848,37 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion", "apiVersions": [], "parent": { - "$ref": "210" + "$ref": "215" }, "children": [ { - "$id": "236", + "$id": "241", "kind": "client", "name": "Standard", "isExactName": false, "namespace": "Routes.QueryParameters.QueryExpansion.Standard", "methods": [ { - "$id": "237", + "$id": "242", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "238", + "$id": "243", "name": "primitive", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "239", + "$id": "244", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "240", + "$id": "245", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3836,12 +3893,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "241", + "$id": "246", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "242", + "$id": "247", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -3883,7 +3940,7 @@ }, "parameters": [ { - "$ref": "241" + "$ref": "246" } ], "response": {}, @@ -3893,26 +3950,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Standard.primitive" }, { - "$id": "243", + "$id": "248", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "244", + "$id": "249", "name": "array", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "245", + "$id": "250", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": false, @@ -3923,12 +3980,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "246", + "$id": "251", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Query", "isApiVersion": false, @@ -3966,7 +4023,7 @@ }, "parameters": [ { - "$ref": "246" + "$ref": "251" } ], "response": {}, @@ -3976,26 +4033,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Standard.array" }, { - "$id": "247", + "$id": "252", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "248", + "$id": "253", "name": "record", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "249", + "$id": "254", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": false, @@ -4006,12 +4063,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "250", + "$id": "255", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Query", "isApiVersion": false, @@ -4049,7 +4106,7 @@ }, "parameters": [ { - "$ref": "250" + "$ref": "255" } ], "response": {}, @@ -4061,13 +4118,13 @@ ], "parameters": [ { - "$id": "251", + "$id": "256", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "252", + "$id": "257", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -4078,7 +4135,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "253", + "$id": "258", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -4097,38 +4154,38 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Standard", "apiVersions": [], "parent": { - "$ref": "232" + "$ref": "237" }, "isMultiServiceClient": false }, { - "$id": "254", + "$id": "259", "kind": "client", "name": "Explode", "isExactName": false, "namespace": "Routes.QueryParameters.QueryExpansion.Explode", "methods": [ { - "$id": "255", + "$id": "260", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "256", + "$id": "261", "name": "primitive", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "257", + "$id": "262", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "258", + "$id": "263", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4143,12 +4200,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "259", + "$id": "264", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "260", + "$id": "265", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4190,7 +4247,7 @@ }, "parameters": [ { - "$ref": "259" + "$ref": "264" } ], "response": {}, @@ -4200,26 +4257,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.primitive" }, { - "$id": "261", + "$id": "266", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "262", + "$id": "267", "name": "array", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "263", + "$id": "268", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": true, @@ -4230,12 +4287,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "264", + "$id": "269", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Query", "isApiVersion": false, @@ -4273,7 +4330,7 @@ }, "parameters": [ { - "$ref": "264" + "$ref": "269" } ], "response": {}, @@ -4283,26 +4340,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.array" }, { - "$id": "265", + "$id": "270", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "266", + "$id": "271", "name": "record", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "267", + "$id": "272", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": true, @@ -4313,12 +4370,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "268", + "$id": "273", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Query", "isApiVersion": false, @@ -4356,7 +4413,7 @@ }, "parameters": [ { - "$ref": "268" + "$ref": "273" } ], "response": {}, @@ -4364,17 +4421,100 @@ "generateConvenient": true, "generateProtocol": true, "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.record" + }, + { + "$id": "274", + "kind": "basic", + "name": "model", + "isExactName": false, + "accessibility": "public", + "apiVersions": [], + "operation": { + "$id": "275", + "name": "model", + "isExactName": false, + "resourceName": "Explode", + "accessibility": "public", + "parameters": [ + { + "$id": "276", + "kind": "query", + "name": "param", + "serializedName": "param", + "type": { + "$ref": "1" + }, + "isApiVersion": false, + "explode": true, + "optional": false, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.model.param", + "readOnly": false, + "methodParameterSegments": [ + { + "$id": "277", + "kind": "method", + "name": "param", + "serializedName": "param", + "type": { + "$ref": "1" + }, + "location": "Query", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.model.param", + "readOnly": false, + "access": "public", + "decorators": [], + "isExactName": false + } + ], + "isExactName": false + } + ], + "responses": [ + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false, + "serializationOptions": {} + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/routes/query/query-expansion/explode/model", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.model", + "decorators": [], + "namespace": "Routes.QueryParameters.QueryExpansion.Explode" + }, + "parameters": [ + { + "$ref": "277" + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode.model" } ], "parameters": [ { - "$id": "269", + "$id": "278", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "270", + "$id": "279", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -4385,7 +4525,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "271", + "$id": "280", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -4404,7 +4544,7 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryExpansion.Explode", "apiVersions": [], "parent": { - "$ref": "232" + "$ref": "237" }, "isMultiServiceClient": false } @@ -4412,7 +4552,7 @@ "isMultiServiceClient": false }, { - "$id": "272", + "$id": "281", "kind": "client", "name": "QueryContinuation", "isExactName": false, @@ -4420,13 +4560,13 @@ "methods": [], "parameters": [ { - "$id": "273", + "$id": "282", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "274", + "$id": "283", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -4437,7 +4577,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "275", + "$id": "284", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -4456,37 +4596,37 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation", "apiVersions": [], "parent": { - "$ref": "210" + "$ref": "215" }, "children": [ { - "$id": "276", + "$id": "285", "kind": "client", "name": "Standard", "isExactName": false, "namespace": "Routes.QueryParameters.QueryContinuation.Standard", "methods": [ { - "$id": "277", + "$id": "286", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "278", + "$id": "287", "name": "primitive", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "279", + "$id": "288", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "280", + "$id": "289", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4501,12 +4641,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "281", + "$id": "290", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "282", + "$id": "291", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4548,7 +4688,7 @@ }, "parameters": [ { - "$ref": "281" + "$ref": "290" } ], "response": {}, @@ -4558,26 +4698,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Standard.primitive" }, { - "$id": "283", + "$id": "292", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "284", + "$id": "293", "name": "array", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "285", + "$id": "294", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": false, @@ -4588,12 +4728,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "286", + "$id": "295", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Query", "isApiVersion": false, @@ -4631,7 +4771,7 @@ }, "parameters": [ { - "$ref": "286" + "$ref": "295" } ], "response": {}, @@ -4641,26 +4781,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Standard.array" }, { - "$id": "287", + "$id": "296", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "288", + "$id": "297", "name": "record", "isExactName": false, "resourceName": "Standard", "accessibility": "public", "parameters": [ { - "$id": "289", + "$id": "298", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": false, @@ -4671,12 +4811,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "290", + "$id": "299", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Query", "isApiVersion": false, @@ -4714,7 +4854,7 @@ }, "parameters": [ { - "$ref": "290" + "$ref": "299" } ], "response": {}, @@ -4726,13 +4866,13 @@ ], "parameters": [ { - "$id": "291", + "$id": "300", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "292", + "$id": "301", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -4743,7 +4883,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "293", + "$id": "302", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -4762,38 +4902,38 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Standard", "apiVersions": [], "parent": { - "$ref": "272" + "$ref": "281" }, "isMultiServiceClient": false }, { - "$id": "294", + "$id": "303", "kind": "client", "name": "Explode", "isExactName": false, "namespace": "Routes.QueryParameters.QueryContinuation.Explode", "methods": [ { - "$id": "295", + "$id": "304", "kind": "basic", "name": "primitive", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "296", + "$id": "305", "name": "primitive", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "297", + "$id": "306", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$id": "298", + "$id": "307", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4808,12 +4948,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "299", + "$id": "308", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$id": "300", + "$id": "309", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string", @@ -4855,7 +4995,7 @@ }, "parameters": [ { - "$ref": "299" + "$ref": "308" } ], "response": {}, @@ -4865,26 +5005,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Explode.primitive" }, { - "$id": "301", + "$id": "310", "kind": "basic", "name": "array", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "302", + "$id": "311", "name": "array", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "303", + "$id": "312", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "isApiVersion": false, "explode": true, @@ -4895,12 +5035,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "304", + "$id": "313", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "59" + "$ref": "64" }, "location": "Query", "isApiVersion": false, @@ -4938,7 +5078,7 @@ }, "parameters": [ { - "$ref": "304" + "$ref": "313" } ], "response": {}, @@ -4948,26 +5088,26 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Explode.array" }, { - "$id": "305", + "$id": "314", "kind": "basic", "name": "record", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "306", + "$id": "315", "name": "record", "isExactName": false, "resourceName": "Explode", "accessibility": "public", "parameters": [ { - "$id": "307", + "$id": "316", "kind": "query", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "isApiVersion": false, "explode": true, @@ -4978,12 +5118,12 @@ "readOnly": false, "methodParameterSegments": [ { - "$id": "308", + "$id": "317", "kind": "method", "name": "param", "serializedName": "param", "type": { - "$ref": "65" + "$ref": "70" }, "location": "Query", "isApiVersion": false, @@ -5021,7 +5161,7 @@ }, "parameters": [ { - "$ref": "308" + "$ref": "317" } ], "response": {}, @@ -5033,13 +5173,13 @@ ], "parameters": [ { - "$id": "309", + "$id": "318", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "310", + "$id": "319", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -5050,7 +5190,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "311", + "$id": "320", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -5069,7 +5209,7 @@ "crossLanguageDefinitionId": "Routes.QueryParameters.QueryContinuation.Explode", "apiVersions": [], "parent": { - "$ref": "272" + "$ref": "281" }, "isMultiServiceClient": false } @@ -5080,21 +5220,21 @@ "isMultiServiceClient": false }, { - "$id": "312", + "$id": "321", "kind": "client", "name": "InInterface", "isExactName": false, "namespace": "Routes", "methods": [ { - "$id": "313", + "$id": "322", "kind": "basic", "name": "fixed", "isExactName": false, "accessibility": "public", "apiVersions": [], "operation": { - "$id": "314", + "$id": "323", "name": "fixed", "isExactName": false, "resourceName": "InInterface", @@ -5130,13 +5270,13 @@ ], "parameters": [ { - "$id": "315", + "$id": "324", "kind": "endpoint", "name": "endpoint", "serializedName": "endpoint", "doc": "Service host", "type": { - "$id": "316", + "$id": "325", "kind": "url", "name": "endpoint", "crossLanguageDefinitionId": "TypeSpec.url" @@ -5147,7 +5287,7 @@ "isEndpoint": true, "defaultValue": { "type": { - "$id": "317", + "$id": "326", "kind": "string", "name": "string", "crossLanguageDefinitionId": "TypeSpec.string" @@ -5166,7 +5306,7 @@ "crossLanguageDefinitionId": "Routes.InInterface", "apiVersions": [], "parent": { - "$ref": "1" + "$ref": "6" }, "isMultiServiceClient": false } diff --git a/packages/http-client-csharp/package-lock.json b/packages/http-client-csharp/package-lock.json index b154e55c3a9..acfa93b6aee 100644 --- a/packages/http-client-csharp/package-lock.json +++ b/packages/http-client-csharp/package-lock.json @@ -12,25 +12,25 @@ "@azure/identity": "^4.13.0" }, "devDependencies": { - "@azure-tools/azure-http-specs": "0.1.0-alpha.42", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-client-generator-core": "0.69.2", + "@azure-tools/azure-http-specs": "0.1.0-alpha.43", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", "@microsoft/api-extractor": "^7.52.2", "@types/node": "~22.12.0", - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/http-specs": "0.1.0-alpha.38", - "@typespec/json-schema": "1.13.0", - "@typespec/library-linter": "0.83.0", - "@typespec/openapi": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/spec-api": "0.1.0-alpha.14", - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/sse": "0.83.0", - "@typespec/streams": "0.83.0", - "@typespec/tspd": "0.75.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0", + "@typespec/compiler": "1.14.0", + "@typespec/http": "1.14.0", + "@typespec/http-specs": "0.1.0-alpha.39", + "@typespec/json-schema": "1.14.0", + "@typespec/library-linter": "0.84.0", + "@typespec/openapi": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/spec-api": "0.1.0-alpha.15", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@typespec/tspd": "0.76.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0", "@vitest/coverage-v8": "^4.1.8", "@vitest/ui": "^4.1.8", "c8": "^10.1.2", @@ -39,98 +39,97 @@ "vitest": "^4.1.8" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.69.0 <0.70.0 || ~0.70.0-0", - "@azure-tools/typespec-client-generator-core": ">=0.69.2 <0.70.0 || ~0.70.0-0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <0.84.0 || ~0.84.0-0", - "@typespec/sse": ">=0.83.0 <0.84.0 || ~0.84.0-0", - "@typespec/streams": ">=0.83.0 <0.84.0 || ~0.84.0-0", - "@typespec/versioning": ">=0.83.0 <0.84.0 || ~0.84.0-0" + "@azure-tools/typespec-azure-core": ">=0.70.0 <0.71.0 || ~0.71.0-0", + "@azure-tools/typespec-client-generator-core": ">=0.70.0 <0.71.0 || ~0.71.0-0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": ">=0.84.0 <0.85.0 || ~0.85.0-0", + "@typespec/sse": ">=0.84.0 <0.85.0 || ~0.85.0-0", + "@typespec/streams": ">=0.84.0 <0.85.0 || ~0.85.0-0", + "@typespec/versioning": ">=0.84.0 <0.85.0 || ~0.85.0-0" } }, "node_modules/@alloy-js/core": { - "version": "0.23.1", - "resolved": "https://registry.npmjs.org/@alloy-js/core/-/core-0.23.1.tgz", - "integrity": "sha512-zbPXbiWjF3BvgO+a6dyDiA9uI19x5cHKDy5iC3U2/DIimIB0/j1/ObT9BNIzcM69h5pYt7ADDGXx5eNyb8j7bw==", + "version": "0.24.1", + "resolved": "https://registry.npmjs.org/@alloy-js/core/-/core-0.24.1.tgz", + "integrity": "sha512-cye97/HGo0/G8XIc8UnS0PaSoSOj9DDPEiuKsXsn7xQgR1sbL+Nf0oTMZnL2fFb7mRnmULO84x5wK8R/YtReTg==", "dev": true, "license": "MIT", "dependencies": { "@types/ws": "^8.18.1", - "@vue/reactivity": "^3.5.13", + "@vue/reactivity": "^3.5.35", "cli-table3": "^0.6.5", - "devalue": "^5.6.2", + "devalue": "^5.8.1", "pathe": "^2.0.3", "picocolors": "^1.1.1", - "prettier": "^3.6.2", - "ws": "^8.19.0" + "ws": "^8.21.0" } }, "node_modules/@alloy-js/markdown": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@alloy-js/markdown/-/markdown-0.23.0.tgz", - "integrity": "sha512-tap9rYtEyxasdl8vQuBj3HHnI7DraSkBppcFOMoPzg7XJyHnZiO+/4CHWiWepMN49UDxk3br0k34+THM1A3H3w==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@alloy-js/markdown/-/markdown-0.24.0.tgz", + "integrity": "sha512-gubCVcqm9OVVBBofADxy5eUS2LYNt1qo0oMvUR8ANyh0+2lKP7zx9D9Q9OXbF5TB9f+vod3OeTuX2F6QLtLKiQ==", "dev": true, "license": "MIT", "dependencies": { - "@alloy-js/core": "~0.23.0", + "@alloy-js/core": "~0.24.0", "yaml": "^2.7.1" } }, "node_modules/@alloy-js/typescript": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@alloy-js/typescript/-/typescript-0.23.0.tgz", - "integrity": "sha512-aqZpW3+Pd/dgMkqAF+/KMELKqJppIKe1xO1LdcNgXA7p71DuogBvlj2UVzFtHRtP221Ewn/vFSJ+ZpPFv8FLDQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@alloy-js/typescript/-/typescript-0.24.0.tgz", + "integrity": "sha512-xpnWUa5gaPRg4eeTFp4Xg8GRXzUghIpOzAWuGujvihgksIAH92lLTvEcPL1JTICup8Jv2us0JHndc4a8LWG+Ow==", "dev": true, "license": "MIT", "dependencies": { - "@alloy-js/core": "~0.23.0", + "@alloy-js/core": "~0.24.0", "change-case": "^5.4.4", "pathe": "^2.0.3" } }, "node_modules/@azure-tools/azure-http-specs": { - "version": "0.1.0-alpha.42", - "resolved": "https://registry.npmjs.org/@azure-tools/azure-http-specs/-/azure-http-specs-0.1.0-alpha.42.tgz", - "integrity": "sha512-vQOAepoGK1lSc9ohAub+NM1MiLJS5swIA5Ya3TTIJ4KkD1x6j5msdSRMgNgb0rmux/WWrKTRtsFDAiOF1Z0HKg==", + "version": "0.1.0-alpha.43", + "resolved": "https://registry.npmjs.org/@azure-tools/azure-http-specs/-/azure-http-specs-0.1.0-alpha.43.tgz", + "integrity": "sha512-5FTIh21iGlMtVkQHZrbFPg7fIDYtIxjG1oYNbcxdirfQUm/XtWvCv8UAwr3OzEBrE1+YEC6c164x4+bINm5UHA==", "dev": true, "license": "MIT", "dependencies": { - "@typespec/spec-api": "^0.1.0-alpha.14", - "@typespec/spector": "^0.1.0-alpha.25" + "@typespec/spec-api": "^0.1.0-alpha.15", + "@typespec/spector": "^0.1.0-alpha.26" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.69.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", - "integrity": "sha512-UNdPb/DgMvXqwWk9hb54QOAumCJ6u6GGy+bj3RIIT1Sht6FR9rIn8AQ/UQ7WtrhbJBoqvQo5dxtS565a9/VRZw==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", + "integrity": "sha512-8MojHWRtTLKycJJ98IMoXX/5b9tTo3F0d3Iu20OKoCsORnSDG2NfjOWHJVW63oxA2t8VTlqC6J8BDcnRihygQQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.69.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.2.tgz", - "integrity": "sha512-Td+CUO9UNioD/k2aFnv7TcffGGSaxmodshonTwts3/ZBJLmFtZI06odXr0+7/QDM9K9koPDjCg0VwTbS2c6scA==", + "version": "0.70.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", + "integrity": "sha512-8yxOYJfID3wp3FLQYNIa3kbmR5YLWjYtpB+i4u66quHTTQWWANHV1/o9f8xymAf+8fO9jbLo5tw1JerumxISWg==", "dev": true, "license": "MIT", "dependencies": { @@ -142,16 +141,16 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure/abort-controller": { @@ -199,16 +198,16 @@ } }, "node_modules/@azure/core-http-compat": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.4.0.tgz", - "integrity": "sha512-f1P96IB399YiN2ARYHP7EpZi3Bf3wH4SN2lGzrw7JVwm7bbsVYtf2iKSBwTywD2P62NOPZGHFSZi+6jjb75JuA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.5.0.tgz", + "integrity": "sha512-BoSmXPx2er1Ai+wKlDvj29jIQespCNBwEmKyZVHO2kEFsWbGjAjwMCGzug3DJM5/QYIV3vej0S1zcU5bq9fa8w==", "dev": true, "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.1.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" }, "peerDependencies": { "@azure/core-client": "^1.10.0", @@ -232,22 +231,22 @@ } }, "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==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.7.0.tgz", + "integrity": "sha512-7GEAoIsaoBr6KELNRb8nypowCqvk8dnCHFCYg4XD4lOQGY2GqjQg5IhkRjyBFRO18CGSMq05PaNqSOE9GQro3g==", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.23.0.tgz", - "integrity": "sha512-Evs1INHo+jUjwHi1T6SG6Ua/LHOQBCLuKEEE6efIpt4ZOoNonaT1kP32GoOcdNDbfqsD2445CPri3MubBy5DEQ==", + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", + "integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==", "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.1.2", @@ -259,7 +258,7 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-tracing": { @@ -289,9 +288,9 @@ } }, "node_modules/@azure/core-xml": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.5.1.tgz", - "integrity": "sha512-xcNRHqCoSp4AunOALEae6A8f3qATb83gSrm31Iqb01OzblvC3/W/bfXozcq78EzIdzZzuH1bZ2NvRR0TdX709w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.6.0.tgz", + "integrity": "sha512-e7lX/dk//F6Qf7BB6PTY4+p2yuOQtyOeHGyapYHNwqSp2OnYpwQt49A/Nin2XmKBQ69pwagR4k/lQBq8lbHQkA==", "dev": true, "license": "MIT", "dependencies": { @@ -299,7 +298,7 @@ "tslib": "^2.8.1" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/identity": { @@ -398,16 +397,16 @@ } }, "node_modules/@azure/storage-common": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.3.0.tgz", - "integrity": "sha512-/OFHhy86aG5Pe8dP5tsp+BuJ25JOAl9yaMU3WZbkeoiFMHFtJ7tu5ili7qEdBXNW9G5lDB19trwyI6V49F/8iQ==", + "version": "12.4.1", + "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.4.1.tgz", + "integrity": "sha512-t14unw/WofGDUi7TKJrsyXyPsN+NLgRm7hMaq0llxNmTIzt7f257+6LE6FKIJPh88zLj6M7LPvzve0fEYg/L3A==", "dev": true, "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", "@azure/core-http-compat": "^2.2.0", - "@azure/core-rest-pipeline": "^1.19.1", + "@azure/core-rest-pipeline": "^1.24.0", "@azure/core-tracing": "^1.2.0", "@azure/core-util": "^1.11.0", "@azure/logger": "^1.1.4", @@ -1048,9 +1047,9 @@ } }, "node_modules/@nodable/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-9uGyhaQavEUMC8AIddIjau4NsnsXhou+j5sBAGojCM1oxmQpVKTWR/9JxABD6UAv12vpIms55fPZKFQEhG6uBg==", "dev": true, "funding": [ { @@ -1060,44 +1059,6 @@ ], "license": "MIT" }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@oxc-project/types": { "version": "0.133.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.133.0.tgz", @@ -1523,19 +1484,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@sindresorhus/merge-streams": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", - "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@standard-schema/spec": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", @@ -1651,9 +1599,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.13.0.tgz", - "integrity": "sha512-DonoHiyAMx0UjSmssqTrFtya+v97wny1aHcTLU5QF2wFzLATtcwUU9hbPC+eXhepuTunMOCHf8yk3pEsH6PZYA==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.14.0.tgz", + "integrity": "sha512-RRN0LGVDlonG/IbB2b4mvRjdCo6LywwB9/J8lOp6UaH7vtaFnKe5FL+rpxhof4rXx/zI/4OWnQO6c01bTCz4/Q==", "dev": true, "license": "MIT", "dependencies": { @@ -1668,8 +1616,8 @@ "prettier": "^3.8.1", "semver": "^7.7.4", "tar": "^7.5.13", - "temporal-polyfill": "^0.3.2", - "vscode-languageserver": "^9.0.1", + "temporal-polyfill": "^1.0.1", + "vscode-languageserver": "^10.0.0", "vscode-languageserver-textdocument": "^1.0.12", "yaml": "^2.8.3", "yargs": "^18.0.0" @@ -1683,9 +1631,9 @@ } }, "node_modules/@typespec/events": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.83.0.tgz", - "integrity": "sha512-3EP1EIjdLgwStgd2rGWaF/QqY7YRAt+DIYnnYG2VsdPwa8s2t6K6eJ9YJDXveeHImAkHs+cpFuwxnjKMl4hOyw==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.84.0.tgz", + "integrity": "sha512-UroDIu6t6Z+cOLyX8I+GJWhSFmYGrp1L93F7ZVt0Ypmj0ndmC9YYa4cpeEyS5PDDIC8u49WfCIwfGegxt4rPVQ==", "dev": true, "license": "MIT", "peer": true, @@ -1693,21 +1641,21 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/http": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.13.0.tgz", - "integrity": "sha512-tf8XFddU6g1MZSAVCLC/0Xa4fNfUO0CcHe6PWpmC3bvUojxMnpRcERI2DdoRJ+aycB9Q+Z8wN8bJO3up6u+sCw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.14.0.tgz", + "integrity": "sha512-W+heCzu8K63AVcoX8MachVWaRxSAMFWOI1yBTc2Kq8QHaJeDiLL5JbU8VfTZ4tL/6EoGSdKfIT5ZNRW7oVCzhg==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/streams": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -1716,30 +1664,30 @@ } }, "node_modules/@typespec/http-specs": { - "version": "0.1.0-alpha.38", - "resolved": "https://registry.npmjs.org/@typespec/http-specs/-/http-specs-0.1.0-alpha.38.tgz", - "integrity": "sha512-/DlR8P93iFhULlLYDUy+aSkOW2udDrHdIfdIHko8aFnmfC5QGXE2fcFphtNlJHCQEYTdZwfAxmBu/TsEygR8jw==", + "version": "0.1.0-alpha.39", + "resolved": "https://registry.npmjs.org/@typespec/http-specs/-/http-specs-0.1.0-alpha.39.tgz", + "integrity": "sha512-x3ORyF/qLSLt+QDyievKT90STB0tT9J4s0Yu/Isio8zK16U+eRbCFHi69T7FZ94ZrRpPDWJ2u9+dEZv/SCPj+w==", "dev": true, "license": "MIT", "dependencies": { - "@typespec/spec-api": "^0.1.0-alpha.14", - "@typespec/spector": "^0.1.0-alpha.25" + "@typespec/spec-api": "^0.1.0-alpha.15", + "@typespec/spector": "^0.1.0-alpha.26" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@typespec/json-schema": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-1.13.0.tgz", - "integrity": "sha512-o5yxs4aGhfFTkVNAkpFlO3LP2O8kWHQUgBzZ0s6tcbFlElGH86jUsdesT8O5ijoA0Cpa//m39wwxIcmBB2DiiA==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-1.14.0.tgz", + "integrity": "sha512-YNp0k+HV5eXzzXbAgxOGj01h+Asg1Ljo2EeaqQWFgS6o1Hxg7M4nQZeLs59v9IUxYvtJCHSkmeMADRjpCatrPw==", "dev": true, "license": "MIT", "dependencies": { @@ -1750,63 +1698,62 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/library-linter": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/library-linter/-/library-linter-0.83.0.tgz", - "integrity": "sha512-pivCXKxVUEM/1PHAVOTy4NpTUTg2AikSeXN5R3HeHhkboHS203sSdsussKgvKHi2QbsaCYt2srTN29/fo+HcyQ==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/library-linter/-/library-linter-0.84.0.tgz", + "integrity": "sha512-ZhtPhQd03uzzfFOxDxzM1qN2X+vfHQszNCLnn2cF2r/12l0gFw03OHFeotLBmrpcclSI+sEu4iG9ZoBx7hTsHQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/openapi": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.13.0.tgz", - "integrity": "sha512-omPc9n+LM2WvjYwnIf31RCxmG17fFUOVLBRsWg4T1mbcsNCj4grnNP7Lwt+irIZCiKtmLKxq3ViE7jYixCkZ3g==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.14.0.tgz", + "integrity": "sha512-KL7kImPhCXRmxpHVt1k7TWaa4bb3NbSeUx2rxyxeq7lYZFllI6/NYRCTOI/5JOrbElWmmSxrajU9K9IAKI6PkQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/rest": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.83.0.tgz", - "integrity": "sha512-WMEwEe1kdaOdZ0c+ct5BVmTSBXkrPniUYDWCz3K52T4in2dNc7J6YGP6tL8bXgQz5B0CsP0VNO12N+UysQDsLw==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.84.0.tgz", + "integrity": "sha512-9s5dDfRoHRPdtbVvkBasUx/RnMvwWMTuXRieSQDEji4gWGgxVu4Zt4MiEEKSfQrkMr3Aw0QjRCSxBxjMCHIOmA==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/spec-api": { - "version": "0.1.0-alpha.14", - "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.14.tgz", - "integrity": "sha512-MpLVtJZMsONMB9Di9aiXRbbihqa/+4MmbDHpuwd3ka39wtRhcA3sbFQY/+oU5zVEfEAldGgVkenFd2wnoI/xkQ==", + "version": "0.1.0-alpha.15", + "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.15.tgz", + "integrity": "sha512-rVPcA3KFJEBYpXq9BJkmtOk0SmF/pHUXv4m1FJNbXX8YW7eo3/NUKwB2Tc3TQVZB9zEIfBmf3BtLWpwvmVMAUQ==", "dev": true, "license": "MIT", "dependencies": { - "deep-equal": "^2.2.3", "express": "^5.2.1", - "xml2js": "^0.6.2" + "fast-xml-parser": "^5.7.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@typespec/spec-coverage-sdk": { @@ -1844,110 +1791,63 @@ "license": "MIT" }, "node_modules/@typespec/spector": { - "version": "0.1.0-alpha.25", - "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.25.tgz", - "integrity": "sha512-KxMiwA/+XDWpZOdhr7TbnsR8ppXVi+edFa9hdUuerOGQzzALbSeQYUJLUr4RErRiHpqg2/P4FyJ2E0eiA2fTYA==", + "version": "0.1.0-alpha.26", + "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.26.tgz", + "integrity": "sha512-WtaWIJE+Xh80G11Bi/3zC1GIrK4EVYBSCnkmSvm9bEYcBMH8QuryPDbUeTXYUyozcCrMYXaKnBboHN91IEi8ug==", "dev": true, "license": "MIT", "dependencies": { - "@azure/identity": "~4.13.0", - "@typespec/compiler": "^1.11.0", - "@typespec/http": "^1.11.0", - "@typespec/rest": "^0.81.0", - "@typespec/spec-api": "^0.1.0-alpha.14", + "@azure/identity": "^4.13.1", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/spec-api": "^0.1.0-alpha.15", "@typespec/spec-coverage-sdk": "^0.1.0-alpha.16", - "@typespec/versioning": "^0.81.0", - "ajv": "~8.18.0", - "body-parser": "^2.2.2", - "deep-equal": "^2.2.3", + "@typespec/versioning": "^0.84.0", + "ajv": "^8.18.0", "express": "^5.2.1", - "globby": "~16.1.1", "micromatch": "^4.0.8", "morgan": "^1.10.1", - "multer": "^2.1.1", - "picocolors": "~1.1.1", - "source-map-support": "~0.5.21", - "xml2js": "^0.6.2", - "yaml": "~2.8.2", - "yargs": "~18.0.0" + "multer": "^2.2.0", + "picocolors": "^1.1.1", + "source-map-support": "^0.5.21", + "yaml": "^2.8.3", + "yargs": "^18.0.0" }, "bin": { "tsp-spector": "cmd/cli.mjs" }, "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@typespec/spector/node_modules/@typespec/rest": { - "version": "0.81.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.81.0.tgz", - "integrity": "sha512-qQXZRKEvq5aNlDFEUqBiiXXPIFyr/+PWgBY0kIrnhyZzMjfUqPInkB12QgXpVp2O2Wm3jmETJD45SaLHTCYBbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.11.0", - "@typespec/http": "^1.11.0" - } - }, - "node_modules/@typespec/spector/node_modules/@typespec/versioning": { - "version": "0.81.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.81.0.tgz", - "integrity": "sha512-5bha4t64xA85zLY8VGm/6jNd2kwPHzjPq/dlCUjtgGfGXv2R6Ow/YIukqhqZnwnIgNAIlZ7nguekRMRx+2oO2w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "^1.11.0" - } - }, - "node_modules/@typespec/spector/node_modules/yaml": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.4.tgz", - "integrity": "sha512-ml/JPOj9fOQK8RNnWojA67GbZ0ApXAUlN2UQclwv2eVgTgn7O9gg9o7paZWKMp4g0H3nTLtS9LVzhkpOFIKzog==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" + "node": ">=22.0.0" } }, "node_modules/@typespec/sse": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.83.0.tgz", - "integrity": "sha512-04WNaju2rwBbcF5pG+HrKQtdcrmSGuTVziLHNA9XOqj1qM7Uon3+wo2g+ZZ3Z6tngfqQoTCPyDcRHqZtGRdNuw==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.84.0.tgz", + "integrity": "sha512-9joNgVisRCWDFfV1d79iTAuR1W/6r+AKJrKUfcjsaTrq5A8OWW3v5TTsfxbHAZArn7n2WxQkqhNGgNyc8LjEng==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/streams": "^0.84.0" } }, "node_modules/@typespec/streams": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.83.0.tgz", - "integrity": "sha512-wbO6sdH1Uf+UwjxxsWdHQkjJ3wwiYsAKI+L66qnDYVXAFe02sUdMKd0mxH5o9ipGXE52MZ+yvZ52vHAD+g3RFQ==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.84.0.tgz", + "integrity": "sha512-SDneR8+zY+ueOpzg9yJtttfDe/ikB99JgddZSXKPwiDPlAIEeEvI8auipcYfB58EEOB21h8Oq0tEm8HqiAAWdQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/ts-http-runtime": { @@ -1965,20 +1865,20 @@ } }, "node_modules/@typespec/tspd": { - "version": "0.75.0", - "resolved": "https://registry.npmjs.org/@typespec/tspd/-/tspd-0.75.0.tgz", - "integrity": "sha512-lGCpN5aM1O8utVH+6c7UMv9IZtEKlxc4O5blxp06TdnYWjOxyOEm+R9BBzaY7aq6Jtj/YamdDnMvzV42y/F10Q==", + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@typespec/tspd/-/tspd-0.76.0.tgz", + "integrity": "sha512-3HH2VPZeDWLoQshfRzESubOzsOtljfFD5akOCFG/RhxO3hcfYW8iaHHjPw2ZzxPjpoAoCEc0ypsaxNYJgnLu+Q==", "dev": true, "license": "MIT", "dependencies": { - "@alloy-js/core": "^0.23.0", - "@alloy-js/markdown": "^0.23.0", - "@alloy-js/typescript": "^0.23.0", + "@alloy-js/core": "^0.24.1", + "@alloy-js/markdown": "^0.24.0", + "@alloy-js/typescript": "^0.24.0", "@microsoft/api-extractor": "^7.58.1", "@microsoft/api-extractor-model": "^7.33.5", "@microsoft/tsdoc": "^0.16.0", "@microsoft/tsdoc-config": "^0.18.1", - "@typespec/compiler": "^1.13.0", + "@typespec/compiler": "^1.14.0", "picocolors": "^1.1.1", "prettier": "^3.8.1", "typedoc": "^0.28.19", @@ -1994,29 +1894,29 @@ } }, "node_modules/@typespec/versioning": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.83.0.tgz", - "integrity": "sha512-nE66ta0ixpHB6FQpSzqnj8QnVfgFsxeK/4Xv+DxYx2nB/w18f6VjkF+hW+A/zs1tZIYvBZVbCNa/Rcr8zM6fhg==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.84.0.tgz", + "integrity": "sha512-ZoDasTDj4z0mgFK+0cJL2+7DduCaTjvICHL2nQ/RBWc7nLgObaIYCjvXLno8WneDXnpxCAr7larN4/nlHEv9fg==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/xml": { - "version": "0.83.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.83.0.tgz", - "integrity": "sha512-2/dtAD8jGPkIdwpQ1G1P+5+qdMPeafQiIKCd8NdAnOo0w9OZ59Io52jINm9HdN8+FcbOrqK8+B2N9rlPRj7PqA==", + "version": "0.84.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.84.0.tgz", + "integrity": "sha512-3x0spgIrr4u3azkYaOxrlumtjoqPiUnJ/G5RwGBmUCAeE5F413MHf/AeIkmZ2ULT1gY3myabfZp8bOijTbMk7A==", "dev": true, "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@vitest/coverage-v8": { @@ -2186,19 +2086,19 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.5.34", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.34.tgz", - "integrity": "sha512-y9XDjCEuBp+98k+UL5dbYkh57AHU4o6cxZedOPXw3bmrZZYLQsVHguGurq7hVrPCSrQtrnz1f9dssyFr+dMXfQ==", + "version": "3.5.39", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.39.tgz", + "integrity": "sha512-TpsuBJ9gGlZa5d23XcM2y8EXanz9dZeVDQBXRwzy46ItgvM+rWpzs+UVM0wcRLxGvcav0HE5jz2gNL53xlRAog==", "dev": true, "license": "MIT", "dependencies": { - "@vue/shared": "3.5.34" + "@vue/shared": "3.5.39" } }, "node_modules/@vue/shared": { - "version": "3.5.34", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.34.tgz", - "integrity": "sha512-24uqU4OIiX29ryC3MeWid/Xf2fa2EFRUVLb77nRhk+UrTVrh/XiGtFAFmJBAtBRbjwNdsPRP+jj/OL27Eg1NDA==", + "version": "3.5.39", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.39.tgz", + "integrity": "sha512-l1rrBtBfTnmxvtsvdQDXltUUy8S1Y+ZaqdfUzmAnJkTd8Z8rv5v/ytW+TKiqEOWyHPoqtPlNFSs0lhRmYVSHVA==", "dev": true, "license": "MIT" }, @@ -2298,6 +2198,19 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/anynum": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/anynum/-/anynum-1.0.1.tgz", + "integrity": "sha512-N6//FLET/tXYNM/F6ABca1oH6fWB+KlTt909Le28WMDBk8oaT4vY17DCrwg2MvmuqUKt3Ni4N5dGJ/EoBgcO6A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", @@ -2315,23 +2228,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", - "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "is-array-buffer": "^3.0.5" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -2361,22 +2257,6 @@ "dev": true, "license": "MIT" }, - "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, - "license": "MIT", - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", @@ -2408,22 +2288,36 @@ "license": "MIT" }, "node_modules/body-parser": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", - "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", "dev": true, "license": "MIT", "dependencies": { "bytes": "^3.1.2", - "content-type": "^1.0.5", + "content-type": "^2.0.0", "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -2610,25 +2504,6 @@ "node": ">=12" } }, - "node_modules/call-bind": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", - "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "get-intrinsic": "^1.3.0", - "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.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -2908,39 +2783,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, - "license": "MIT", - "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/default-browser": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz", @@ -2969,24 +2811,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -2999,24 +2823,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -3158,27 +2964,6 @@ "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, - "license": "MIT", - "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": "2.1.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", @@ -3187,9 +2972,9 @@ "license": "MIT" }, "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", "dev": true, "license": "MIT", "dependencies": { @@ -3307,23 +3092,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "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.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, "node_modules/fast-string-truncated-width": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", @@ -3369,9 +3137,9 @@ } }, "node_modules/fast-xml-builder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", - "integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.3.0.tgz", + "integrity": "sha512-F74cZEdCvuw9P41GAC3rod4X04jjWGM1JPEv/GWSqFTWLsdyMSBMBMlm9Hk3GLBgLBbdBNY8yee0pQh2RBVESQ==", "dev": true, "funding": [ { @@ -3381,14 +3149,14 @@ ], "license": "MIT", "dependencies": { - "path-expression-matcher": "^1.5.0", - "xml-naming": "^0.1.0" + "path-expression-matcher": "^1.6.2", + "xml-naming": "^0.3.0" } }, "node_modules/fast-xml-parser": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.8.0.tgz", - "integrity": "sha512-6bIM7fsJxeo3uXv7OncQYsBAMPJ7V16Slahl/6M98C/i2q+vB1+4a0MtrvYwDFEUrwDSbAmeLDRXsOBwrL7yAg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.10.0.tgz", + "integrity": "sha512-SLhnTEqE5QpJHq/6zl9bsmImEP2adv+y6Wy+cJa7nVTRzQh1OZfCe9k29M5xN74LWnu0xa1zrUrq3KnOKl92Fg==", "dev": true, "funding": [ { @@ -3398,26 +3166,17 @@ ], "license": "MIT", "dependencies": { - "@nodable/entities": "^2.1.0", + "@nodable/entities": "^2.2.0", "fast-xml-builder": "^1.2.0", - "path-expression-matcher": "^1.5.0", - "strnum": "^2.3.0", - "xml-naming": "^0.1.0" + "is-unsafe": "^2.0.0", + "path-expression-matcher": "^1.6.2", + "strnum": "^2.4.1", + "xml-naming": "^0.3.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/fflate": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", @@ -3484,22 +3243,6 @@ "dev": true, "license": "ISC" }, - "node_modules/for-each": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", - "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.2.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", @@ -3577,16 +3320,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, - "license": "MIT", - "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", @@ -3674,40 +3407,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "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, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-16.1.1.tgz", - "integrity": "sha512-dW7vl+yiAJSp6aCekaVnVJxurRv7DCOLyXqEG3RYMYUg7AuJ2jCqPkZTA8ooqC2vtnkaMcV5WfFBMuEnTu1OQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/merge-streams": "^4.0.0", - "fast-glob": "^3.3.3", - "ignore": "^7.0.5", - "is-path-inside": "^4.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.4.0" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -3728,42 +3427,16 @@ "dev": true, "license": "ISC" }, - "node_modules/has-bigints": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", - "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", - "dev": true, - "license": "MIT", - "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/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, "license": "MIT", "engines": { "node": ">=8" } }, - "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, - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -3777,22 +3450,6 @@ "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, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasown": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", @@ -3877,16 +3534,6 @@ "url": "https://opencollective.com/express" } }, - "node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, "node_modules/import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", @@ -3904,21 +3551,6 @@ "dev": true, "license": "ISC" }, - "node_modules/internal-slot": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", - "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.2", - "side-channel": "^1.1.0" - }, - "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", @@ -3929,87 +3561,6 @@ "node": ">= 0.10" } }, - "node_modules/is-arguments": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", - "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", - "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "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, - "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", - "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-core-module": { "version": "2.16.2", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", @@ -4026,23 +3577,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", - "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", @@ -4058,16 +3592,6 @@ "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", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "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", @@ -4078,19 +3602,6 @@ "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, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-inside-container": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", @@ -4109,19 +3620,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "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", @@ -4132,36 +3630,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", - "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "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", @@ -4169,25 +3637,6 @@ "dev": true, "license": "MIT" }, - "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, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-safe-filename": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-safe-filename/-/is-safe-filename-0.1.1.tgz", @@ -4201,70 +3650,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", - "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", - "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", - "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "has-symbols": "^1.1.0", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", @@ -4278,35 +3663,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", - "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "node_modules/is-unsafe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.0.tgz", + "integrity": "sha512-2LdV822R+wmI86unXA93WCFpL6g+av8ynWk0nrHyJqGop5VoocYsSLFgN8jrfalT6iGeLNM4KXuVSsULP53kEA==", "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "get-intrinsic": "^1.2.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" }, "node_modules/is-wsl": { "version": "3.1.1", @@ -4323,13 +3691,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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, - "license": "MIT" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4951,16 +4312,6 @@ "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==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5096,9 +4447,9 @@ "license": "MIT" }, "node_modules/multer": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-2.1.1.tgz", - "integrity": "sha512-mo+QTzKlx8R7E5ylSXxWzGoXoZbOsRMpyitcht8By2KHvMbf3tjwosZ/Mu/XYU6UuJ3VZnODIrak5ZrPiPyB6A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz", + "integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5224,54 +4575,6 @@ "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, - "license": "MIT", - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/obug": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", @@ -5394,9 +4697,9 @@ } }, "node_modules/path-expression-matcher": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz", - "integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.6.2.tgz", + "integrity": "sha512-enSlaiat05iasnzmgNxRj8reFdj3puY2QpNgP1aPIaVfT6nn9ICuPoFlKHk8EN22HcwewshO+mN2DGbkCEOtqQ==", "dev": true, "funding": [ { @@ -5491,16 +4794,6 @@ "node": ">=4" } }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postcss": { "version": "8.5.15", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", @@ -5571,13 +4864,14 @@ } }, "node_modules/qs": { - "version": "6.15.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", - "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.1.0" + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" }, "engines": { "node": ">=0.6" @@ -5586,35 +4880,18 @@ "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" - } - ], - "license": "MIT" - }, "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==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/raw-body": { @@ -5648,27 +4925,6 @@ "node": ">= 6" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.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", @@ -5711,17 +4967,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rimraf": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", @@ -5805,30 +5050,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "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" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -5849,24 +5070,6 @@ ], "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -5874,16 +5077,6 @@ "dev": true, "license": "MIT" }, - "node_modules/sax": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", - "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=11.0.0" - } - }, "node_modules/semver": { "version": "7.7.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", @@ -5943,40 +5136,6 @@ "url": "https://opencollective.com/express" } }, - "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, - "license": "MIT", - "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, - "license": "MIT", - "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", @@ -6008,15 +5167,15 @@ } }, "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, @@ -6118,19 +5277,6 @@ "node": ">=18" } }, - "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, - "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", @@ -6193,20 +5339,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -6295,9 +5427,9 @@ } }, "node_modules/strnum": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.3.0.tgz", - "integrity": "sha512-ums3KNd42PGyx5xaoVTO1mjU1bH3NpY4vsrVlnv9PNGqQj8wd7rJ6nEypLrJ7z5vxK5RP0yMLo6J/Gsm62DI5Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.1.tgz", + "integrity": "sha512-M9eUSMT2dCB2cTNPG7UYj6KuK7RJR2SN2+yCV/fTW3xzTCS6EaGZ5pSMgDIjB7r8zSfTGk+dvvn9rTjpVS9Mwg==", "dev": true, "funding": [ { @@ -6305,7 +5437,10 @@ "url": "https://github.com/sponsors/NaturalIntelligence" } ], - "license": "MIT" + "license": "MIT", + "dependencies": { + "anynum": "^1.0.1" + } }, "node_modules/supports-color": { "version": "8.1.1", @@ -6354,21 +5489,29 @@ } }, "node_modules/temporal-polyfill": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.3.2.tgz", - "integrity": "sha512-TzHthD/heRK947GNiSu3Y5gSPpeUDH34+LESnfsq8bqpFhsB79HFBX8+Z834IVX68P3EUyRPZK5bL/1fh437Eg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", + "integrity": "sha512-N2SoI9olnW7BUsU8RosDphZQl9s+WJ8O7PoJMFCr/e5/1rFkVI4GNOWaSeySG+UoP04foPYsnLWbJmbXOiShZg==", "dev": true, "license": "MIT", "dependencies": { - "temporal-spec": "0.3.1" + "temporal-spec": "1.0.0", + "temporal-utils": "1.0.1" } }, "node_modules/temporal-spec": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.3.1.tgz", - "integrity": "sha512-B4TUhezh9knfSIMwt7RVggApDRJZo73uZdj8AacL2mZ8RP5KtLianh2MXxL06GN9ESYiIsiuoLQhgVfwe55Yhw==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-1.0.0.tgz", + "integrity": "sha512-00Ahj1e1ifaERTMOIIGpOCdOo9IEk2m6GGSMedsn9a2SIsGLdOTbmME1Htv6IM82b6VHrzSUTIVc7YHy6hdhFQ==", "dev": true, - "license": "ISC" + "license": "Apache-2.0" + }, + "node_modules/temporal-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/temporal-utils/-/temporal-utils-1.0.1.tgz", + "integrity": "sha512-HAixuesxFQIUaQk3ptX2jhfO/FsOkgVkDDMawvp6n/fkB1q6BKfs3lURw9I+pK/2e2e/q/vrLrxmeqauBoyGMQ==", + "dev": true, + "license": "MIT" }, "node_modules/test-exclude": { "version": "7.0.2", @@ -6805,19 +5948,6 @@ "dev": true, "license": "MIT" }, - "node_modules/unicorn-magic": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz", - "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -7065,9 +6195,9 @@ } }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", + "integrity": "sha512-rfuA6T75H6m5EkbhtEPzre9pT0HPcDI2MMy4+nPFIBks5J8JBAUHD4tRYSgaBOijIEC7SRkC1kKyXTLqbmh9jw==", "dev": true, "license": "MIT", "engines": { @@ -7075,27 +6205,27 @@ } }, "node_modules/vscode-languageserver": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", - "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", + "integrity": "sha512-9gEWpXkYGXoqG7pBnE8O8hx/yP7+Aabn4+peQ3KDicQv6qunHSWyLTud3OF0w4S2+HfDD+5HqYKiXQW9HAU6mA==", "dev": true, "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.17.5" + "vscode-languageserver-protocol": "3.18.2" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", + "integrity": "sha512-XRyDbT0Pp3sSNti3JmxVEUMySWCSi1hhM+/KUlCy1hV1zmrqpM1OwO12EAki8blhmLuIMpaJrYbo0OzGVfK2Qg==", "dev": true, "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "9.0.1", + "vscode-languageserver-types": "3.18.0" } }, "node_modules/vscode-languageserver-textdocument": { @@ -7106,9 +6236,9 @@ "license": "MIT" }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha512-8TsGPNMIMiiBdkORgRSvLjuiEIiAFtO+KssmYWxQ+uSVvlf7RjK8YKCOjPzZ+YA04jXEV7+7LvkSmHkhpNS99g==", "dev": true, "license": "MIT" }, @@ -7128,67 +6258,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", - "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.1.0", - "is-boolean-object": "^1.2.1", - "is-number-object": "^1.1.1", - "is-string": "^1.1.1", - "is-symbol": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "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, - "license": "MIT", - "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.20", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", - "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.8", - "call-bound": "^1.0.4", - "for-each": "^0.3.5", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "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", @@ -7321,9 +6390,9 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.20.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz", - "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==", + "version": "8.21.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz", + "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==", "dev": true, "license": "MIT", "engines": { @@ -7358,9 +6427,9 @@ } }, "node_modules/xml-naming": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz", - "integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.3.0.tgz", + "integrity": "sha512-ghig2TBE/H11aOVgmahA3MhimvkBr6JIYknH/Dhdk10nXwdbIqBJsbfMxpvFPG8bAw77gN29aQWvKpmVoPlvPQ==", "dev": true, "funding": [ { @@ -7373,30 +6442,6 @@ "node": ">=16.0.0" } }, - "node_modules/xml2js": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", - "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/packages/http-client-csharp/package.json b/packages/http-client-csharp/package.json index 4f0d0f5f902..5fd52d9377e 100644 --- a/packages/http-client-csharp/package.json +++ b/packages/http-client-csharp/package.json @@ -58,36 +58,36 @@ "emitter/lib/*.tsp" ], "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.69.0 <0.70.0 || ~0.70.0-0", - "@azure-tools/typespec-client-generator-core": ">=0.69.2 <0.70.0 || ~0.70.0-0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": ">=0.83.0 <0.84.0 || ~0.84.0-0", - "@typespec/sse": ">=0.83.0 <0.84.0 || ~0.84.0-0", - "@typespec/streams": ">=0.83.0 <0.84.0 || ~0.84.0-0", - "@typespec/versioning": ">=0.83.0 <0.84.0 || ~0.84.0-0" + "@azure-tools/typespec-azure-core": ">=0.70.0 <0.71.0 || ~0.71.0-0", + "@azure-tools/typespec-client-generator-core": ">=0.70.0 <0.71.0 || ~0.71.0-0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": ">=0.84.0 <0.85.0 || ~0.85.0-0", + "@typespec/sse": ">=0.84.0 <0.85.0 || ~0.85.0-0", + "@typespec/streams": ">=0.84.0 <0.85.0 || ~0.85.0-0", + "@typespec/versioning": ">=0.84.0 <0.85.0 || ~0.85.0-0" }, "devDependencies": { - "@azure-tools/azure-http-specs": "0.1.0-alpha.42", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-client-generator-core": "0.69.2", + "@azure-tools/azure-http-specs": "0.1.0-alpha.43", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", "@microsoft/api-extractor": "^7.52.2", "@types/node": "~22.12.0", - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/http-specs": "0.1.0-alpha.38", - "@typespec/json-schema": "1.13.0", - "@typespec/library-linter": "0.83.0", - "@typespec/openapi": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/spec-api": "0.1.0-alpha.14", - "@typespec/spector": "0.1.0-alpha.25", - "@typespec/sse": "0.83.0", - "@typespec/streams": "0.83.0", - "@typespec/tspd": "0.75.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0", + "@typespec/compiler": "1.14.0", + "@typespec/http": "1.14.0", + "@typespec/http-specs": "0.1.0-alpha.39", + "@typespec/json-schema": "1.14.0", + "@typespec/library-linter": "0.84.0", + "@typespec/openapi": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/spec-api": "0.1.0-alpha.15", + "@typespec/spector": "0.1.0-alpha.26", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@typespec/tspd": "0.76.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0", "@vitest/coverage-v8": "^4.1.8", "@vitest/ui": "^4.1.8", "c8": "^10.1.2", From 0f5e6800be25b93feced7e607731227937861c34 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Wed, 15 Jul 2026 14:42:47 -0700 Subject: [PATCH 007/249] ci: add dedicated nightly pipeline for C# emitter against TypeSpec Next (#10755) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `packages/http-client-csharp/eng/pipeline/nightly.yml` so the nightly TypeSpec Next validation for the C# emitter runs on its own ADO pipeline definition. ## Why Today the nightly TypeSpec Next validation piggybacks on `publish.yml` (scheduled runs flip `UseTypeSpecNext` on). That has two downsides: - It conflates nightly @next failures with release/publish failures, making reporting and triage harder. - It still runs the Publish stage, which we don't want for a nightly compatibility check. ## What - New file: `packages/http-client-csharp/eng/pipeline/nightly.yml` - `trigger: none` / `pr: none` — schedule will be configured on the ADO pipeline definition (matching repo convention; no other emitter pipelines define schedules in YAML). - `UseTypeSpecNext` parameter defaults to `true`. - `Publish: ""none""` passed to `emitter-stages.yml` → Publish stage and the `CreateAzureSdkForNetPR` stage are not included. - Runs unit tests (`-UnitTests`) plus the `RegenCheck` matrix (toggleable via `RunRegenChecks` parameter) so generation diffs against @next are surfaced in a separate `CSharp_Regen_Test` stage. - Same .NET 8/9/10 install steps and PrimaryNodeVersion default as `publish.yml`. - `publish.yml` is intentionally left untouched. Its `UseTypeSpecNext` parameter and `Build.Reason == 'Schedule'` override still work, so the existing capability is preserved. Once this pipeline is wired up in ADO, the schedule trigger can be moved off the publish definition. ## Follow-up (outside this PR) - Create the ADO pipeline definition pointing at `packages/http-client-csharp/eng/pipeline/nightly.yml` and set the nightly schedule there. - Once active, remove the nightly schedule from the publish pipeline definition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../eng/pipeline/nightly.yml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 packages/http-client-csharp/eng/pipeline/nightly.yml diff --git a/packages/http-client-csharp/eng/pipeline/nightly.yml b/packages/http-client-csharp/eng/pipeline/nightly.yml new file mode 100644 index 00000000000..12aa644d38c --- /dev/null +++ b/packages/http-client-csharp/eng/pipeline/nightly.yml @@ -0,0 +1,89 @@ +# Dedicated nightly pipeline for the C# emitter against TypeSpec Next. +# +# This pipeline builds and tests the C# emitter with TypeSpec @next dependencies +# but does NOT publish packages and does NOT open an azure-sdk-for-net PR. The +# schedule itself is configured on the ADO pipeline definition, so reporting and +# triage of nightly TypeSpec Next failures is separated from release/publish runs. +# +# The publish pipeline (publish.yml) still exposes a UseTypeSpecNext parameter for +# manual runs that need a published @next-based build. + +trigger: none +pr: none + +parameters: + - name: UseTypeSpecNext + displayName: Use TypeSpec Next (update dependencies to @next versions) + type: boolean + default: true + + - name: RunRegenChecks + displayName: Run regen/generation checks against TypeSpec Next + type: boolean + default: true + + # Primary Node.js version used by the artifact-emitting Build_linux job. Must match + # the PrimaryNodeVersion default in eng/emitters/pipelines/templates/stages/emitter-stages.yml. + - name: PrimaryNodeVersion + type: string + default: "24.x" + +extends: + template: /eng/common/pipelines/templates/1es-redirect.yml + + parameters: + stages: + - template: /eng/emitters/pipelines/templates/stages/emitter-stages.yml + parameters: + BuildPrereleaseVersion: true + UseTypeSpecNext: ${{ parameters.UseTypeSpecNext }} + Publish: "none" + PackagePath: /packages/http-client-csharp + EmitterPackageJsonPath: packages/http-client-csharp/package.json + PrimaryNodeVersion: ${{ parameters.PrimaryNodeVersion }} + Packages: + - name: typespec-http-client-csharp + file: typespec-http-client-csharp-*.tgz + type: npm + - name: Microsoft.TypeSpec.Generator + file: Microsoft.TypeSpec.Generator.*.nupkg + type: nuget + - name: Microsoft.TypeSpec.Generator.ClientModel + file: Microsoft.TypeSpec.Generator.ClientModel.*.nupkg + type: nuget + - name: Microsoft.TypeSpec.Generator.Input + file: Microsoft.TypeSpec.Generator.Input.*.nupkg + type: nuget + - name: Microsoft.TypeSpec.Generator.Customization + file: Microsoft.TypeSpec.Generator.Customization.*.nupkg + type: nuget + UnitTestArgs: -UnitTests + ${{ if parameters.RunRegenChecks }}: + TestMatrix: + RegenCheck: + TestArguments: -GenerationChecks + StagePrefix: "CSharp" + LanguageShortName: "csharp" + HasNugetPackages: true + CadlRanchName: "@typespec/http-client-csharp" + AdditionalInitializeSteps: + - task: UseDotNet@2 + inputs: + displayName: "Install .NET 8" + performMultiLevelLookup: true + useGlobalJson: false + version: 8.x + workingDirectory: $(Build.SourcesDirectory)/packages/http-client-csharp + - task: UseDotNet@2 + inputs: + displayName: "Install .NET 9" + performMultiLevelLookup: true + useGlobalJson: false + version: 9.x + workingDirectory: $(Build.SourcesDirectory)/packages/http-client-csharp + - task: UseDotNet@2 + inputs: + displayName: "Install .NET 10" + performMultiLevelLookup: true + useGlobalJson: true + workingDirectory: $(Build.SourcesDirectory)/packages/http-client-csharp From 42927da57e230b59a93e3a36d787c4ede5e50051 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Jul 2026 07:56:45 +0800 Subject: [PATCH 008/249] test(http-client-java): isolate unsupported route query expansion cases (#11263) The Java route end-to-end tests still left one unsupported query expansion explode case enabled after the earlier test split. This branch finishes that cleanup by grouping the remaining known-broken route query expansion cases under disabled coverage instead of letting them fail active runs. - **What changed** - Moved the remaining `testQueryExpansionExplode` route case into the disabled set in `routes/RouteTests`. - Kept the previously isolated record/map-valued query expansion cases in the same disabled section so unsupported route query expansion coverage is grouped consistently. - **Why this matters** - Active route tests now cover only supported query expansion behavior. - Known unsupported explode/object and record/map serialization cases remain visible in source without breaking the main test pass. - **Code shape** ```java @Test @Disabled("Blocked by current query object expansion serialization behavior for explode cases") public void testQueryExpansionExplode() { var client = new RoutesClientBuilder().buildQueryParametersQueryExpansionExplodeClient(); client.primitive("a"); client.array(List.of("a", "b")); client.model(new ExpandParameters("status", "active")); } ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com> Co-authored-by: Weidong Xu --- ...-new-end-to-end-cases-2026-6-15-9-37-11.md | 7 ++ .../booleannamespace/EncodeBooleanTests.java | 46 ++++++++++ .../encode/duration/EncodeDurationTests.java | 10 +++ .../java/parameters/query/QueryTests.java | 2 - .../src/test/java/routes/RouteTests.java | 37 ++++++-- .../DiscriminatedUnionTests.java | 87 +++++++++++++++++++ 6 files changed, 181 insertions(+), 8 deletions(-) create mode 100644 .chronus/changes/copilot-http-client-java-add-test-for-new-end-to-end-cases-2026-6-15-9-37-11.md create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/EncodeBooleanTests.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/type/union/discriminated/DiscriminatedUnionTests.java diff --git a/.chronus/changes/copilot-http-client-java-add-test-for-new-end-to-end-cases-2026-6-15-9-37-11.md b/.chronus/changes/copilot-http-client-java-add-test-for-new-end-to-end-cases-2026-6-15-9-37-11.md new file mode 100644 index 00000000000..bb80d8761ab --- /dev/null +++ b/.chronus/changes/copilot-http-client-java-add-test-for-new-end-to-end-cases-2026-6-15-9-37-11.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-java" +--- + +Add SpecialChars e2e test, encode/boolean test (disabled), and type/union/discriminated e2e tests \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/EncodeBooleanTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/EncodeBooleanTests.java new file mode 100644 index 00000000000..6528dfa1a7c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/booleannamespace/EncodeBooleanTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package encode.booleannamespace; + +import encode.booleannamespace.property.models.BoolAsStringProperty; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public class EncodeBooleanTests { + + private final BooleanClient client = new BooleanClientBuilder().buildClient(); + + @Test + @Disabled("@encode(string) on boolean is not yet supported by the emitter; boolean is serialized as JSON boolean instead of string") + public void testTrueLower() { + BoolAsStringProperty response = client.trueLower(new BoolAsStringProperty(true)); + Assertions.assertNotNull(response); + Assertions.assertTrue(response.isValue()); + } + + @Test + @Disabled("@encode(string) on boolean is not yet supported by the emitter; boolean is serialized as JSON boolean instead of string") + public void testFalseLower() { + BoolAsStringProperty response = client.falseLower(new BoolAsStringProperty(false)); + Assertions.assertNotNull(response); + Assertions.assertFalse(response.isValue()); + } + + @Test + @Disabled("@encode(string) on boolean is not yet supported by the emitter; boolean is serialized as JSON boolean instead of string") + public void testTrueUpper() { + BoolAsStringProperty response = client.trueUpper(new BoolAsStringProperty(true)); + Assertions.assertNotNull(response); + Assertions.assertTrue(response.isValue()); + } + + @Test + @Disabled("@encode(string) on boolean is not yet supported by the emitter; boolean is serialized as JSON boolean instead of string") + public void testFalseMixed() { + BoolAsStringProperty response = client.falseMixed(new BoolAsStringProperty(false)); + Assertions.assertNotNull(response); + Assertions.assertFalse(response.isValue()); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/EncodeDurationTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/EncodeDurationTests.java index 9313e9e9b66..3c0ca3271e1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/EncodeDurationTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/encode/duration/EncodeDurationTests.java @@ -28,6 +28,7 @@ public class EncodeDurationTests { private final QueryClient queryClient = new DurationClientBuilder().buildQueryClient(); private final HeaderClient headerClient = new DurationClientBuilder().buildHeaderClient(); private final PropertyClient propertyClient = new DurationClientBuilder().buildPropertyClient(); + private final LossyClient lossyClient = new DurationClientBuilder().buildLossyClient(); private static final Duration DAY40 = Duration.ofDays(40); private static final Duration SECOND35 = Duration.ofSeconds(35, 625_000_000); @@ -152,4 +153,13 @@ public void testProperty() { = propertyClient.floatMillisecondsArray(new FloatMillisecondsDurationArrayProperty(millisArray)); Assertions.assertEquals(millisArray, millisArrayRet.getValue()); } + + @Test + public void testLossy() { + // 36.25s has more precision than int32-seconds; floor/round/ceil are all acceptable (36 or 37) + lossyClient.intSeconds(Duration.ofMillis(36250)); + + // 36250.5ms has more precision than int32-milliseconds; floor/round/ceil are all acceptable (36250 or 36251) + lossyClient.intMilliseconds(Duration.ofNanos(36_250_500_000L)); + } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/parameters/query/QueryTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/parameters/query/QueryTests.java index 8f512938876..1186273a2b0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/parameters/query/QueryTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/parameters/query/QueryTests.java @@ -3,7 +3,6 @@ package parameters.query; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; public class QueryTests { @@ -17,7 +16,6 @@ public void testConstant() { } @Test - @Disabled("Blocked until @typespec/http-specs publishes the dollar-sign route fix") public void testDollarSign() { specialCharClient.dollarSign("status eq 'active'"); } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/routes/RouteTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/routes/RouteTests.java index 828d2be3ab5..453eb2fee6f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/routes/RouteTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/routes/RouteTests.java @@ -6,8 +6,11 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import java.util.List; +import java.util.Map; import java.util.Set; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import routes.models.ExpandParameters; public class RouteTests { @@ -68,23 +71,45 @@ public void testQueryExpansionContinuationStandard() { } @Test + public void buildQueryParametersQueryContinuationExplode() { + var client = new RoutesClientBuilder() + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS) + .setAllowedQueryParamNames(Set.of("fixed", "param"))) + .buildQueryParametersQueryContinuationExplodeClient(); + + client.primitive("a"); + + client.array(List.of("a", "b")); + } + + @Test + @Disabled("Blocked by current query object expansion serialization behavior for explode cases") public void testQueryExpansionExplode() { var client = new RoutesClientBuilder().buildQueryParametersQueryExpansionExplodeClient(); client.primitive("a"); client.array(List.of("a", "b")); + + client.model(new ExpandParameters("status", "active")); } @Test - public void buildQueryParametersQueryContinuationExplode() { - var client = new RoutesClientBuilder() + @Disabled("Blocked by current query record serialization behavior for map-valued params") + public void testQueryExpansionRecordCases() { + var standard = new RoutesClientBuilder().buildQueryParametersQueryExpansionStandardClient(); + standard.record(Map.of("a", 1, "b", 2)); + + var continuationStandard = new RoutesClientBuilder().buildQueryParametersQueryContinuationStandardClient(); + continuationStandard.record(Map.of("a", 1, "b", 2)); + + var explode = new RoutesClientBuilder().buildQueryParametersQueryExpansionExplodeClient(); + explode.record(Map.of("a", 1, "b", 2)); + + var continuationExplode = new RoutesClientBuilder() .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS) .setAllowedQueryParamNames(Set.of("fixed", "param"))) .buildQueryParametersQueryContinuationExplodeClient(); - - client.primitive("a"); - - client.array(List.of("a", "b")); + continuationExplode.record(Map.of("a", 1, "b", 2)); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/type/union/discriminated/DiscriminatedUnionTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/type/union/discriminated/DiscriminatedUnionTests.java new file mode 100644 index 00000000000..48199e265b1 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/type/union/discriminated/DiscriminatedUnionTests.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package type.union.discriminated; + +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled("Design not ready. The BinaryData based type is not a user-friendly design.") +public class DiscriminatedUnionTests { + + private final EnvelopeObjectDefaultClient envelopeDefaultClient + = new DiscriminatedClientBuilder().buildEnvelopeObjectDefaultClient(); + private final EnvelopeObjectCustomPropertiesClient envelopeCustomClient + = new DiscriminatedClientBuilder().buildEnvelopeObjectCustomPropertiesClient(); + private final NoEnvelopeDefaultClient noEnvelopeDefaultClient + = new DiscriminatedClientBuilder().buildNoEnvelopeDefaultClient(); + private final NoEnvelopeCustomDiscriminatorClient noEnvelopeCustomClient + = new DiscriminatedClientBuilder().buildNoEnvelopeCustomDiscriminatorClient(); + + @Test + public void testEnvelopeObjectDefaultGet() { + BinaryData result = envelopeDefaultClient.get(); + Assertions.assertNotNull(result); + String json = result.toString(); + Assertions.assertTrue(json.contains("\"kind\"")); + Assertions.assertTrue(json.contains("\"value\"")); + } + + @Test + public void testEnvelopeObjectDefaultPut() { + BinaryData input = BinaryData.fromString("{\"kind\":\"cat\",\"value\":{\"name\":\"Whiskers\",\"meow\":true}}"); + BinaryData result = envelopeDefaultClient.put(input); + Assertions.assertNotNull(result); + } + + @Test + public void testEnvelopeObjectCustomPropertiesGet() { + BinaryData result = envelopeCustomClient.get(); + Assertions.assertNotNull(result); + String json = result.toString(); + Assertions.assertTrue(json.contains("\"petType\"")); + Assertions.assertTrue(json.contains("\"petData\"")); + } + + @Test + public void testEnvelopeObjectCustomPropertiesPut() { + BinaryData input + = BinaryData.fromString("{\"petType\":\"cat\",\"petData\":{\"name\":\"Whiskers\",\"meow\":true}}"); + BinaryData result = envelopeCustomClient.put(input); + Assertions.assertNotNull(result); + } + + @Test + public void testNoEnvelopeDefaultGet() { + BinaryData result = noEnvelopeDefaultClient.get(); + Assertions.assertNotNull(result); + String json = result.toString(); + Assertions.assertTrue(json.contains("\"kind\"")); + Assertions.assertTrue(json.contains("\"name\"")); + } + + @Test + public void testNoEnvelopeDefaultPut() { + BinaryData input = BinaryData.fromString("{\"kind\":\"cat\",\"name\":\"Whiskers\",\"meow\":true}"); + BinaryData result = noEnvelopeDefaultClient.put(input); + Assertions.assertNotNull(result); + } + + @Test + public void testNoEnvelopeCustomDiscriminatorGet() { + BinaryData result = noEnvelopeCustomClient.get(); + Assertions.assertNotNull(result); + String json = result.toString(); + Assertions.assertTrue(json.contains("\"type\"")); + Assertions.assertTrue(json.contains("\"name\"")); + } + + @Test + public void testNoEnvelopeCustomDiscriminatorPut() { + BinaryData input = BinaryData.fromString("{\"type\":\"cat\",\"name\":\"Whiskers\",\"meow\":true}"); + BinaryData result = noEnvelopeCustomClient.put(input); + Assertions.assertNotNull(result); + } +} From 38060259395b664426328afb72397d12574a9083 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Jul 2026 01:24:50 +0000 Subject: [PATCH 009/249] feat(http-client-python): add encode/boolean Spector mock API tests + fix boolean-as-string encoding (#11087) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds Python SDK mock API test coverage for the `encode/boolean` Spector scenarios from #10875 (`@encode(string)` on boolean types). This required updating multiple layers of the Python codegen stack. ## Generator fixes **`types.ts` — property emission** Preserves boolean `@encode(string)` metadata from the compiler and maps it to the Python runtime’s `"str"` format token. **`primitive_types.py` — `BooleanType`** Detects `yaml_data["encode"] == "string"` and sets `self.encode = "str"`, mirroring `IntegerType`. **`model_base.py.jinja2`** Adds `_deserialize_bool_as_str` for case-insensitive string-to-boolean deserialization: ```python def _deserialize_bool_as_str(attr: str) -> bool: return attr.lower() == "true" ``` Also dispatches to it when `annotation is bool and rf._format == "str"`. ## Test coverage Adds sync and async tests for Azure and unbranded clients covering: - `trueLower` — `"true"` → `True` - `falseLower` — `"false"` → `False` - `trueUpper` — `"TRUE"` → `True` - `falseMixed` — `"FaLsE"` → `False` ## Dependencies - Uses `@typespec/compiler` 1.14, which supports boolean `@encode(string)`. - Uses `@typespec/http-specs` `0.1.0-alpha.39`, containing the `encode/boolean` scenarios. - Adds `encode/boolean` to `regenerate-common.ts`. ## Code diff: https://github.com/Azure/azure-sdk-for-python/pull/48067 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan --- ...on-encode-boolean-test-2026-6-24-23-0-0.md | 7 +++ .../http-client-python/emitter/src/types.ts | 8 +++- .../eng/scripts/ci/regenerate-common.ts | 3 ++ .../pygen/codegen/models/primitive_types.py | 5 +++ .../codegen/templates/model_base.py.jinja2 | 8 ++++ .../asynctests/test_encode_boolean_async.py | 43 +++++++++++++++++++ .../mock_api/azure/test_encode_boolean.py | 37 ++++++++++++++++ .../asynctests/test_encode_boolean_async.py | 43 +++++++++++++++++++ .../mock_api/unbranded/test_encode_boolean.py | 38 ++++++++++++++++ 9 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 .chronus/changes/python-encode-boolean-test-2026-6-24-23-0-0.md create mode 100644 packages/http-client-python/tests/mock_api/azure/asynctests/test_encode_boolean_async.py create mode 100644 packages/http-client-python/tests/mock_api/azure/test_encode_boolean.py create mode 100644 packages/http-client-python/tests/mock_api/unbranded/asynctests/test_encode_boolean_async.py create mode 100644 packages/http-client-python/tests/mock_api/unbranded/test_encode_boolean.py diff --git a/.chronus/changes/python-encode-boolean-test-2026-6-24-23-0-0.md b/.chronus/changes/python-encode-boolean-test-2026-6-24-23-0-0.md new file mode 100644 index 00000000000..957491f4c9e --- /dev/null +++ b/.chronus/changes/python-encode-boolean-test-2026-6-24-23-0-0.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/http-client-python" +--- + +Add mock API test coverage for `@encode(string)` on boolean properties (`encode/boolean` Spector scenarios). Fix Python generator to correctly serialize and deserialize boolean values encoded as strings (case-insensitive `true`/`false`) diff --git a/packages/http-client-python/emitter/src/types.ts b/packages/http-client-python/emitter/src/types.ts index 3f1a629f257..97619c96b7b 100644 --- a/packages/http-client-python/emitter/src/types.ts +++ b/packages/http-client-python/emitter/src/types.ts @@ -16,7 +16,7 @@ import { SdkUnionType, UsageFlags, } from "@azure-tools/typespec-client-generator-core"; -import { Type } from "@typespec/compiler"; +import { getEncode, Type } from "@typespec/compiler"; import { HttpAuth, Visibility } from "@typespec/http"; import { dump } from "js-yaml"; import { PythonSdkContext } from "./lib.js"; @@ -234,6 +234,10 @@ function emitProperty( addDisableGenerationMap(context, property.type); } const isNullable = !isMultipartFileInput && sourceType.kind === "nullable"; + const booleanEncode = + property.type.kind === "boolean" && property.__raw + ? getEncode(context.program, property.__raw) + : undefined; return { clientName: getClientName(property), isExactName: property.isExactName, @@ -252,7 +256,7 @@ function emitProperty( flatten: property.flatten, isMultipartFileInput: isMultipartFileInput, xmlMetadata: getXmlMetadata(property), - encode: property.encode, + encode: property.encode ?? (booleanEncode?.type.name === "string" ? "str" : undefined), clientDefaultValue: property.clientDefaultValue, }; } diff --git a/packages/http-client-python/eng/scripts/ci/regenerate-common.ts b/packages/http-client-python/eng/scripts/ci/regenerate-common.ts index 74c0c4a7457..630bee17c7c 100644 --- a/packages/http-client-python/eng/scripts/ci/regenerate-common.ts +++ b/packages/http-client-python/eng/scripts/ci/regenerate-common.ts @@ -184,6 +184,9 @@ export const AZURE_EMITTER_OPTIONS: Record< "client/overload": { namespace: "client.overload", }, + "encode/boolean": { + namespace: "encode.boolean", + }, "encode/duration": { namespace: "encode.duration", }, 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 6b4a4f8a444..e8a1d28c1f9 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 @@ -50,6 +50,11 @@ def default_template_representation_declaration(self) -> str: class BooleanType(PrimitiveType): + def __init__(self, yaml_data: dict[str, Any], code_model: "CodeModel") -> None: + super().__init__(yaml_data=yaml_data, code_model=code_model) + if yaml_data.get("encode") == "string": + self.encode = "str" + def serialization_type(self, **kwargs: Any) -> str: return "bool" 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 54821400d89..d6bb659a2ea 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 @@ -348,6 +348,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -375,6 +381,8 @@ _DESERIALIZE_MAPPING_WITHFORMAT = { def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: diff --git a/packages/http-client-python/tests/mock_api/azure/asynctests/test_encode_boolean_async.py b/packages/http-client-python/tests/mock_api/azure/asynctests/test_encode_boolean_async.py new file mode 100644 index 00000000000..3245fdb434e --- /dev/null +++ b/packages/http-client-python/tests/mock_api/azure/asynctests/test_encode_boolean_async.py @@ -0,0 +1,43 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +import pytest_asyncio +from encode.boolean.aio import BooleanClient +from encode.boolean import models + + +@pytest_asyncio.fixture +async def client(): + async with BooleanClient() as client: + yield client + + +@pytest.mark.asyncio +async def test_property_true_lower(client: BooleanClient): + result = await client.property.true_lower(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "true" + + +@pytest.mark.asyncio +async def test_property_false_lower(client: BooleanClient): + result = await client.property.false_lower(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "false" + + +@pytest.mark.asyncio +async def test_property_true_upper(client: BooleanClient): + result = await client.property.true_upper(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "TRUE" + + +@pytest.mark.asyncio +async def test_property_false_mixed(client: BooleanClient): + result = await client.property.false_mixed(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "FaLsE" diff --git a/packages/http-client-python/tests/mock_api/azure/test_encode_boolean.py b/packages/http-client-python/tests/mock_api/azure/test_encode_boolean.py new file mode 100644 index 00000000000..28a89fed980 --- /dev/null +++ b/packages/http-client-python/tests/mock_api/azure/test_encode_boolean.py @@ -0,0 +1,37 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +from encode.boolean import BooleanClient, models + + +@pytest.fixture +def client(): + with BooleanClient() as client: + yield client + + +def test_property_true_lower(client: BooleanClient): + result = client.property.true_lower(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "true" + + +def test_property_false_lower(client: BooleanClient): + result = client.property.false_lower(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "false" + + +def test_property_true_upper(client: BooleanClient): + result = client.property.true_upper(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "TRUE" + + +def test_property_false_mixed(client: BooleanClient): + result = client.property.false_mixed(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "FaLsE" diff --git a/packages/http-client-python/tests/mock_api/unbranded/asynctests/test_encode_boolean_async.py b/packages/http-client-python/tests/mock_api/unbranded/asynctests/test_encode_boolean_async.py new file mode 100644 index 00000000000..7083622bb99 --- /dev/null +++ b/packages/http-client-python/tests/mock_api/unbranded/asynctests/test_encode_boolean_async.py @@ -0,0 +1,43 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +import pytest_asyncio +from encode.boolean.aio import BooleanClient +from encode.boolean.property import models + + +@pytest_asyncio.fixture +async def client(): + async with BooleanClient() as client: + yield client + + +@pytest.mark.asyncio +async def test_property_true_lower(client: BooleanClient): + result = await client.property.true_lower(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "true" + + +@pytest.mark.asyncio +async def test_property_false_lower(client: BooleanClient): + result = await client.property.false_lower(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "false" + + +@pytest.mark.asyncio +async def test_property_true_upper(client: BooleanClient): + result = await client.property.true_upper(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "TRUE" + + +@pytest.mark.asyncio +async def test_property_false_mixed(client: BooleanClient): + result = await client.property.false_mixed(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "FaLsE" diff --git a/packages/http-client-python/tests/mock_api/unbranded/test_encode_boolean.py b/packages/http-client-python/tests/mock_api/unbranded/test_encode_boolean.py new file mode 100644 index 00000000000..0d98ed6416f --- /dev/null +++ b/packages/http-client-python/tests/mock_api/unbranded/test_encode_boolean.py @@ -0,0 +1,38 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +from encode.boolean import BooleanClient +from encode.boolean.property import models + + +@pytest.fixture +def client(): + with BooleanClient() as client: + yield client + + +def test_property_true_lower(client: BooleanClient): + result = client.property.true_lower(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "true" + + +def test_property_false_lower(client: BooleanClient): + result = client.property.false_lower(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "false" + + +def test_property_true_upper(client: BooleanClient): + result = client.property.true_upper(models.BoolAsStringProperty(value=True)) + assert result.value is True + assert result["value"] == "TRUE" + + +def test_property_false_mixed(client: BooleanClient): + result = client.property.false_mixed(models.BoolAsStringProperty(value=False)) + assert result.value is False + assert result["value"] == "FaLsE" From 6f86a25a924715d8669269ad4a7dfae8b0f758a3 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Jul 2026 09:58:56 +0800 Subject: [PATCH 010/249] Fix Python typing for bytes in typespec (#11233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Design design is approved in [teams channel](https://teams.microsoft.com/l/message/19:676a24a78b2247d091a259a1d3f88bc2@thread.v2/1783588388853?context=%7B%22contextType%22%3A%22chat%22%7D) ## Summary Add an `IO[bytes]` overload alongside `bytes` for binary `bytes` bodies in the Python emitter, to keep backward compatibility for services migrating from swagger (whose binary bodies were typed as `IO`). - [x] Add IO overload for binary `bytes` bodies in preprocess (`add_body_param_type`) - [x] Fix body serialization to avoid redundant/mypy-breaking isinstance branch when both overloads write raw content - [x] Describe `bytes` overload content-type param as "byte" body - [x] Add unit tests (`test_bytes_body_overloads.py`) — passing - [x] Add mock_api tests exercising the IO overload (sync + async) - [x] Regenerate all specs; encode-bytes & streaming-jsonl verified (mypy assignment error resolved) - [x] Full typecheck:generated run (was in progress at timeout) - [x] Add changelog entry (chronus) ## Code diff https://github.com/Azure/azure-sdk-for-python/pull/48040 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan --- ...bytes-body-io-overload-2026-7-14-3-14-0.md | 7 ++ .../pygen/codegen/models/operation.py | 12 +- .../codegen/serializers/builder_serializer.py | 55 +++++++++- .../generator/pygen/preprocess/__init__.py | 19 ++++ .../generator/pygen/utils.py | 2 +- .../asynctests/test_encode_bytes_async.py | 15 +++ .../mock_api/shared/test_encode_bytes.py | 14 +++ .../tests/unit/test_bytes_body_overloads.py | 103 ++++++++++++++++++ 8 files changed, 219 insertions(+), 8 deletions(-) create mode 100644 .chronus/changes/http-client-python_fix-bytes-body-io-overload-2026-7-14-3-14-0.md create mode 100644 packages/http-client-python/tests/unit/test_bytes_body_overloads.py diff --git a/.chronus/changes/http-client-python_fix-bytes-body-io-overload-2026-7-14-3-14-0.md b/.chronus/changes/http-client-python_fix-bytes-body-io-overload-2026-7-14-3-14-0.md new file mode 100644 index 00000000000..c404d49f8d4 --- /dev/null +++ b/.chronus/changes/http-client-python_fix-bytes-body-io-overload-2026-7-14-3-14-0.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-client-python" +--- + +Add an `IO[bytes]` overload alongside `bytes` for binary `bytes` bodies, keeping backward compatibility for services migrating from swagger whose binary bodies were typed as `IO`. 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 b63e4205dbd..7ba964132d0 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/operation.py +++ b/packages/http-client-python/generator/pygen/codegen/models/operation.py @@ -33,7 +33,7 @@ ) from .parameter_list import ParameterList from .model_type import ModelType -from .primitive_types import BinaryIteratorType, BinaryType +from .primitive_types import BinaryIteratorType, BinaryType, ByteArraySchema from .base import BaseType from .combined_type import CombinedType from .request_builder import OverloadedRequestBuilder, RequestBuilder @@ -224,7 +224,15 @@ def non_default_errors(self) -> list[Response]: @property def need_import_iobase(self) -> bool: - return self.parameters.has_body and isinstance(self.parameters.body_parameter.type, CombinedType) + if not (self.parameters.has_body and isinstance(self.parameters.body_parameter.type, CombinedType)): + return False + # For a binary `bytes` body the combined type is `bytes` + `IO[bytes]`. Both overloads + # serialize to raw content, so the body serialization collapses to a single assignment + # without an `isinstance` branch. In that case `IOBase` is never referenced, so avoid + # importing it to prevent an unused-import lint error in the generated code. + if any(isinstance(t, ByteArraySchema) for t in self.parameters.body_parameter.type.types): + return False + return True @staticmethod def has_kwargs_to_pop_with_default( 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 2a671d7b220..b1da889bed6 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 @@ -793,6 +793,34 @@ def _create_body_parameter( retval.extend(self._serialize_body_parameter(builder)) return retval + @staticmethod + def _collapsed_binary_bytes_overload(builder: OperationType) -> Optional[OperationType]: + """Return the binary overload of a binary ``bytes`` body, or ``None``. + + A binary ``bytes`` body pairs a ``bytes`` overload (binary content type) with the added + ``IO[bytes]`` overload. Both serialize to raw content on the same content kwarg, so body + serialization collapses to a single unconditional assignment. This returns the binary + overload to serialize in that case, or ``None`` when the isinstance branch is needed. + """ + if not builder.overloads: + return None + binary_ov = next( + (o for o in builder.overloads if isinstance(o.parameters.body_parameter.type, BinaryType)), None + ) + other_ov = next( + (o for o in builder.overloads if not isinstance(o.parameters.body_parameter.type, BinaryType)), None + ) + if ( + binary_ov is not None + and other_ov is not None + and isinstance(other_ov.parameters.body_parameter.type, ByteArraySchema) + and other_ov.parameters.body_parameter.default_content_type != "application/json" + and binary_ov.request_builder.parameters.body_parameter.client_name + == other_ov.request_builder.parameters.body_parameter.client_name + ): + return cast(OperationType, binary_ov) + return None + def _initialize_overloads(self, builder: OperationType, is_paging: bool = False) -> list[str]: retval: list[str] = [] # For paging, we put body parameter in local place outside `prepare_request` @@ -817,9 +845,26 @@ def _initialize_overloads(self, builder: OperationType, is_paging: bool = False) all_dpg_model_overloads = all( _is_dpg_or_typeddict_body(o.parameters.body_parameter) for o in builder.overloads ) - if not all_dpg_model_overloads: + # A binary `bytes` body pairs a `bytes` overload (binary content type) with the added + # `IO[bytes]` overload. Both serialize to raw content on the same content kwarg, so we + # emit a single unconditional assignment instead of an `isinstance` branch (which would be + # redundant and confuse mypy's type narrowing). Since the assignment is unconditional, the + # `_ = None` pre-init below is skipped for this case as well. + collapsed_binary_bytes_overload = self._collapsed_binary_bytes_overload(builder) + + if not all_dpg_model_overloads and collapsed_binary_bytes_overload is None: for v in sorted(set(client_names), key=client_names.index): retval.append(f"_{v} = None") + + if collapsed_binary_bytes_overload is not None: + collapsed_body_param = collapsed_binary_bytes_overload.parameters.body_parameter + if collapsed_body_param.default_content_type and not same_content_type: + retval.append( + f'content_type = content_type or "{collapsed_body_param.default_content_type}"{check_body_suffix}' + ) + retval.extend(self._create_body_parameter(collapsed_binary_bytes_overload)) + return retval + try: # if there is a binary overload, we do a binary check first. binary_overload = cast( @@ -827,6 +872,10 @@ def _initialize_overloads(self, builder: OperationType, is_paging: bool = False) next((o for o in builder.overloads if isinstance(o.parameters.body_parameter.type, BinaryType))), ) binary_body_param = binary_overload.parameters.body_parameter + other_overload = cast( + OperationType, + next((o for o in builder.overloads if not isinstance(o.parameters.body_parameter.type, BinaryType))), + ) retval.append(f"if {binary_body_param.type.instance_check_template.format(binary_body_param.client_name)}:") if binary_body_param.default_content_type and not same_content_type: retval.append( @@ -834,10 +883,6 @@ def _initialize_overloads(self, builder: OperationType, is_paging: bool = False) ) retval.extend(f" {l}" for l in self._create_body_parameter(binary_overload)) retval.append("else:") - other_overload = cast( - OperationType, - next((o for o in builder.overloads if not isinstance(o.parameters.body_parameter.type, BinaryType))), - ) retval.extend(f" {l}" for l in self._create_body_parameter(other_overload)) if other_overload.parameters.body_parameter.default_content_type and not same_content_type: retval.append( diff --git a/packages/http-client-python/generator/pygen/preprocess/__init__.py b/packages/http-client-python/generator/pygen/preprocess/__init__.py index 605ced4b4ed..b5149be1b47 100644 --- a/packages/http-client-python/generator/pygen/preprocess/__init__.py +++ b/packages/http-client-python/generator/pygen/preprocess/__init__.py @@ -399,6 +399,25 @@ def add_body_param_type( code_model: dict[str, Any], body_parameter: dict[str, Any], ): + # For a binary `bytes` body (e.g. content type application/octet-stream or a custom + # binary media type), add an IO overload alongside the `bytes` one. This keeps backward + # compatibility for services migrating from swagger, whose binary bodies were typed as IO. + is_multipart = self.is_tsp and has_multi_part_content_type(body_parameter) + is_binary_body = not has_json_content_type(body_parameter) and not is_multipart + if ( + body_parameter + and body_parameter["type"]["type"] == "bytes" + and is_binary_body + and self.options["models-mode"] != "typeddict" + and not any(t for t in ["flattened", "groupedBy"] if body_parameter.get(t)) + ): + body_parameter["type"] = { + "type": "combined", + "types": [body_parameter["type"], KNOWN_TYPES["binary"]], + } + code_model["types"].append(body_parameter["type"]) + return + # only add overload for special content type if ( # pylint: disable=too-many-boolean-expressions body_parameter diff --git a/packages/http-client-python/generator/pygen/utils.py b/packages/http-client-python/generator/pygen/utils.py index 15671b4f186..c3f27e78dad 100644 --- a/packages/http-client-python/generator/pygen/utils.py +++ b/packages/http-client-python/generator/pygen/utils.py @@ -109,7 +109,7 @@ def _get_value(value: Any) -> Any: def get_body_type_for_description(body_parameter: dict[str, Any]) -> str: - if body_parameter["type"]["type"] == "binary": + if body_parameter["type"]["type"] in ("binary", "bytes"): return "binary" if body_parameter["type"]["type"] == "string": return "string" diff --git a/packages/http-client-python/tests/mock_api/shared/asynctests/test_encode_bytes_async.py b/packages/http-client-python/tests/mock_api/shared/asynctests/test_encode_bytes_async.py index 5c57cb4281c..5383f336cb2 100644 --- a/packages/http-client-python/tests/mock_api/shared/asynctests/test_encode_bytes_async.py +++ b/packages/http-client-python/tests/mock_api/shared/asynctests/test_encode_bytes_async.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- +import io import pytest import pytest_asyncio from pathlib import Path @@ -123,6 +124,20 @@ async def test_request_body(client: BytesClient, png_data: bytes): ) +@pytest.mark.asyncio +async def test_request_body_io(client: BytesClient, png_data: bytes): + # binary bodies also accept an IO input via the generated overload + await client.request_body.default( + value=io.BytesIO(png_data), + ) + await client.request_body.octet_stream( + value=io.BytesIO(png_data), + ) + await client.request_body.custom_content_type( + value=io.BytesIO(png_data), + ) + + @pytest.mark.asyncio async def test_response_body(client: BytesClient, png_data: bytes): expected = b"test" diff --git a/packages/http-client-python/tests/mock_api/shared/test_encode_bytes.py b/packages/http-client-python/tests/mock_api/shared/test_encode_bytes.py index 2ca75a22c31..edd96d13313 100644 --- a/packages/http-client-python/tests/mock_api/shared/test_encode_bytes.py +++ b/packages/http-client-python/tests/mock_api/shared/test_encode_bytes.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- +import io from pathlib import Path import pytest @@ -119,6 +120,19 @@ def test_request_body(client: BytesClient, png_data: bytes): ) +def test_request_body_io(client: BytesClient, png_data: bytes): + # binary bodies also accept an IO input via the generated overload + client.request_body.default( + value=io.BytesIO(png_data), + ) + client.request_body.octet_stream( + value=io.BytesIO(png_data), + ) + client.request_body.custom_content_type( + value=io.BytesIO(png_data), + ) + + def test_response_body(client: BytesClient, png_data: bytes): expected = b"test" assert b"".join(client.response_body.default()) == png_data diff --git a/packages/http-client-python/tests/unit/test_bytes_body_overloads.py b/packages/http-client-python/tests/unit/test_bytes_body_overloads.py new file mode 100644 index 00000000000..547964e668b --- /dev/null +++ b/packages/http-client-python/tests/unit/test_bytes_body_overloads.py @@ -0,0 +1,103 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +"""Tests for the IO overload added to binary ``bytes`` bodies. + +TypeSpec ``bytes`` used with a binary content type (e.g. application/octet-stream +or a custom media type) is emitted as ``bytes``. To keep backward compatibility for +services migrating from swagger, whose binary bodies were typed as ``IO``, the +preprocess plugin adds an ``IO[bytes]`` overload alongside the ``bytes`` one. +""" +from pygen.preprocess import PreProcessPlugin, add_overloads_for_body_param + + +def _plugin(models_mode: str = "dpg") -> PreProcessPlugin: + return PreProcessPlugin( + output_folder="", + **{ + "version-tolerant": True, + "models-mode": models_mode, + "tsp_file": True, + "show-operations": True, + "show-send-request": True, + "builders-visibility": "public", + }, + ) + + +def _content_type_param() -> dict: + return { + "wireName": "Content-Type", + "clientName": "content_type", + "location": "header", + "optional": True, + "implementation": "Method", + "inOverload": False, + "inDocstring": True, + "type": {"type": "string"}, + } + + +def _bytes_body_operation(content_types: list) -> tuple[dict, dict]: + body_parameter = { + "wireName": "value", + "clientName": "value", + "location": "body", + "optional": False, + "implementation": "Method", + "contentTypes": content_types, + "type": {"type": "bytes"}, + } + yaml_data = { + "name": "upload", + "bodyParameter": body_parameter, + "parameters": [_content_type_param()], + "overloads": [], + "responses": [], + "exceptions": [], + } + code_model = {"types": []} + return code_model, yaml_data + + +def test_binary_bytes_body_adds_io_overload(): + """A binary ``bytes`` body gets a combined ``bytes``/``IO[bytes]`` type with two overloads.""" + plugin = _plugin() + code_model, yaml_data = _bytes_body_operation(["application/octet-stream"]) + body_parameter = yaml_data["bodyParameter"] + + plugin.add_body_param_type(code_model, body_parameter) + add_overloads_for_body_param(yaml_data) + + assert body_parameter["type"]["type"] == "combined" + member_types = [t["type"] for t in body_parameter["type"]["types"]] + assert member_types == ["bytes", "binary"] + assert len(yaml_data["overloads"]) == 2 + + +def test_json_bytes_body_stays_plain_bytes(): + """A ``bytes`` body with a JSON content type stays a plain ``bytes`` type (no IO overload).""" + plugin = _plugin() + code_model, yaml_data = _bytes_body_operation(["application/json"]) + body_parameter = yaml_data["bodyParameter"] + + plugin.add_body_param_type(code_model, body_parameter) + add_overloads_for_body_param(yaml_data) + + assert body_parameter["type"]["type"] == "bytes" + assert len(yaml_data["overloads"]) == 0 + + +def test_typeddict_mode_binary_bytes_body_stays_plain_bytes(): + """In typeddict-only mode the IO overload is skipped for binary ``bytes`` bodies.""" + plugin = _plugin("typeddict") + code_model, yaml_data = _bytes_body_operation(["application/octet-stream"]) + body_parameter = yaml_data["bodyParameter"] + + plugin.add_body_param_type(code_model, body_parameter) + add_overloads_for_body_param(yaml_data) + + assert body_parameter["type"]["type"] == "bytes" + assert len(yaml_data["overloads"]) == 0 From 7426a1ad754053fed25024827bd615a54f7e4a90 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Wed, 15 Jul 2026 19:47:18 -0700 Subject: [PATCH 011/249] fix(http-client-python): don't corrupt TypedDict literal values matching builtin names (#11268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem In the Python HTTP client emitter, a TypedDict literal value that coincides with a Python builtin type name got corrupted into `builtins.X` in the generated `types.py`: ```python class TypeParam(TypedDict, total=False): type: Required[Literal["builtins.type"]] # WRONG — should be Literal["type"] text: Required[str] ``` The TypeSpec source (`type: "type";`) is correct; the corruption is introduced purely by the emitter. ## Root cause `packages/http-client-python/generator/pygen/codegen/serializers/types_serializer.py` has a TypedDict-only builtin-shadowing workaround: when a field's wire name is a Python builtin type name (e.g. `bytes`, `int`, `type`) **and** a sibling field is annotated with that bare builtin, pyright errors `reportInvalidTypeForm` (the earlier field shadows the type). To avoid that, the serializer qualifies the builtin as `builtins.X`. Both the detection (`get_shadowed_builtins`) and the application (`_qualify_shadowed_builtins`) used a naive `\bname\b` regex that also matched **inside string literals** like `Literal["type"]`, so: - literal values (and quoted forward references) were rewritten into `builtins.X`, and - spurious `import builtins` statements were emitted. A second, related issue: detection ran against the *default* annotation while emission uses the `TYPES_FILE` annotation. Under `TYPES_FILE` some types change (`bytes`/`datetime` → `str`, `decimal` → `float`), so detection could both miss real shadowing and flag false ones. ## Fix - `_qualify_shadowed_builtins` and the detection helper are now **string-literal-aware**: the annotation is split on single/double-quoted spans and the `\bname\b` substitution only runs on code segments. A `(? still qualified ``` ## Tests - Added unit coverage in `tests/unit/test_typeddict.py` (36 pass), covering: (a) a Literal value coinciding with a builtin name is **not** rewritten; (b) a quoted forward reference is left untouched; (c) genuine sibling-builtin shadowing **is** qualified to `builtins.X`; (d) already-dotted names are not double-qualified; (e) no spurious `import builtins` for the false-positive; and (f) types that change under `TYPES_FILE` don't cause spurious imports. ## Regeneration Regenerated the full test corpus (azure + unbranded) with and without the change. **Zero diff** — the fix is behavior-preserving: - The existing genuine case (`typetest-union`, a field named `int` with `builtins.int` siblings) is retained unchanged. - No existing spec has a literal value that coincides with a builtin name, so the false-positive path isn't exercised by the corpus; it is covered directly by the new unit tests. ## Validation - `pytest tests/unit/test_typeddict.py` → 36 passed - pylint 10.00/10; black clean on changed lines Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- ...ral-builtin-corruption-2026-7-15-8-47-0.md | 7 + .../codegen/serializers/types_serializer.py | 52 +++++-- .../tests/unit/test_typeddict.py | 146 +++++++++++++++++- 3 files changed, 193 insertions(+), 12 deletions(-) create mode 100644 .chronus/changes/fix-typeddict-literal-builtin-corruption-2026-7-15-8-47-0.md diff --git a/.chronus/changes/fix-typeddict-literal-builtin-corruption-2026-7-15-8-47-0.md b/.chronus/changes/fix-typeddict-literal-builtin-corruption-2026-7-15-8-47-0.md new file mode 100644 index 00000000000..7cb17b79e9a --- /dev/null +++ b/.chronus/changes/fix-typeddict-literal-builtin-corruption-2026-7-15-8-47-0.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-client-python" +--- + +Fix a bug where a TypedDict literal value that coincides with a Python builtin type name (e.g. `type: "type"`) was corrupted into `Literal["builtins.type"]` in the generated `types.py`. The builtin-shadowing workaround now ignores identifiers inside string literals (literal values and quoted forward references are left untouched) and detects shadowing against the actually-emitted annotation, so genuine sibling-builtin shadowing is still qualified while spurious `import builtins` statements are no longer emitted. diff --git a/packages/http-client-python/generator/pygen/codegen/serializers/types_serializer.py b/packages/http-client-python/generator/pygen/codegen/serializers/types_serializer.py index 30e1cb802e4..77cfcb112af 100644 --- a/packages/http-client-python/generator/pygen/codegen/serializers/types_serializer.py +++ b/packages/http-client-python/generator/pygen/codegen/serializers/types_serializer.py @@ -40,13 +40,38 @@ ) +# Matches a single- or double-quoted string literal (escape-aware). Used to split an +# annotation so that bare-identifier rewriting/detection skips text inside string literals +# such as ``Literal["type"]`` values or quoted forward references like ``"SomeModel"``. +_STRING_LITERAL_RE = re.compile(r"""('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")""") + + +def _annotation_references_builtin(annotation: str, name: str) -> bool: + """Whether ``name`` appears as a bare (non-dotted) identifier outside any string literal.""" + pattern = re.compile(rf"(? str: - """Replace bare builtin type references with builtins.X when shadowed by a field name.""" + """Replace bare builtin type references with builtins.X when shadowed by a field name. + + Only bare identifiers in real type-expression positions are rewritten; identifiers + inside string literals (e.g. ``Literal["type"]`` values, quoted forward references) + and already-dotted names are left untouched. + """ if not shadowed: return annotation - for name in shadowed: - annotation = re.sub(rf"\b{name}\b", f"builtins.{name}", annotation) - return annotation + segments = _STRING_LITERAL_RE.split(annotation) + for index in range(0, len(segments), 2): # even indices are code, odd are string literals + segment = segments[index] + for name in shadowed: + segment = re.sub(rf"(? bool: """Whether any property wire_name is a Python keyword or requires functional TypedDict form.""" return any(keyword.iskeyword(p.wire_name) or not p.wire_name.isidentifier() for p in model.properties) - @staticmethod - def get_shadowed_builtins(model: ModelType) -> frozenset[str]: + def get_shadowed_builtins(self, model: ModelType) -> frozenset[str]: """Return the set of builtin type names shadowed by property wire_names in this model. - Only includes a builtin if it is both used as a wire_name AND referenced - in a type annotation within the same model (otherwise no shadowing occurs). + Only includes a builtin if it is both used as a wire_name AND referenced as a bare + type in an annotation within the same model (otherwise no shadowing occurs). Detection + uses the exact ``TYPES_FILE`` annotation emitted for each property so that types which + change under the types-file serialization (e.g. ``bytes``/``datetime`` -> ``str``, + ``decimal`` -> ``float``) are evaluated as they actually appear in the output. """ wire_builtins = {p.wire_name for p in model.properties if p.wire_name in _BUILTIN_TYPE_NAMES} if not wire_builtins: return frozenset() - # Check which of these builtins actually appear in type annotations + # Check which of these builtins actually appear in emitted type annotations used = set() for prop in model.properties: - annotation = prop.type_annotation() + annotation = prop.type_annotation( + serialize_namespace=self.serialize_namespace, + serialize_namespace_type=NamespaceType.TYPES_FILE, + ) for name in wire_builtins: - if re.search(rf"\b{name}\b", annotation): + if _annotation_references_builtin(annotation, name): used.add(name) return frozenset(used) diff --git a/packages/http-client-python/tests/unit/test_typeddict.py b/packages/http-client-python/tests/unit/test_typeddict.py index d4e1bd20845..3f26c2890fb 100644 --- a/packages/http-client-python/tests/unit/test_typeddict.py +++ b/packages/http-client-python/tests/unit/test_typeddict.py @@ -13,7 +13,7 @@ from pygen.codegen.models.model_type import TypedDictModelType from pygen.codegen.models.property import Property from pygen.codegen.models.list_type import ListType -from pygen.codegen.serializers.types_serializer import TypesSerializer +from pygen.codegen.serializers.types_serializer import TypesSerializer, _qualify_shadowed_builtins from pygen.codegen.serializers.unions_serializer import UnionsSerializer @@ -540,3 +540,147 @@ def test_enum_value_dpg_imports_enums_module(): enum_value = _make_enum_value(code_model) modules = _local_import_modules(enum_value.imports()) assert any("_enums" in module for module in modules) + + +# ---------- builtin-shadowing qualification (Literal-value false positives) ---------- + + +def _make_required_property(code_model, name, prop_type): + """Create a required Property named ``name`` whose type is ``prop_type``.""" + return Property( + yaml_data={"wireName": name, "clientName": name, "optional": False}, + code_model=code_model, + type=prop_type, + ) + + +def test_qualify_shadowed_builtins_ignores_literal_value(): + """A builtin name that only appears inside a ``Literal[...]`` value must not be rewritten.""" + # ``type`` is a builtin, but here it is a literal string value, not a type reference. + assert _qualify_shadowed_builtins('Required[Literal["type"]]', frozenset({"type"})) == 'Required[Literal["type"]]' + + +def test_qualify_shadowed_builtins_ignores_quoted_forward_reference(): + """A builtin name inside a quoted forward reference must not be rewritten.""" + assert _qualify_shadowed_builtins('list["type"]', frozenset({"type"})) == 'list["type"]' + + +def test_qualify_shadowed_builtins_rewrites_genuine_bare_reference(): + """A genuine bare builtin type reference is qualified as ``builtins.X``.""" + assert _qualify_shadowed_builtins("bytes", frozenset({"bytes"})) == "builtins.bytes" + # Only the bare reference is rewritten; the quoted forward reference is left untouched. + assert _qualify_shadowed_builtins('Union["Model", bytes]', frozenset({"bytes"})) == 'Union["Model", builtins.bytes]' + + +def test_qualify_shadowed_builtins_skips_already_dotted_names(): + """An already-qualified ``builtins.X`` reference must not be double-qualified.""" + assert _qualify_shadowed_builtins("builtins.bytes", frozenset({"bytes"})) == "builtins.bytes" + + +def test_qualify_shadowed_builtins_mixes_real_and_literal(): + """Within one annotation, a real reference is rewritten while a Literal value is preserved.""" + assert ( + _qualify_shadowed_builtins('dict[str, Literal["type"]]', frozenset({"type", "str"})) + == 'dict[builtins.str, Literal["type"]]' + ) + + +def test_literal_value_matching_builtin_not_detected_as_shadowed(): + """A ``Literal["type"]`` value must not make ``type`` count as a shadowed builtin. + + Regression: ``TypeParam`` has a ``type: Literal["type"]`` field and no sibling annotated + with the bare builtin ``type``, so no shadowing occurs. + """ + code_model = _make_code_model(models_mode="typeddict") + const = build_type({"type": "constant", "value": "type", "valueType": {"type": "string"}}, code_model) + text = build_type({"type": "string"}, code_model) + model = TypedDictModelType( + yaml_data={"name": "TypeParam", "type": "model", "snakeCaseName": "typeparam", "usage": 2}, + code_model=code_model, + properties=[ + _make_required_property(code_model, "type", const), + _make_required_property(code_model, "text", text), + ], + ) + env = _make_env() + ts = TypesSerializer(code_model=code_model, env=env, models=[model]) + assert ts.get_shadowed_builtins(model) == frozenset() + + +def test_literal_value_false_positive_no_builtins_import_and_value_preserved(): + """The reported bug: ``Literal["type"]`` must stay intact and no ``import builtins`` is added.""" + code_model = _make_code_model(models_mode="typeddict") + const = build_type({"type": "constant", "value": "type", "valueType": {"type": "string"}}, code_model) + text = build_type({"type": "string"}, code_model) + model = TypedDictModelType( + yaml_data={"name": "TypeParam", "type": "model", "snakeCaseName": "typeparam", "usage": 2}, + code_model=code_model, + properties=[ + _make_required_property(code_model, "type", const), + _make_required_property(code_model, "text", text), + ], + ) + code_model.model_types = [model] + + env = _make_env() + output = TypesSerializer(code_model=code_model, env=env, models=[model]).serialize() + assert 'Literal["type"]' in output + assert "builtins.type" not in output + assert "import builtins" not in output + + +def test_genuine_sibling_builtin_is_detected_and_qualified(): + """A field whose wire name shadows a builtin used bare by a sibling annotation must qualify. + + ``Numbers`` has ``int: str`` (wire name ``int``) and ``count: int``. The bare ``int`` in + ``count`` is emitted as-is in the types file, so pyright would resolve it to the earlier + field; it must be qualified as ``builtins.int``. + """ + code_model = _make_code_model(models_mode="typeddict") + str_type = build_type({"type": "string"}, code_model) + int_type = build_type({"type": "integer"}, code_model) + model = TypedDictModelType( + yaml_data={"name": "Numbers", "type": "model", "snakeCaseName": "numbers", "usage": 2}, + code_model=code_model, + properties=[ + _make_required_property(code_model, "int", str_type), + _make_required_property(code_model, "count", int_type), + ], + ) + code_model.model_types = [model] + + env = _make_env() + ts = TypesSerializer(code_model=code_model, env=env, models=[model]) + assert ts.get_shadowed_builtins(model) == frozenset({"int"}) + + output = ts.serialize() + assert "import builtins" in output + assert "count: Required[builtins.int]" in output + + +def test_type_changing_under_types_file_does_not_cause_spurious_builtins_import(): + """Detection must use the emitted annotation: a ``bytes`` field renders as ``str`` in types.py. + + ``Blob`` has ``bytes: int`` (wire name ``bytes``) and ``content: bytes``. In the types file a + bytes type is emitted as ``str``, so nothing genuinely references the bare builtin ``bytes`` + and no ``import builtins`` should be added. + """ + code_model = _make_code_model(models_mode="typeddict") + int_type = build_type({"type": "integer"}, code_model) + bytes_type = build_type({"type": "bytes", "encode": "base64"}, code_model) + model = TypedDictModelType( + yaml_data={"name": "Blob", "type": "model", "snakeCaseName": "blob", "usage": 2}, + code_model=code_model, + properties=[ + _make_required_property(code_model, "bytes", int_type), + _make_required_property(code_model, "content", bytes_type), + ], + ) + code_model.model_types = [model] + + env = _make_env() + ts = TypesSerializer(code_model=code_model, env=env, models=[model]) + assert ts.get_shadowed_builtins(model) == frozenset() + + output = ts.serialize() + assert "import builtins" not in output From d88ddc16cc7244ee3e196759f9d0daa98e0cb4bf Mon Sep 17 00:00:00 2001 From: Wei Hu Date: Thu, 16 Jul 2026 14:10:13 +0800 Subject: [PATCH 012/249] Use provider C# reference map with pre-write internalization (#10976) ## Summary Replaces the C# generator's Roslyn-generated reference-map/internalization path with a provider-based reference map that runs before files are written. The generator now computes reachability and accessibility from the in-memory provider model, filters unreachable providers up front, and removes stale generated files by cleaning `src/Generated` before writing. ## What changed - Build generated-code reachability from provider metadata, signatures, expressions/bodies, helper dependencies, custom-code roots, API-baseline roots, and provider relationships instead of Roslyn-generated documents. - Apply internal/public accessibility before output by updating providers directly, including model-factory filtering and XML-doc preservation for internalized types. - Remove the generated-code Roslyn removal/internalization post-processing path and related stale-file preservation logic. - Avoid stale generated-source state affecting current output, including old generated accessibility roots and stale `ModelFactory` usings. - Keep generated helper, serialization, MRW, custom-code body, and request-body dependencies tied to actual reachable generated code, including parent-namespace custom roots and provider/custom MRW body dependencies. - Avoid plugin-build stdout/stderr deadlocks by draining both streams asynchronously. ## Performance Latest full-generation benchmark on the updated benchmark branch (`mtg-manual-name-reduction-latest-bench`, commit `4cf86686e`) averaged **544.5 ms / 53.85 MB** with the provider reference map enabled vs **847.4 ms / 138.87 MB** with it disabled: **35.7% faster** and **61.2% less allocation**. | Run | Provider reference map off | Provider reference map on | Speedup | Allocation off | Allocation on | Allocation reduction | |---|---:|---:|---:|---:|---:|---:| | 1 | 822.2 ms | 531.6 ms | 35.3% | 138.35 MB | 51.64 MB | 62.7% | | 2 | 891.8 ms | 567.5 ms | 36.4% | 138.16 MB | 53.88 MB | 61.0% | | 3 | 828.1 ms | 534.4 ms | 35.5% | 140.10 MB | 56.03 MB | 60.0% | | **Average** | **847.4 ms** | **544.5 ms** | **35.7%** | **138.87 MB** | **53.85 MB** | **61.2%** | Benchmark artifacts/logs were saved locally under `/tmp/typespec-benchmark-results-latest-runs-20260710030912`. Azure SDK management-plane local project-reference regen speedups: Latest measured PR head: `434e76802` (`test(csharp): rename body dependency reference map tests`). Each package was regenerated one-by-one with `RegenSdkLocal.ps1 -Parallel 1` using the local Azure SDK for .NET project-reference setup. | SDK package | Main baseline | This PR | Improvement | |---|---:|---:|---:| | Azure.ResourceManager.Network | 00:37:01.9 | 00:07:00.9 | 81.1% faster / 5.28x | | Azure.ResourceManager.DataFactory | 00:13:43.4 | 00:03:26.2 | 75.0% faster / 3.99x | | Azure.ResourceManager.AppService | 00:10:46.9 | 00:03:17.6 | 69.5% faster / 3.27x | ## Validation - Latest targeted local Azure management-plane regens for `Azure.ResourceManager.Network`, `Azure.ResourceManager.DataFactory`, and `Azure.ResourceManager.AppService` passed one-by-one with no public API listing diffs. - C# emitter build and focused generator/reference-map tests pass. - Full Azure data-plane regen completed with no tracked SDK/library diffs. - Targeted data-plane regen/build checks pass with zero targeted generated diffs for: - `Azure.Data.AppConfiguration` (`ResponseError` MRW context coverage) - `Azure.AI.Projects` (custom-code parent-namespace body dependency root coverage) - `Azure.AI.Extensions.OpenAI` (polymorphic/unknown model retention coverage) - Latest `main` has been merged into the PR branch. --- .../BinaryContentHelperDefinition.cs | 3 + .../src/Providers/ClientOptionsProvider.cs | 75 +- .../src/Providers/ClientProvider.cs | 43 +- .../Providers/CollectionResultDefinition.cs | 16 + .../ModelReaderWriterContextDefinition.cs | 102 +- .../ModelSerializationExtensionsDefinition.cs | 3 + .../MrwSerializationTypeDefinition.Xml.cs | 6 +- .../MrwSerializationTypeDefinition.cs | 74 +- ...ultipartFormDataSerializationDefinition.cs | 3 + ...elineRequestHeadersExtensionsDefinition.cs | 4 +- .../src/Providers/PipelineRequestProvider.cs | 4 +- .../src/Providers/RestClientProvider.cs | 176 +- .../Providers/ScmMethodProviderCollection.cs | 3 +- .../SerializationFormatDefinition.cs | 2 + .../src/ScmCodeModelGenerator.cs | 17 + .../src/ScmOutputLibrary.cs | 24 +- .../src/Snippets/HttpRequestApiSnippets.cs | 4 +- .../Providers/ClientOptionsProviderTests.cs | 107 ++ .../ClientProviderCustomizationTests.cs | 3 +- ...ModelReaderWriterContextDefinitionTests.cs | 331 +++- .../ModelWithProjectedProperty.cs | 12 + .../SampleContext.cs | 9 + .../SystemObjectModelSerializationTests.cs | 34 - .../RestClientProviderTests.cs | 251 ++- .../TestClient.cs | 20 + .../Generated/TestClientOptions.cs | 16 + .../TestClientOptions.cs | 15 + .../ClientA.cs | 6 + .../ClientB.cs | 6 + .../InternalClient.cs | 6 + .../ClientBodyDependencyReferenceMapTests.cs | 948 +++++++++++ .../test/TestHelpers/MockHelpers.cs | 17 +- .../src/CSharpGen.cs | 97 +- .../src/CodeModelGenerator.cs | 22 +- .../PostProcessing/GeneratedCodeWorkspace.cs | 29 +- .../src/PostProcessing/PostProcessor.cs | 669 -------- .../src/PostProcessing/ReferenceMap.cs | 70 - .../src/PostProcessing/ReferenceMapBuilder.cs | 306 ---- .../src/Primitives/TypeProviderWriter.cs | 9 +- .../src/Providers/CanonicalTypeProvider.cs | 20 +- .../src/Providers/ModelFactoryProvider.cs | 2 + .../src/Providers/NamedTypeSymbolProvider.cs | 414 +++++ .../src/Providers/TypeProvider.cs | 93 +- ...iderReferenceMapAnalyzer.BodyReferences.cs | 609 +++++++ ...ProviderReferenceMapAnalyzer.Candidates.cs | 575 +++++++ .../ProviderReferenceMapAnalyzer.Helpers.cs | 915 +++++++++++ .../ProviderReferenceMapAnalyzer.cs | 559 +++++++ .../ProviderReferenceMapResult.cs | 15 + .../ProviderReferenceMapSession.cs | 28 + .../src/SourceInput/SourceInputHelper.cs | 18 +- .../src/SourceInput/SourceInputModel.cs | 96 +- .../src/Statements/XmlDocStatement.cs | 2 + .../src/TypeFactory.cs | 20 +- .../src/Utilities/TypeSymbolExtensions.cs | 61 +- .../test/OutputLibraryVisitorTests.cs | 63 + .../test/PostProcessing/PostProcessorTests.cs | 307 ---- .../DoesNotRemoveValidAttributes.cs | 11 - .../DoesNotRemoveValidAttributes.cs | 15 - .../DoesNotRemoveValidAttributes/Model.cs | 6 - .../DoesNotRemoveValidAttributes/RootClass.cs | 7 - .../DoesNotRemoveValidUsings.cs | 11 - .../DoesNotRemoveValidUsings/Model.cs | 6 - .../RemovesInvalidAttributes.cs | 10 - .../RemovesInvalidAttributes/Model.cs | 6 - .../RemovesInvalidAttributes.cs | 15 - .../RemovesInvalidAttributes/RootClass.cs | 7 - ...nvalidAttributesAndKeepsValidAttributes.cs | 11 - .../Model.cs | 6 - ...nvalidAttributesAndKeepsValidAttributes.cs | 16 - .../RootClass.cs | 7 - ...AttributesAndKeepsValidAttributesNoDocs.cs | 8 - .../Model.cs | 6 - ...AttributesAndKeepsValidAttributesNoDocs.cs | 13 - .../RootClass.cs | 7 - .../RemovesInvalidUsings/Model.cs | 6 - .../RemovesInvalidUsings.cs | 11 - .../EnumProviders/EnumProviderTests.cs | 7 +- .../ModelFactoriesCustomizationTests.cs | 26 + .../DerivedModel.cs | 9 + .../ClientCustomizationTests.cs | 2 +- .../ModelProviders/ModelProviderTests.cs | 16 +- .../NamedTypeSymbolProviderTests.cs | 89 + .../CustomClient.cs | 12 + .../CustomModel.cs | 6 + .../CustomApi.cs | 9 + .../CustomApi.cs | 12 + .../CustomApi.cs | 9 + .../NestedTypes.cs | 19 + .../test/Providers/TypeProviderTests.cs | 2 +- .../ProviderReferenceMapAnalyzerTests.cs | 1464 +++++++++++++++++ .../LastContract.cs | 17 + .../test/TestHelpers/TestOutputLibrary.cs | 5 + .../GenericContainer.cs | 6 + .../Utilities/TypeSymbolExtensionsTests.cs | 41 + .../Models/ParametersBasicContext.cs | 1 - .../Generated/ParametersBasicModelFactory.cs | 1 - .../Models/ParametersSpreadContext.cs | 1 - .../Generated/ParametersSpreadModelFactory.cs | 2 - .../Models/PayloadMultiPartContext.cs | 1 - .../Generated/PayloadMultiPartModelFactory.cs | 1 - .../Models/PayloadPageableContext.cs | 3 - .../Generated/PayloadPageableModelFactory.cs | 5 - .../Generated/Models/SpecialWordsContext.cs | 1 - .../src/Generated/SpecialWordsModelFactory.cs | 2 - 104 files changed, 7453 insertions(+), 1840 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs index a2ee813e298..936a8501435 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs @@ -35,6 +35,9 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); + protected override IReadOnlyList BuildBodyDependencyTypes() => + [ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.Type]; + protected override MethodProvider[] BuildMethods() { var methods = new List diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs index 24c20fd2c0e..c62e74461fd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs @@ -27,13 +27,20 @@ public class ClientOptionsProvider : TypeProvider private readonly InputClient _inputClient; private readonly ClientProvider _clientProvider; - private readonly Dictionary? _serviceVersionsEnums; + private readonly Lazy?> _serviceVersionsEnums; private static ClientOptionsProvider? _singletonInstance; + // All clients sharing the singleton are tracked so its accessibility reflects every owner. + private static readonly List _singletonClientProviders = []; internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientProvider) { _inputClient = inputClient; _clientProvider = clientProvider; + _serviceVersionsEnums = new(BuildServiceVersionsEnums); + } + + private Dictionary? BuildServiceVersionsEnums() + { List inputEnums = [.. _inputClient.Parameters .Where(p => p.IsApiVersion && p.Type is InputEnumType) .Select(p => (InputEnumType)p.Type)]; @@ -45,7 +52,7 @@ internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientPro if (inputEnums.Count > 0) { - _serviceVersionsEnums = []; + Dictionary serviceVersionsEnums = []; foreach (var inputEnum in inputEnums) { var enumProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateEnum(inputEnum, this); @@ -53,7 +60,7 @@ internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientPro { // Ensure the service version enum uses the same namespace as the options class since it is nested. enumProvider.Update(@namespace: Type.Namespace); - _serviceVersionsEnums.Add(inputEnum, enumProvider); + serviceVersionsEnums.Add(inputEnum, enumProvider); } // Only create one version property for single service clients @@ -62,7 +69,11 @@ internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientPro break; } } + + return serviceVersionsEnums; } + + return null; } /// @@ -77,12 +88,15 @@ public static ClientOptionsProvider CreateClientOptionsProvider(InputClient inpu { if (UseSingletonInstance(inputClient)) { - // Use singleton instance if (_singletonInstance == null) { - // Create singleton with namespace-based naming + _singletonClientProviders.Clear(); _singletonInstance = new ClientOptionsProvider(inputClient, clientProvider); } + if (!_singletonClientProviders.Contains(clientProvider)) + { + _singletonClientProviders.Add(clientProvider); + } return _singletonInstance; } @@ -160,13 +174,14 @@ private static bool UseSingletonInstance(InputClient inputClient) private Dictionary? BuildVersionProperties() { - if (_serviceVersionsEnums is null) + var serviceVersionsEnums = _serviceVersionsEnums.Value; + if (serviceVersionsEnums is null) { return null; } - var properties = new Dictionary(_serviceVersionsEnums.Count); - foreach (var (inputEnum, enumProvider) in _serviceVersionsEnums) + var properties = new Dictionary(serviceVersionsEnums.Count); + foreach (var (inputEnum, enumProvider) in serviceVersionsEnums) { string versionPropertyName; if (!_inputClient.IsMultiServiceClient) @@ -177,10 +192,10 @@ private static bool UseSingletonInstance(InputClient inputClient) { var serviceNamespace = inputEnum.Namespace; if (!string.IsNullOrEmpty(serviceNamespace) && - ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys)) + ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, serviceVersionsEnums.Keys)) { // Last segment collides — find the shortest unique namespace suffix. - string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys); + string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, serviceVersionsEnums.Keys); versionPropertyName = $"{uniquePrefix.ToIdentifierName()}{ApiVersionSuffix}"; } else @@ -205,13 +220,14 @@ private static bool UseSingletonInstance(InputClient inputClient) private Dictionary? BuildLatestVersionsFields() { - if (_serviceVersionsEnums is null) + var serviceVersionsEnums = _serviceVersionsEnums.Value; + if (serviceVersionsEnums is null) { return null; } - Dictionary latestVersionFields = new(_serviceVersionsEnums.Count); - foreach (var (inputEnum, enumProvider) in _serviceVersionsEnums) + Dictionary latestVersionFields = new(serviceVersionsEnums.Count); + foreach (var (inputEnum, enumProvider) in serviceVersionsEnums) { string fieldName; if (!_inputClient.IsMultiServiceClient) @@ -222,10 +238,10 @@ private static bool UseSingletonInstance(InputClient inputClient) { var serviceNamespace = inputEnum.Namespace; if (!string.IsNullOrEmpty(serviceNamespace) && - ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys)) + ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, serviceVersionsEnums.Keys)) { // Last segment collides — find the shortest unique namespace suffix. - string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys); + string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, serviceVersionsEnums.Keys); fieldName = $"{LatestPrefix}{uniquePrefix.ToIdentifierName()}{VersionSuffix}"; } else @@ -248,6 +264,30 @@ private static bool UseSingletonInstance(InputClient inputClient) protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs"); + // TODO https://github.com/microsoft/typespec/issues/11181: Remove this once generated source parity no longer depends on internal ClientOptions XML docs. + protected override bool ShouldWriteTypeXmlDocs => CustomCodeView is null; + + protected override TypeSignatureModifiers BuildDeclarationModifiers() + { + if (this == _singletonInstance) + { + foreach (var clientProvider in _singletonClientProviders) + { + if (clientProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + return TypeSignatureModifiers.Public; + } + } + + return TypeSignatureModifiers.Internal; + } + + return GetAccessibilityModifiers(_clientProvider.DeclarationModifiers); + } + + private static TypeSignatureModifiers GetAccessibilityModifiers(TypeSignatureModifiers modifiers) + => modifiers & (TypeSignatureModifiers.Public | TypeSignatureModifiers.Internal | TypeSignatureModifiers.Protected | TypeSignatureModifiers.Private); + protected override string BuildName() { if (UseSingletonInstance(_inputClient)) @@ -289,12 +329,13 @@ protected override FieldProvider[] BuildFields() protected override TypeProvider[] BuildNestedTypes() { - if (_serviceVersionsEnums is null) + var serviceVersionsEnums = _serviceVersionsEnums.Value; + if (serviceVersionsEnums is null) { return []; } - return [.. _serviceVersionsEnums.Values.OrderBy(e => e.Name)]; + return [.. serviceVersionsEnums.Values.OrderBy(e => e.Name)]; } protected override ConstructorProvider[] BuildConstructors() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs index b6e2d9cc78a..b3eec2a1aa7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs @@ -25,6 +25,8 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { public class ClientProvider : TypeProvider { + protected override bool IsClientProvider => true; + 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); @@ -72,7 +74,9 @@ private record ApiVersionFields(FieldProvider Field, PropertyProvider? Correspon /// internal TypeProvider BackCompatProvider => _backCompatProvider ?? this; - public ParameterProvider? ClientOptionsParameter { get; } + private ParameterProvider? _clientOptionsParameter; + public ParameterProvider? ClientOptionsParameter + => ClientOptions is null ? null : _clientOptionsParameter ??= ScmKnownParameters.ClientOptions(ClientOptions.Type); protected override FormattableString BuildDescription() { @@ -108,7 +112,6 @@ public ClientProvider(InputClient inputClient) _subClientEndpointParameter = BuildSubClientEndpointParameter(); _publicCtorDescription = $"Initializes a new instance of {Name}."; ClientOptions = _inputClient.Parent is null ? ClientOptionsProvider.CreateClientOptionsProvider(_inputClient, this) : null; - ClientOptionsParameter = ClientOptions != null ? ScmKnownParameters.ClientOptions(ClientOptions.Type) : null; bool isIndividuallyInitialized = (_inputClient.InitializedBy & InputClientInitializedBy.Individually) != 0; ClientSettings = isIndividuallyInitialized && DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public) @@ -426,6 +429,42 @@ private IReadOnlyList GetClientParameters() protected override string BuildName() => _inputClient.IsExactName ? _inputClient.Name : _inputClient.Name.ToIdentifierName(); + protected override IReadOnlyList BuildHelperDependencyTypes() + { + foreach (var method in Methods.OfType()) + { + if (method.BodyStatements != null) + { + return [ScmCodeModelGenerator.Instance.ClientPipelineExtensionsDefinition.Type]; + } + } + + return []; + } + + protected override IReadOnlyList BuildBodyDependencyTypes() + { + var dependencies = new List(); + foreach (var method in Methods.OfType()) + { + if (method.BodyStatements == null) + { + continue; + } + + if (method.CollectionDefinition != null) + { + dependencies.Add(method.CollectionDefinition.Type); + } + + // Service method metadata can mention wire-only request/response models that are not + // emitted in the generated method signature or body. The graph builder and structured + // body scanner capture the generated types that are actually referenced. + } + + return dependencies; + } + protected override FieldProvider[] BuildFields() { List fields = [EndpointField]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs index 62f28d86c8d..b734d9a6529 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs @@ -217,6 +217,22 @@ private bool HasPagingOperationNameCollision(string operationName) protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Internal | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class; + protected override IReadOnlyList BuildBodyDependencyTypes() + { + var dependencies = new List { Client.Type, ResponseModelType, NextPagePropertyType }; + if (ItemModelType != null) + { + dependencies.Add(ItemModelType); + } + + foreach (var field in RequestFields) + { + dependencies.Add(field.Type); + } + + return dependencies; + } + protected override FieldProvider[] BuildFields() => [ClientField, .. RequestFields]; protected override CSharpType[] BuildImplements() => diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs index 947302cbe17..7d5cc8976e6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.TypeSpec.Generator.Expressions; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; using Microsoft.TypeSpec.Generator.Statements; @@ -32,14 +33,30 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override CSharpType BuildBaseType() => typeof(ModelReaderWriterContext); + // Buildable attributes depend on the final set of providers selected by the reference map. + // They are rebuilt at write time while non-buildable attributes, including visitor updates, are preserved. + protected override bool ShouldAnalyzeAttributesInReferenceMap => false; + + protected override IReadOnlyList BuildAttributesForWrite() + { + var visitorAttributes = base.BuildAttributesForWrite().Where(static attribute => !IsBuildableAttribute(attribute)); + return [.. BuildAttributes(), .. visitorAttributes]; + } + protected override IReadOnlyList BuildAttributes() { var attributes = new Dictionary(); + var customizedBuildableTypes = GetCustomizedBuildableTypes(); // Add ModelReaderWriterBuildableAttribute for all IPersistableModel types (HashSet buildableTypes, HashSet buildableProviders) = CollectBuildableTypes(); foreach (var type in buildableTypes) { + if (customizedBuildableTypes.Contains(GetTypeIdentity(type))) + { + continue; + } + // Use the full attribute type name to ensure proper compilation var attributeType = new CSharpType(typeof(ModelReaderWriterBuildableAttribute)); var attributeStatement = new AttributeStatement(attributeType, TypeOf(type)); @@ -56,6 +73,11 @@ protected override IReadOnlyList BuildAttributes() } foreach (var provider in buildableProviders) { + if (!ShouldWriteProvider(provider) || customizedBuildableTypes.Contains(GetTypeIdentity(provider.Type))) + { + continue; + } + // Use the full attribute type name to ensure proper compilation var attributeType = new CSharpType(typeof(ModelReaderWriterBuildableAttribute)); var attributeStatement = new AttributeStatement(attributeType, TypeOf(provider.Type)); @@ -76,6 +98,51 @@ protected override IReadOnlyList BuildAttributes() return attributes.OrderBy(a => GetSimpleTypeName(a.Key)).Select(kvp => kvp.Value).ToList(); } + private static bool IsBuildableAttribute(MethodBodyStatement statement) + { + var attribute = statement switch + { + AttributeStatement directAttribute => directAttribute, + SuppressionStatement suppression => suppression.AsStatement(), + _ => null + }; + + return attribute?.Type.Equals(typeof(ModelReaderWriterBuildableAttribute)) == true; + } + + private HashSet GetCustomizedBuildableTypes() + { + var customizedTypes = new HashSet(StringComparer.Ordinal); + foreach (var attribute in CustomCodeView?.Attributes ?? []) + { + if (!string.Equals( + attribute.Type.FullyQualifiedName, + typeof(ModelReaderWriterBuildableAttribute).FullName, + StringComparison.Ordinal)) + { + continue; + } + + foreach (var argument in attribute.Arguments) + { + if (argument is TypeOfExpression typeOf) + { + customizedTypes.Add(GetTypeIdentity(typeOf.Type)); + } + } + } + + return customizedTypes; + } + + private static string GetTypeIdentity(CSharpType type) + { + var name = type.FullyQualifiedName.TrimStart('.'); + return type.Arguments.Count == 0 + ? name + : $"{name}<{string.Join(",", type.Arguments.Select(GetTypeIdentity))}>"; + } + /// /// Collects all types that implement IPersistableModel, including all models and their properties /// that are also IPersistableModel types, recursively without duplicates. @@ -87,7 +154,6 @@ protected override IReadOnlyList BuildAttributes() var visitedBaseProviders = new HashSet(ReferenceEqualityComparer.Instance); var buildableProviders = new HashSet(s_typeProviderNameComparer); var buildableTypes = new HashSet(s_cSharpTypeNameComparer); - // Base-model traversal can encounter equivalent provider instances that are not reference-equal to // the output-library roots, so keep the output-library provider set name-comparable. var contextEligibleOutputProviders = new HashSet( @@ -97,8 +163,13 @@ protected override IReadOnlyList BuildAttributes() // Process each output-library provider recursively to discover types from methods and properties. foreach (var provider in contextEligibleOutputProviders) { + if (!ShouldWriteProvider(provider)) + { + continue; + } + // Only output-library providers get standalone context entries. - if (ImplementsModelReaderWriter(provider)) + if (ShouldAddStandaloneBuildableProvider(provider)) { buildableProviders.Add(provider); } @@ -190,9 +261,10 @@ private void CollectBuildableTypesRecursiveCore( { // Traverse base model properties for discoverable types, but do not add the base model // itself as a context entry unless it was in the output-library seed set. - if (visitedBaseProviders.Add(modelProvider.BaseModelProvider)) + var baseModelProvider = modelProvider.BaseModelProvider; + if (visitedBaseProviders.Add(baseModelProvider)) { - CollectBuildableTypesRecursiveCore(modelProvider.BaseModelProvider, visitedTypes, visitedTypeProviders, visitedBaseProviders, buildableProviders, buildableTypes); + CollectBuildableTypesRecursiveCore(baseModelProvider, visitedTypes, visitedTypeProviders, visitedBaseProviders, buildableProviders, buildableTypes); } } else @@ -220,6 +292,11 @@ private void CollectBuildableTypesFromFrameworkType( try { + if (!IsResolvableBuildableType(frameworkType)) + { + return; + } + buildableTypes.Add(frameworkType.FrameworkType); var type = frameworkType.FrameworkType; var properties = type.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); @@ -426,6 +503,23 @@ private static bool ImplementsModelReaderWriter(TypeProvider typeProvider) return false; } + private static bool ShouldAddStandaloneBuildableProvider(TypeProvider provider) + => IsResolvableBuildableType(provider.Type) + && ImplementsModelReaderWriter(provider) + && HasWritableModelReaderWriterSerialization(provider); + + private static bool HasWritableModelReaderWriterSerialization(TypeProvider provider) + { + if (provider is not ModelProvider) + { + return true; + } + + return provider.SerializationProviders + .OfType() + .Any(ShouldWriteProvider); + } + private static void AddAttributeForType( Dictionary attributes, AttributeStatement attributeStatement, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs index f6f6cebbd49..ddd5ffff87b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs @@ -108,6 +108,9 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override string BuildName() => "ModelSerializationExtensions"; + protected override IReadOnlyList BuildBodyDependencyTypes() => + [ScmCodeModelGenerator.Instance.TypeFormattersDefinition.Type]; + protected override FieldProvider[] BuildFields() { return [WireOptionsField, _jsonDocumentOptionsField, .. BuildXmlFields()]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs index 5d76b8f44a1..2b50fff372e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs @@ -67,7 +67,7 @@ private MethodProvider BuildXmlModelWriteCoreMethod() MethodSignatureModifiers modifiers = _isStruct ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Internal | MethodSignatureModifiers.Virtual; - if (_shouldOverrideXmlMethods) + if (_shouldOverrideMethods) { modifiers = MethodSignatureModifiers.Internal | MethodSignatureModifiers.Override; } @@ -81,7 +81,7 @@ private MethodProvider BuildXmlModelWriteCoreMethod() private MethodBodyStatement[] BuildXmlModelWriteCoreMethodBody() { - var categorizedProperties = _shouldOverrideXmlMethods + var categorizedProperties = _shouldOverrideMethods ? CategorizedXmlProperties : AllCategorizedXmlProperties; var statements = new List @@ -90,7 +90,7 @@ private MethodBodyStatement[] BuildXmlModelWriteCoreMethodBody() MethodBodyStatement.EmptyLine }; - if (_shouldOverrideXmlMethods) + if (_shouldOverrideMethods) { statements.Add(Base.Invoke(XmlModelWriteCoreMethodName, _xmlWriterParameter, _serializationOptionsParameter).Terminate()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs index 16ac19e14e9..adbb3026dda 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs @@ -53,16 +53,10 @@ public partial class MrwSerializationTypeDefinition : TypeProvider private readonly ScopedApi _mrwOptionsParameterSnippet; private readonly ScopedApi _jsonElementParameterSnippet; private readonly ScopedApi _isNotEqualToWireConditionSnippet; - // These interface types depend on _model.Type. Build them lazily so we do not cache a - // CSharpType before delayed base model resolution has updated the model's inheritance. - private CSharpType? _jsonModelTInterfaceValue; - private CSharpType _jsonModelTInterface => _jsonModelTInterfaceValue ??= new CSharpType(typeof(IJsonModel<>), SerializationInterfaceType.Type); - private CSharpType? _jsonModelObjectInterface; - private CSharpType? JsonModelObjectInterface => _isStruct ? _jsonModelObjectInterface ??= (CSharpType)typeof(IJsonModel) : null; - private CSharpType? _persistableModelTInterfaceValue; - private CSharpType _persistableModelTInterface => _persistableModelTInterfaceValue ??= new CSharpType(typeof(IPersistableModel<>), SerializationInterfaceType.Type); - private CSharpType? _persistableModelObjectInterface; - private CSharpType? PersistableModelObjectInterface => _isStruct ? _persistableModelObjectInterface ??= (CSharpType)typeof(IPersistableModel) : null; + private readonly CSharpType _jsonModelTInterface; + private readonly CSharpType? _jsonModelObjectInterface; + private readonly CSharpType _persistableModelTInterface; + private readonly CSharpType? _persistableModelObjectInterface; private readonly ModelProvider _model; private readonly InputModelType _inputModel; private readonly FieldProvider? _rawDataField; @@ -73,20 +67,10 @@ public partial class MrwSerializationTypeDefinition : TypeProvider private readonly bool _supportsXml; private ConstructorProvider? _serializationConstructor; // Flag to determine if the model should override the serialization methods - private bool? _shouldOverrideMethods; - private bool ShouldOverrideMethods => _shouldOverrideMethods ??= _model.BaseModelProvider != null && !_isStruct; - private bool? _shouldSkipSerializationMethodOverrides; - private bool ShouldSkipSerializationMethodOverrides => _shouldSkipSerializationMethodOverrides ??= ShouldSkipDerivedSerializationMethodOverrides(_model.BaseModelProvider); - private readonly bool _shouldOverrideXmlMethods; + private readonly bool _shouldOverrideMethods; + private readonly bool _shouldSkipDerivedSerializationMethodOverrides; private readonly Lazy _additionalProperties; - // Unknown discriminator models use their base model as the serialization interface type. - // This can also touch model.Type, so defer it until serialization method/interface emission. - private TypeProvider SerializationInterfaceType => _serializationInterfaceType ??= _inputModel.IsUnknownDiscriminatorModel - ? ScmCodeModelGenerator.Instance.TypeFactory.CreateModel(_inputModel.BaseModel!)! - : _model; - private TypeProvider? _serializationInterfaceType; - private CSharpType RootType => _rootType ??= GetRootModelType(); private CSharpType? _rootType; @@ -100,10 +84,17 @@ public MrwSerializationTypeDefinition(InputModelType inputModel, ModelProvider m _isStruct = _model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Struct); _supportsXml = inputModel.Usage.HasFlag(InputModelTypeUsage.Xml); _supportsJson = inputModel.Usage.HasFlag(InputModelTypeUsage.Json) || !_supportsXml; - _shouldOverrideXmlMethods = _model.BaseModelProvider != null && !_isStruct; + // Initialize the serialization interfaces + var interfaceType = inputModel.IsUnknownDiscriminatorModel ? ScmCodeModelGenerator.Instance.TypeFactory.CreateModel(inputModel.BaseModel!)! : _model; + _jsonModelTInterface = new CSharpType(typeof(IJsonModel<>), interfaceType.Type); + _jsonModelObjectInterface = _isStruct ? (CSharpType)typeof(IJsonModel) : null; + _persistableModelTInterface = new CSharpType(typeof(IPersistableModel<>), interfaceType.Type); + _persistableModelObjectInterface = _isStruct ? (CSharpType)typeof(IPersistableModel) : null; _rawDataField = _model.Fields.FirstOrDefault(f => f.Name == AdditionalPropertiesHelper.AdditionalBinaryDataPropsFieldName); _additionalBinaryDataProperty = new(GetAdditionalBinaryDataPropertiesProp); _additionalProperties = new(() => [.. _model.Properties.Where(p => p.IsAdditionalProperties)]); + _shouldOverrideMethods = _model.BaseModelProvider != null && !_isStruct; + _shouldSkipDerivedSerializationMethodOverrides = ShouldSkipDerivedSerializationMethodOverrides(_model.BaseModelProvider); _utf8JsonWriterSnippet = _utf8JsonWriterParameter.As(); _mrwOptionsParameterSnippet = _serializationOptionsParameter.As(); _jsonElementParameterSnippet = _jsonElementDeserializationParam.As(); @@ -130,6 +121,13 @@ protected override IReadOnlyList BuildMethodsForBackCompatibilit protected override CSharpType? BuildBaseType() => _model.BaseType; + protected override IReadOnlyList BuildHelperDependencyTypes() => _rawDataField != null || _additionalProperties.Value.Length > 0 + ? [ScmCodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType] + : []; + + protected override IReadOnlyList BuildBodyDependencyTypes() => + [ScmCodeModelGenerator.Instance.SystemOptionalDefinition.Type, ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.Type]; + protected override SuppressionStatement[] BuildDisabledFileWarnings() { if (_model.CanonicalView.Properties.Any(p => ScmModelProvider.IsFileBinaryContentType(p.Type))) @@ -442,19 +440,17 @@ protected override CSharpType[] BuildImplements() if (_supportsJson) { interfaces.Add(_jsonModelTInterface); - var jsonModelObjectInterface = JsonModelObjectInterface; - if (jsonModelObjectInterface != null) + if (_jsonModelObjectInterface != null) { - interfaces.Add(jsonModelObjectInterface); + interfaces.Add(_jsonModelObjectInterface); } } else if (_supportsXml) { interfaces.Add(_persistableModelTInterface); - var persistableModelObjectInterface = PersistableModelObjectInterface; - if (persistableModelObjectInterface != null) + if (_persistableModelObjectInterface != null) { - interfaces.Add(persistableModelObjectInterface); + interfaces.Add(_persistableModelObjectInterface); } } @@ -484,7 +480,7 @@ internal MethodProvider BuildJsonModelWriteMethodObjectDeclaration() var castToT = This.CastTo(_jsonModelTInterface); return new MethodProvider ( - new MethodSignature(nameof(IJsonModel.Write), null, MethodSignatureModifiers.None, null, null, [_utf8JsonWriterParameter, _serializationOptionsParameter], ExplicitInterface: JsonModelObjectInterface), + new MethodSignature(nameof(IJsonModel.Write), null, MethodSignatureModifiers.None, null, null, [_utf8JsonWriterParameter, _serializationOptionsParameter], ExplicitInterface: _jsonModelObjectInterface), castToT.Invoke(nameof(IJsonModel.Write), [_utf8JsonWriterParameter, _serializationOptionsParameter]), this ); @@ -499,7 +495,7 @@ internal MethodProvider BuildJsonModelCreateMethodObjectDeclaration() var castToT = This.CastTo(_jsonModelTInterface); return new MethodProvider ( - new MethodSignature(nameof(IJsonModel.Create), null, MethodSignatureModifiers.None, typeof(object), null, [_utf8JsonReaderParameter, _serializationOptionsParameter], ExplicitInterface: JsonModelObjectInterface), + new MethodSignature(nameof(IJsonModel.Create), null, MethodSignatureModifiers.None, typeof(object), null, [_utf8JsonReaderParameter, _serializationOptionsParameter], ExplicitInterface: _jsonModelObjectInterface), castToT.Invoke(nameof(IJsonModel.Create), [_utf8JsonReaderParameter.AsArgument(), _serializationOptionsParameter]), this ); @@ -515,7 +511,7 @@ internal MethodProvider BuildPersistableModelWriteMethodObjectDeclaration() var returnType = typeof(BinaryData); return new MethodProvider ( - new MethodSignature(nameof(IPersistableModel.Write), null, MethodSignatureModifiers.None, returnType, null, [_serializationOptionsParameter], ExplicitInterface: PersistableModelObjectInterface), + new MethodSignature(nameof(IPersistableModel.Write), null, MethodSignatureModifiers.None, returnType, null, [_serializationOptionsParameter], ExplicitInterface: _persistableModelObjectInterface), castToT.Invoke(nameof(IPersistableModel.Write), [_serializationOptionsParameter]), this ); @@ -531,7 +527,7 @@ internal MethodProvider BuildPersistableModelCreateMethodObjectDeclaration() var returnType = typeof(object); return new MethodProvider ( - new MethodSignature(nameof(IPersistableModel.Create), null, MethodSignatureModifiers.None, returnType, null, [_dataParameter, _serializationOptionsParameter], ExplicitInterface: PersistableModelObjectInterface), + new MethodSignature(nameof(IPersistableModel.Create), null, MethodSignatureModifiers.None, returnType, null, [_dataParameter, _serializationOptionsParameter], ExplicitInterface: _persistableModelObjectInterface), castToT.Invoke(nameof(IPersistableModel.Create), [_dataParameter, _serializationOptionsParameter]), this ); @@ -545,7 +541,7 @@ internal MethodProvider BuildJsonModelWriteCoreMethod() MethodSignatureModifiers modifiers = _isStruct ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (ShouldOverrideMethods) + if (_shouldOverrideMethods) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -567,7 +563,7 @@ internal MethodProvider BuildPersistableModelWriteCoreMethod() ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (ShouldOverrideMethods && !ShouldSkipSerializationMethodOverrides) + if (_shouldOverrideMethods && !_shouldSkipDerivedSerializationMethodOverrides) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -591,7 +587,7 @@ internal MethodProvider BuildPersistableModelCreateCoreMethod() ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (ShouldOverrideMethods && !ShouldSkipSerializationMethodOverrides) + if (_shouldOverrideMethods && !_shouldSkipDerivedSerializationMethodOverrides) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -639,7 +635,7 @@ internal MethodProvider BuildJsonModelCreateCoreMethod() ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (ShouldOverrideMethods && !ShouldSkipSerializationMethodOverrides) + if (_shouldOverrideMethods && !_shouldSkipDerivedSerializationMethodOverrides) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -811,7 +807,7 @@ internal MethodProvider BuildPersistableModelGetFormatFromOptionsObjectDeclarati // string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)this).GetFormatFromOptions(options); return new MethodProvider ( - new MethodSignature(nameof(IPersistableModel.GetFormatFromOptions), null, MethodSignatureModifiers.None, typeof(string), null, [_serializationOptionsParameter], ExplicitInterface: PersistableModelObjectInterface), + new MethodSignature(nameof(IPersistableModel.GetFormatFromOptions), null, MethodSignatureModifiers.None, typeof(string), null, [_serializationOptionsParameter], ExplicitInterface: _persistableModelObjectInterface), castToT.Invoke(nameof(IPersistableModel.GetFormatFromOptions), [_serializationOptionsParameter]), this ); @@ -1070,7 +1066,7 @@ private MethodBodyStatement[] BuildPersistableModelCreateCoreMethodBody() private MethodBodyStatement CallBaseJsonModelWriteCore(bool isDynamicModelWithNonDynamicBase) { // base.() - bool callBaseWriteMethod = ShouldOverrideMethods + bool callBaseWriteMethod = _shouldOverrideMethods && (_jsonPatchProperty is null || !isDynamicModelWithNonDynamicBase); return callBaseWriteMethod ? Base.Invoke(JsonModelWriteCoreMethodName, [_utf8JsonWriterParameter, _serializationOptionsParameter]).Terminate() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs index 3ef2c7c4c62..bc9fa8eeceb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs @@ -57,6 +57,9 @@ protected override string BuildRelativeFilePath() protected override SuppressionStatement[] BuildDisabledFileWarnings() => [new SuppressionStatement(null, Literal(ScmModelProvider.FileBinaryContentDiagnosticId), ScmModelProvider.ScmEvaluationTypeSuppressionJustification)]; + protected override IReadOnlyList BuildBodyDependencyTypes() => + [ScmCodeModelGenerator.Instance.SystemOptionalDefinition.Type, ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.Type]; + protected override ConstructorProvider[] BuildConstructors() { if (_hasJsonOrXmlUsage) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs index 288b7f1af24..e4a41b74c88 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs @@ -17,7 +17,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { internal class PipelineRequestHeadersExtensionsDefinition : TypeProvider { - private const string _setDelimited = "SetDelimited"; + internal const string SetDelimitedMethodName = "SetDelimited"; private const string _addWithPrefix = "Add"; private ParameterProvider _pipelineRequestHeadersParam; public PipelineRequestHeadersExtensionsDefinition() @@ -56,7 +56,7 @@ private MethodProvider BuildSetDelimited(bool hasFormat) ? new[] { _pipelineRequestHeadersParam, nameParameter, valueParameter, delimiterParameter, formatParameter } : new[] { _pipelineRequestHeadersParam, nameParameter, valueParameter, delimiterParameter }; MethodSignature signature = new MethodSignature( - Name: _setDelimited, + Name: SetDelimitedMethodName, Modifiers: modifiers, Parameters: parameters, ReturnType: null, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs index 63c100116e0..9468f7c58cf 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs @@ -33,7 +33,9 @@ public override MethodBodyStatement SetHeaders(IReadOnlyList ar => Original.Property(nameof(PipelineRequest.Headers)).Invoke(nameof(PipelineRequestHeaders.Set), arguments).Terminate(); public override MethodBodyStatement AddCollectionHeaders(ValueExpression prefix, ValueExpression headers) - => Original.Property(nameof(PipelineRequest.Headers)).Invoke(nameof(PipelineRequestHeaders.Add), [prefix, headers]).Terminate(); + => Original.Property(nameof(PipelineRequest.Headers)) + .Invoke(nameof(PipelineRequestHeaders.Add), [prefix, headers], typeArguments: null, callAsAsync: false, extensionType: ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition.Type) + .Terminate(); public override HttpRequestApi ToExpression() => this; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs index f00d78571d0..9076d21ded5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs @@ -28,6 +28,7 @@ public class RestClientProvider : TypeProvider private const string TopParameterName = "top"; private const string MaxCountParameterName = "maxCount"; private const string MaxPageSizeParameterName = "maxPageSize"; + private const string ContentParameterName = "content"; private static readonly Dictionary _knownSpecialHeaderParams = new(StringComparer.OrdinalIgnoreCase) { @@ -78,6 +79,62 @@ protected override FieldProvider[] BuildFields() return [.. pipelineMessage20xClassifiersFields]; } + protected override IReadOnlyList BuildHelperDependencyTypes() + { + var uriBuilderType = ScmCodeModelGenerator.Instance.TypeFactory.HttpRequestApi.ToExpression().UriBuilderType; + var dependencies = new List(); + var dependencyNames = new HashSet(StringComparer.Ordinal); + if (uriBuilderType == typeof(ClientUriBuilderDefinition)) + { + TryAddDependency(dependencies, dependencyNames, new ClientUriBuilderDefinition().Type); + } + + foreach (var serviceMethod in _inputClient.Methods) + { + foreach (var parameter in serviceMethod.Operation.Parameters) + { + if (IsContentTypeParameter(parameter) || + parameter is not InputHeaderParameter and not InputQueryParameter) + { + continue; + } + + var type = ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(parameter.Type); + if (type?.IsDictionary == true) + { + TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType); + if (parameter is InputHeaderParameter headerParameter && + !string.IsNullOrEmpty(headerParameter.CollectionHeaderPrefix)) + { + TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition.Type); + } + } + else if (type?.IsCollection == true) + { + TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.TypeFactory.ListInitializationType); + } + } + } + + return dependencies; + } + + protected override IReadOnlyList BuildBodyDependencyTypes() + { + var dependencies = new List(); + var dependencyNames = new HashSet(StringComparer.Ordinal); + TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.TypeFormattersDefinition.Type); + return dependencies; + } + + private static void TryAddDependency(List dependencies, HashSet dependencyNames, CSharpType dependency) + { + if (dependencyNames.Add(dependency.FullyQualifiedName)) + { + dependencies.Add(dependency); + } + } + protected override ScmMethodProvider[] BuildMethods() { List methods = new List(); @@ -275,7 +332,7 @@ private MethodBodyStatements BuildMessage( } else { - var contentParam = signature.Parameters.FirstOrDefault(p => p.Name == "content" && p.Location == ParameterLocation.Body); + var contentParam = GetBodyContentParameter(signature.Parameters); statements.AddRange(AppendHeaderParameters(request, operation, paramMap, contentParam: contentParam)); statements.AddRange(GetSetContent(request, signature.Parameters)); } @@ -342,11 +399,14 @@ private Dictionary GetReinjectedParametersMap( private IReadOnlyList GetSetContent(HttpRequestApi request, IReadOnlyList parameters) { - var contentParam = parameters.FirstOrDefault( - p => p.Location == ParameterLocation.Body); + var contentParam = GetBodyContentParameter(parameters); return contentParam is null ? [] : [request.Content().Assign(contentParam).Terminate()]; } + private static ParameterProvider? GetBodyContentParameter(IReadOnlyList parameters) + => parameters.FirstOrDefault(static p => p.InputParameter is InputBodyParameter) ?? + parameters.FirstOrDefault(static p => p.Location == ParameterLocation.Body); + private Dictionary, PropertyProvider> BuildPipelineMessage20xClassifiers() { // Contains a mapping of classifier status codes to their corresponding pipeline message classifier property @@ -919,7 +979,9 @@ private static void AppendLiteralSegment(ScopedApi uri, string literal, List paramMap, InputOperation operation, InputParameter inputParam, out CSharpType? type, out SerializationFormat? serializationFormat, out ValueExpression? valueExpression) { - type = ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(inputParam.Type); + type = IsContentTypeParameter(inputParam, includeInputHeaderParameter: false) + ? null + : ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(inputParam.Type); serializationFormat = null; if (inputParam.IsApiVersion && ClientProvider.IsMultiServiceClient) @@ -1230,7 +1292,17 @@ internal static List GetMethodParameters( } else { - parameter.Type = parameter.Type.IsEnum ? parameter.Type.UnderlyingEnumType : parameter.Type; + if (IsContentTypeParameter(inputParam)) + { + parameter.Type = new CSharpType(typeof(string), isNullable: !inputParam.IsRequired); + parameter.Validation = inputParam.IsRequired + ? ParameterValidationType.AssertNotNullOrEmpty + : ParameterValidationType.None; + } + else + { + parameter.Type = parameter.Type.IsEnum ? parameter.Type.UnderlyingEnumType : parameter.Type; + } } } else if (methodType is ScmMethodKind.Convenience && @@ -1249,8 +1321,8 @@ internal static List GetMethodParameters( break; case ParameterLocation.Query: case ParameterLocation.Header: - if (inputParam is InputHeaderParameter { IsContentType: true } - && !HasContentTypeBeforeBodyInLastContract(serviceMethod.Name, client.BackCompatProvider)) + if (IsContentTypeParameter(inputParam) + && !ShouldPreserveContentTypeBeforeBody(methodType, serviceMethod, client.BackCompatProvider)) { sortedParams.Add(contentType++, parameter); } @@ -1292,12 +1364,42 @@ internal static List GetMethodParameters( return [.. sortedParams.Values]; } + private static bool ShouldPreserveContentTypeBeforeBody( + ScmMethodKind methodType, + InputServiceMethod serviceMethod, + TypeProvider backCompatProvider) + { + if (HasContentTypeBeforeBodyInLastContract(serviceMethod, backCompatProvider)) + { + return true; + } + + // The baseline contract used for back-compat may come from a released package and can + // lag the generated sources in the repo. For generated convenience methods that expose a + // domain-named body parameter, keep the historic contentType-before-body ordering to avoid + // repo regen churn while protocol methods continue using the normalized "content" body. + return methodType is ScmMethodKind.Convenience && HasNamedBodyParameter(serviceMethod); + } + + private static bool HasNamedBodyParameter(InputServiceMethod serviceMethod) + { + foreach (var parameter in serviceMethod.Parameters) + { + if (parameter.Location == InputRequestLocation.Body && + !string.Equals(parameter.Name, ContentParameterName, StringComparison.OrdinalIgnoreCase)) + { + return true; + } + } + + return false; + } + private static bool HasLiteralContentTypeHeader(InputOperation operation) { foreach (var p in operation.Parameters) { - if (p is InputHeaderParameter { IsContentType: true } header - && header.Type is InputLiteralType) + if (p is InputHeaderParameter { IsContentType: true } && p.Type is InputLiteralType) { return true; } @@ -1305,15 +1407,19 @@ private static bool HasLiteralContentTypeHeader(InputOperation operation) return false; } + private static bool IsContentTypeParameter(InputParameter parameter, bool includeInputHeaderParameter = true) => + includeInputHeaderParameter && parameter is InputHeaderParameter { IsContentType: true } || + parameter is InputMethodParameter { Location: InputRequestLocation.Header } && + string.Equals(parameter.SerializedName, "Content-Type", StringComparison.OrdinalIgnoreCase); + /// /// Checks if the last contract view contains a method matching the given name where - /// a "contentType" parameter appears before the body ("content") parameter. + /// a "contentType" parameter appears before the body parameter. /// If so, we should preserve that ordering for backward compatibility. /// - private static bool HasContentTypeBeforeBodyInLastContract(string methodName, TypeProvider backCompatProvider) + private static bool HasContentTypeBeforeBodyInLastContract(InputServiceMethod serviceMethod, TypeProvider backCompatProvider) { const string contentTypeParamName = "contentType"; - const string contentParamName = "content"; var lastContractMethods = backCompatProvider.LastContractView?.Methods; if (lastContractMethods == null || lastContractMethods.Count == 0) @@ -1321,8 +1427,9 @@ private static bool HasContentTypeBeforeBodyInLastContract(string methodName, Ty return false; } - var syncMethodName = methodName; - var asyncMethodName = methodName + "Async"; + var syncMethodName = serviceMethod.Name; + var asyncMethodName = serviceMethod.Name + "Async"; + var bodyParameterNames = GetBodyParameterNames(serviceMethod); foreach (var method in lastContractMethods) { @@ -1341,7 +1448,7 @@ private static bool HasContentTypeBeforeBodyInLastContract(string methodName, Ty { contentTypeIndex = i; } - else if (string.Equals(param.Name, contentParamName, StringComparison.OrdinalIgnoreCase)) + else if (IsLastContractBodyParameter(param, bodyParameterNames)) { bodyIndex = i; } @@ -1361,6 +1468,45 @@ private static bool HasContentTypeBeforeBodyInLastContract(string methodName, Ty return false; } + private static HashSet GetBodyParameterNames(InputServiceMethod serviceMethod) + { + var names = new HashSet(StringComparer.OrdinalIgnoreCase); + foreach (var parameter in serviceMethod.Parameters) + { + if (parameter.Location == InputRequestLocation.Body) + { + names.Add(parameter.Name); + } + } + + foreach (var parameter in serviceMethod.Operation.Parameters) + { + if (parameter is InputBodyParameter) + { + names.Add(parameter.Name); + } + } + + return names; + } + + private static bool IsLastContractBodyParameter(ParameterProvider parameter, HashSet bodyParameterNames) + { + if (parameter.InputParameter is InputBodyParameter || + parameter.Location == ParameterLocation.Body || + bodyParameterNames.Contains(parameter.Name)) + { + return true; + } + + if (string.Equals(parameter.Name, ContentParameterName, StringComparison.OrdinalIgnoreCase)) + { + return true; + } + + return false; + } + internal static InputModelType GetSpreadParameterModel(InputParameter inputParam) { if (inputParam.Type is InputModelType model) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index b18c378a1bd..ebf9a548fb7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -29,7 +29,6 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers public class ScmMethodProviderCollection : IReadOnlyList { private readonly MethodProvider _createRequestMethod; - private static readonly ClientPipelineExtensionsDefinition _clientPipelineExtensionsDefinition = new(); private static readonly CancellationTokenExtensionsDefinition _cancellationTokenExtensionsDefinition = new(); private const string JsonMediaType = "application/json"; private const string XmlMediaType = "application/xml"; @@ -1152,7 +1151,7 @@ private ScmMethodProvider BuildProtocolMethod(MethodProvider createRequestMethod This.Invoke(createRequestMethod.Signature, BuildCreateRequestArguments(createRequestMethod.Signature, bodyParameters)), out var message), Return(ScmCodeModelGenerator.Instance.TypeFactory.ClientResponseApi.ToExpression().FromResponse(client - .PipelineProperty.Invoke(processMessageName, [message, requestOptionsParameter], isAsync, true, extensionType: _clientPipelineExtensionsDefinition.Type))) + .PipelineProperty.Invoke(processMessageName, [message, requestOptionsParameter], isAsync, true, extensionType: ScmCodeModelGenerator.Instance.ClientPipelineExtensionsDefinition.Type))) ]; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs index af294640060..e902afd7c79 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -45,6 +46,7 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "SerializationFormat"; + protected override FormattableString BuildDescription() => $"The serialization format."; protected override TypeProvider[] BuildSerializationProviders() => []; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs index ba4c5ffe6a1..d704b9b2c27 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs @@ -30,6 +30,22 @@ public class ScmCodeModelGenerator : CodeModelGenerator internal SerializationFormatDefinition SerializationFormatDefinition { get; } = new SerializationFormatDefinition(); + private SystemOptionalDefinition? _systemOptionalDefinition; + internal SystemOptionalDefinition SystemOptionalDefinition => + _systemOptionalDefinition ??= new SystemOptionalDefinition(); + + private TypeFormattersDefinition? _typeFormattersDefinition; + internal TypeFormattersDefinition TypeFormattersDefinition => + _typeFormattersDefinition ??= new TypeFormattersDefinition(); + + private ClientPipelineExtensionsDefinition? _clientPipelineExtensionsDefinition; + internal ClientPipelineExtensionsDefinition ClientPipelineExtensionsDefinition => + _clientPipelineExtensionsDefinition ??= new ClientPipelineExtensionsDefinition(); + + private PipelineRequestHeadersExtensionsDefinition? _pipelineRequestHeadersExtensionsDefinition; + internal PipelineRequestHeadersExtensionsDefinition PipelineRequestHeadersExtensionsDefinition => + _pipelineRequestHeadersExtensionsDefinition ??= new PipelineRequestHeadersExtensionsDefinition(); + /// /// Gets the options that control ConfigurationSchema.json generation. /// @@ -49,6 +65,7 @@ protected override void Configure() AddMetadataReference(MetadataReference.CreateFromFile(typeof(ClientResult).Assembly.Location)); AddMetadataReference(MetadataReference.CreateFromFile(typeof(BinaryData).Assembly.Location)); AddMetadataReference(MetadataReference.CreateFromFile(typeof(JsonSerializer).Assembly.Location)); + AddCustomCodeMethodDependency(PipelineRequestHeadersExtensionsDefinition.SetDelimitedMethodName, PipelineRequestHeadersExtensionsDefinition); AddTypeToKeep(ModelReaderWriterContextDefinition.s_name, isRoot: false); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs index dadaad84144..e7d755c0239 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs @@ -16,6 +16,11 @@ private static TypeProvider[] BuildClientTypes() var inputClients = ScmCodeModelGenerator.Instance.InputLibrary.InputNamespace.RootClients; var types = new HashSet(); + foreach (var inputClient in inputClients) + { + CreateClientProviders(inputClient); + } + foreach (var inputClient in inputClients) { BuildClient(inputClient, types); @@ -24,6 +29,16 @@ private static TypeProvider[] BuildClientTypes() return [.. types]; } + private static void CreateClientProviders(InputClient inputClient) + { + foreach (var child in inputClient.Children) + { + CreateClientProviders(child); + } + + ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); + } + private static void BuildClient(InputClient inputClient, HashSet types) { foreach (var child in inputClient.Children) @@ -65,13 +80,12 @@ private static void BuildClient(InputClient inputClient, HashSet t protected override TypeProvider[] BuildTypeProviders() { var baseTypes = base.BuildTypeProviders(); - var systemOptionalProvider = new SystemOptionalDefinition(); for (var i = 0; i < baseTypes.Length; i++) { if (baseTypes[i] is OptionalDefinition) { - baseTypes[i] = systemOptionalProvider; + baseTypes[i] = ScmCodeModelGenerator.Instance.SystemOptionalDefinition; } } @@ -80,14 +94,14 @@ protected override TypeProvider[] BuildTypeProviders() ..BuildClientTypes(), ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition, ScmCodeModelGenerator.Instance.SerializationFormatDefinition, - new TypeFormattersDefinition(), + ScmCodeModelGenerator.Instance.TypeFormattersDefinition, new ErrorResultDefinition(), new ClientUriBuilderDefinition(), new Utf8JsonBinaryContentDefinition(), new BinaryContentHelperDefinition(), - new ClientPipelineExtensionsDefinition(), + ScmCodeModelGenerator.Instance.ClientPipelineExtensionsDefinition, new CancellationTokenExtensionsDefinition(), - new PipelineRequestHeadersExtensionsDefinition(), + ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition, .. GetMultipartFormDataTypes(), new ModelReaderWriterContextDefinition() ]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs index 588a2094b12..d27c45c1fe4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs @@ -26,7 +26,9 @@ public static MethodBodyStatement SetContent(this ScopedApi pip public static MethodBodyStatement SetHeaderDelimited(this HttpRequestApi pipelineRequest, string name, ValueExpression value, ValueExpression delimiter, ValueExpression? format = null) { ValueExpression[] parameters = format != null ? [Literal(name), value, delimiter, format] : [Literal(name), value, delimiter]; - return pipelineRequest.Property(nameof(PipelineRequest.Headers)).Invoke("SetDelimited", parameters).Terminate(); + return pipelineRequest.Property(nameof(PipelineRequest.Headers)) + .Invoke(PipelineRequestHeadersExtensionsDefinition.SetDelimitedMethodName, parameters, typeArguments: null, callAsAsync: false, extensionType: ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition.Type) + .Terminate(); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs index 3cdcd91a129..f119d0a52a5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs @@ -383,6 +383,44 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.IsTrue(body?.Contains("ServiceVersion.V2024_01_01 => \"2024-01-01\"")); } + [Test] + public async Task CustomizedPublicConstructorKeepsNestedServiceVersionPublic() + { + string[] apiVersions = ["2023-10-01-preview-1", "2023-11-01", "2024-01-01"]; + var enumValues = apiVersions.Select((a, index) => (a, a)); + var inputEnum = InputFactory.StringEnum( + "ServiceVersion", + enumValues, + access: string.Empty, + usage: InputModelTypeUsage.ApiVersionEnum, + clientNamespace: "SampleNamespace"); + var inputClient = InputFactory.Client("RawClient", clientNamespace: "SampleNamespace"); + + var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( + apiVersions: () => apiVersions, + inputEnums: () => [inputEnum], + clients: () => [inputClient], + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var clientProvider = mockGenerator.Object.OutputLibrary.TypeProviders + .OfType() + .Single(provider => provider.Name == "RawClient"); + var clientOptionsProvider = clientProvider.ClientOptions; + Assert.IsNotNull(clientOptionsProvider); + var serviceVersionProvider = clientOptionsProvider!.NestedTypes.Single(); + Assert.IsTrue(serviceVersionProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsNotNull(clientOptionsProvider.CustomCodeView); + var customConstructor = clientOptionsProvider.CustomCodeView!.Constructors.Single(); + var customServiceVersionType = customConstructor.Signature.Parameters.Single().Type; + Assert.IsEmpty(customServiceVersionType.Namespace); + Assert.IsNull(customServiceVersionType.DeclaringType); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(mockGenerator.Object.OutputLibrary.TypeProviders); + + Assert.IsTrue(serviceVersionProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(serviceVersionProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + [Test] public void SingletonCreatedForMultipleClientsWithStandardParameters() { @@ -502,6 +540,75 @@ public void MultipleClientsWithRequiredCustomParametersShareSingletonOptions() Assert.AreEqual("SampleClientOptions", options1!.Name); } + [Test] + public async Task SharedSingletonOptionsArePublicWhenAnyClientIsPublic() + { + List apiVersions = ["1.0"]; + var inputEnum = InputFactory.StringEnum( + "ServiceVersion", + apiVersions.Select(version => (version, version)), + usage: InputModelTypeUsage.ApiVersionEnum); + var apiVersionParameter = InputFactory.QueryParameter( + "apiVersion", + inputEnum, + isRequired: true, + scope: InputParameterScope.Client, + isApiVersion: true); + var operation = InputFactory.Operation("Get", parameters: [apiVersionParameter]); + var client1 = InputFactory.Client( + "InternalClient", + methods: [InputFactory.BasicServiceMethod("Get", operation)], + parameters: [apiVersionParameter]); + var client2 = InputFactory.Client("PublicClient"); + + var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( + clients: () => [client1, client2], + apiVersions: () => apiVersions, + inputEnums: () => [inputEnum], + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + configuration: "{\"unreferenced-types-handling\":\"keepAll\"}"); + + var clientProviders = mockGenerator.Object.OutputLibrary.TypeProviders.OfType().ToList(); + var clientProvider1 = clientProviders.Single(client => client.Name == "InternalClient"); + var clientProvider2 = clientProviders.Single(client => client.Name == "PublicClient"); + Assert.IsTrue(clientProvider1.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(clientProvider2.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + + var options = clientProvider1.ClientOptions; + Assert.AreSame(options, clientProvider2.ClientOptions); + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(mockGenerator.Object.OutputLibrary.TypeProviders); + + Assert.IsTrue(options!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(options.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + + var declaration = new TypeProviderWriter(options).Write().Content; + StringAssert.Contains("public partial class SampleClientOptions", declaration); + StringAssert.DoesNotContain("public internal partial class", declaration); + } + + [Test] + public async Task SharedSingletonOptionsAreInternalWhenAllClientsAreInternal() + { + var client1 = InputFactory.Client("ClientA"); + var client2 = InputFactory.Client("ClientB"); + + var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( + clients: () => [client1, client2], + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), + configuration: "{\"unreferenced-types-handling\":\"keepAll\"}"); + + var clientProviders = mockGenerator.Object.OutputLibrary.TypeProviders.OfType().ToList(); + var options = clientProviders.Single(client => client.Name == "ClientA").ClientOptions; + Assert.AreSame(options, clientProviders.Single(client => client.Name == "ClientB").ClientOptions); + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(mockGenerator.Object.OutputLibrary.TypeProviders); + + Assert.IsTrue(options!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(options.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + + var declaration = new TypeProviderWriter(options).Write().Content; + StringAssert.Contains("internal partial class SampleClientOptions", declaration); + } + [Test] public void NamespaceLastSegmentIsUsedForSingletonName() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs index 327e46a7261..bdf17516e28 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs @@ -392,8 +392,7 @@ public async Task CanChangeClientAccessibility() // Find the client options provider var clientOptionsProvider = mockGenerator.Object.OutputLibrary.TypeProviders.SingleOrDefault(t => t is ClientOptionsProvider); Assert.IsNotNull(clientOptionsProvider); - // The client options were not customized - Assert.IsTrue(clientOptionsProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(clientOptionsProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); // ClientSettings should not be generated for internal clients Assert.IsNull(((ClientProvider)clientProvider).ClientSettings, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs index 79b77b510c9..d55537cc0d0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs @@ -5,6 +5,7 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.IO; using System.Linq; using System.Text.Json; using System.Threading.Tasks; @@ -115,6 +116,113 @@ public void ValidateModelReaderWriterBuildableAttributesAreGeneratedForNonModels "The ModelReaderWriterBuildableAttribute should be generated for TestMrwSerialization"); } + [Test] + public void RemovedProvidersDoNotContributeBuildableAttributes() + { + var keptProvider = new TestMrwSerialization(implementsPersistableModel: true, includeDepModelProperty: false); + var removedProvider = new RemovedProviderWithFrameworkDependency(); + var outputLibrary = new TestOutputLibrary([keptProvider, removedProvider]); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => outputLibrary); + + try + { + CodeModelGenerator.Instance.AddTypeToKeep(keptProvider); + ProviderReferenceMapAnalyzer.Analyze(ScmCodeModelGenerator.Instance.OutputLibrary.TypeProviders); + + var contextDefinition = new ModelReaderWriterContextDefinition(); + var buildableAttributes = contextDefinition.Attributes + .Where(a => a.Type.IsFrameworkType && a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)) + .Select(a => a.Arguments.First().ToDisplayString()) + .ToList(); + + Assert.AreEqual(1, buildableAttributes.Count); + Assert.AreEqual("typeof(global::Sample.TestMrwSerialization)", buildableAttributes[0]); + Assert.IsFalse( + buildableAttributes.Contains("typeof(global::Sample.RemovedProviderWithFrameworkDependency)"), + "Removed providers should not get standalone context entries."); + } + finally + { + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + } + } + + [Test] + public async Task VisitorAttributesArePreservedAfterReferenceMapAnalysis() + { + var outputPath = Path.Combine( + TestContext.CurrentContext.WorkDirectory, + nameof(ModelReaderWriterContextDefinitionTests), + nameof(VisitorAttributesArePreservedAfterReferenceMapAnalysis)); + var outputLibrary = new TestOutputLibrary([new RemovedProviderWithFrameworkDependency()]); + var mockGenerator = MockHelpers.LoadMockGenerator( + createOutputLibrary: () => outputLibrary, + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", + outputPath: outputPath); + mockGenerator.Object.AddVisitor(new ContextAttributeVisitor()); + + await new CSharpGen().ExecuteAsync(); + + var context = outputLibrary.TypeProviders.OfType().Single(); + Assert.IsTrue(context.Attributes.Any(attribute => attribute.Type.Equals(typeof(ObsoleteAttribute)))); + var content = await File.ReadAllTextAsync(Path.Combine(outputPath, context.RelativeFilePath)); + StringAssert.Contains("[Obsolete]", content); + StringAssert.DoesNotContain(nameof(RemovedProviderWithFrameworkDependency), content); + } + + [Test] + public void RemovedFrameworkTypeIsNotMatchedToKeptProviderWithSameSimpleName() + { + var keptProvider = new ShadowedBuildableProvider("Sample"); + var removedProvider = new RemovedShadowedBuildableProvider(); + var outputLibrary = new TestOutputLibrary([keptProvider, removedProvider]); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => outputLibrary); + + try + { + CodeModelGenerator.Instance.AddTypeToKeep(keptProvider); + ProviderReferenceMapAnalyzer.Analyze(ScmCodeModelGenerator.Instance.OutputLibrary.TypeProviders); + + var contextDefinition = new ModelReaderWriterContextDefinition(); + var buildableAttributes = contextDefinition.Attributes + .Where(a => a.Type.IsFrameworkType && a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)) + .Select(a => a.Arguments.First().ToDisplayString()) + .ToList(); + + Assert.AreEqual(1, buildableAttributes.Count); + Assert.AreEqual("typeof(global::Sample.ShadowedModel)", buildableAttributes[0]); + Assert.IsFalse( + buildableAttributes.Contains("typeof(global::Sample.Agents.ShadowedModel)"), + "Removed source types should not be resolved through a kept provider with the same simple name."); + } + finally + { + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + } + } + + [Test] + public void ExternalModelProvidersDoNotContributeStandaloneBuildableAttributes() + { + MockHelpers.LoadMockGenerator( + inputModels: () => + [ + InputFactory.Model( + "File", + @namespace: "External.Library", + usage: InputModelTypeUsage.Json, + external: new InputExternalTypeMetadata("External.Library.File", package: null, minVersion: null)) + ]); + + var contextDefinition = new ModelReaderWriterContextDefinition(); + var buildableAttributes = contextDefinition.Attributes + .Where(a => a.Type.IsFrameworkType && a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)) + .Select(a => a.Arguments.First().ToDisplayString()) + .ToList(); + + Assert.IsEmpty(buildableAttributes); + } + [Test] public void ValidateModelReaderWriterBuildableAttributesIncludeNestedModels() { @@ -1045,7 +1153,63 @@ protected internal override PropertyProvider[] BuildProperties() protected override string BuildRelativeFilePath() { - throw new NotImplementedException(); + return Path.Combine("src", "Generated", $"{Name}.cs"); + } + } + + private class RemovedProviderWithFrameworkDependency : TypeProvider + { + protected override string BuildName() => "RemovedProviderWithFrameworkDependency"; + + protected internal override CSharpType[] BuildImplements() + { + return [new CSharpType(typeof(IPersistableModel))]; + } + + protected internal override PropertyProvider[] BuildProperties() + { + return [new PropertyProvider(null, MethodSignatureModifiers.Public, new CSharpType(typeof(DependencyModel)), "p1", new AutoPropertyBody(false), this)]; + } + + protected override string BuildRelativeFilePath() + { + return Path.Combine("src", "Generated", $"{Name}.cs"); + } + } + + private class ShadowedBuildableProvider : TypeProvider + { + private readonly string _namespace; + + public ShadowedBuildableProvider(string ns) + { + _namespace = ns; + } + + protected override string BuildName() => "ShadowedModel"; + + protected override string BuildNamespace() => _namespace; + + protected internal override CSharpType[] BuildImplements() + { + return [new CSharpType(typeof(IPersistableModel))]; + } + + protected override string BuildRelativeFilePath() + { + return Path.Combine("src", "Generated", $"{Name}.cs"); + } + } + + private class RemovedShadowedBuildableProvider : ShadowedBuildableProvider + { + public RemovedShadowedBuildableProvider() : base("Sample.Agents") + { + } + + protected internal override PropertyProvider[] BuildProperties() + { + return [new PropertyProvider(null, MethodSignatureModifiers.Public, new CSharpType(typeof(Sample.Agents.ShadowedModel)), "p1", new AutoPropertyBody(false), this)]; } } @@ -1335,6 +1499,19 @@ .. _typeProviders } } + private sealed class ContextAttributeVisitor : LibraryVisitor + { + protected override TypeProvider? VisitType(TypeProvider type) + { + if (type is ModelReaderWriterContextDefinition) + { + type.Update(attributes: [.. type.Attributes, new AttributeStatement(typeof(ObsoleteAttribute))]); + } + + return type; + } + } + // Test class for a framework type marked with [Obsolete] [Obsolete("This type is obsolete. Use NewFrameworkType instead.")] public class ObsoleteFrameworkType : IJsonModel, IPersistableModel @@ -1554,6 +1731,63 @@ public void ValidateFrameworkReturnTypesAreDiscoveredFromGenericResponseWrappers "FrameworkModelWithMRW should be discovered from generic response wrapper return type"); } + [Test] + public void ValidateFrameworkBodyDependencyTypesAreNotDiscovered() + { + var clientProvider = new TestClientProviderWithFrameworkBodyDependency(); + var outputLibrary = new TestOutputLibrary([clientProvider]); + var mockGenerator = MockHelpers.LoadMockGenerator( + createOutputLibrary: () => outputLibrary); + + var contextDefinition = new ModelReaderWriterContextDefinition(); + var attributes = contextDefinition.Attributes; + + Assert.IsNotNull(attributes); + var buildableAttributes = attributes.Where(a => a.Type.IsFrameworkType && + a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)).ToList(); + + Assert.IsFalse(buildableAttributes.Any(a => a.Arguments.First().ToDisplayString().Contains("ResponseError")), + "Framework types referenced only from provider bodies should not be added to the MRW context"); + } + + [Test] + public async Task CustomizedBuildableAttributesAreNotRegenerated() + { + var clientProvider = new TestClientProviderWithResponseErrorReturnType(); + var outputLibrary = new TestOutputLibrary([clientProvider]); + var mockGenerator = MockHelpers.LoadMockGenerator(createOutputLibrary: () => outputLibrary); + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + mockGenerator.SetupProperty(p => p.SourceInputModel, new SourceInputModel(compilation, null)); + + var contextDefinition = new ModelReaderWriterContextDefinition(); + var buildableAttributes = contextDefinition.Attributes + .Where(a => a.Type.IsFrameworkType && + a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)); + + Assert.IsFalse(buildableAttributes.Any(a => a.Arguments.First().ToDisplayString().Contains("ResponseError")), + "Buildable attributes supplied by a customized context should not be regenerated"); + } + + [Test] + public async Task CustomProjectionPropertiesDoNotAddBuildableTypes() + { + var model = InputFactory.Model("ModelWithProjectedProperty", properties: + [ + InputFactory.Property("Error", InputPrimitiveType.String) + ]); + await MockHelpers.LoadMockGeneratorAsync( + inputModels: () => [model], + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var contextDefinition = new ModelReaderWriterContextDefinition(); + var buildableAttributes = contextDefinition.Attributes + .Where(a => a.Type.IsFrameworkType && + a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)); + + Assert.IsFalse(buildableAttributes.Any(a => a.Arguments.First().ToDisplayString().Contains("ResponseError")), + "Public projections over CodeGenMember backing properties are not part of wire serialization"); + } + [Test] public async Task ValidateCustomPropertiesOnModelsAreDiscovered() { @@ -1745,5 +1979,100 @@ protected internal override MethodProvider[] BuildMethods() ]; } } + + private class TestClientProviderWithFrameworkBodyDependency : TypeProvider + { + protected override string BuildName() => "TestClient"; + + protected override string BuildRelativeFilePath() => "TestClient.cs"; + + protected internal override IReadOnlyList BuildBodyDependencyTypes() + { + return [new CSharpType(typeof(Azure.ResponseError))]; + } + } + + private class TestClientProviderWithResponseErrorReturnType : TypeProvider + { + protected override string BuildName() => "TestClient"; + + protected override string BuildRelativeFilePath() => "TestClient.cs"; + + protected internal override MethodProvider[] BuildMethods() + { + var signature = new MethodSignature( + Name: "GetError", + Description: null, + Modifiers: MethodSignatureModifiers.Public, + ReturnType: new CSharpType(typeof(Azure.ResponseError)), + ReturnDescription: null, + Parameters: []); + + return [new MethodProvider(signature, Statements.MethodBodyStatement.Empty, this)]; + } + } + } + +} + +namespace Azure +{ + public class ResponseError : IJsonModel + { + ResponseError? IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + ResponseError? IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + } +} + +namespace Sample.Agents +{ + public class ShadowedModel : IJsonModel + { + ShadowedModel? IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + ShadowedModel? IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + throw new NotImplementedException(); + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs new file mode 100644 index 00000000000..9041098996b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs @@ -0,0 +1,12 @@ +using Microsoft.TypeSpec.Generator.Customizations; + +namespace Sample.Models +{ + public partial class ModelWithProjectedProperty + { + [CodeGenMember("Error")] + internal string ErrorInternal { get; } + + public Azure.ResponseError Error => new(); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs new file mode 100644 index 00000000000..dd85bacb583 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs @@ -0,0 +1,9 @@ +using System.ClientModel.Primitives; + +namespace Sample +{ + [ModelReaderWriterBuildable(typeof(Azure.ResponseError))] + public partial class SampleContext + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs index fcc90582416..503ed1ad68f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs @@ -121,31 +121,6 @@ public void JsonModelWriteCore_IsOverride_WhenBaseIsRegularModel() "JsonModelWriteCore should be 'override' with regular base too"); } - [Test] - public void JsonModelWriteCore_IsOverride_WhenBaseProviderIsResolvedAfterSerialization() - { - var baseInputModel = InputFactory.Model("Resource"); - var derivedInputModel = InputFactory.Model("TrackedResource", properties: [InputFactory.Property("Location", InputPrimitiveType.String)]); - MockHelpers.LoadMockGenerator(inputModels: () => [baseInputModel, derivedInputModel]); - - var derived = new DelayedBaseModelProvider(derivedInputModel); - var serialization = new MrwSerializationTypeDefinition(derivedInputModel, derived); - - // The serialization provider can be constructed before later visitors/customization - // resolution make the base model provider available. - derived.BaseModel = new SystemObjectModelProvider(new CSharpType(typeof(object)), baseInputModel); - - var method = serialization.BuildJsonModelWriteCoreMethod(); - - Assert.AreEqual(derived.BaseModel.Type, derived.Type.BaseType, - "The generated model type should inherit the base resolved after serialization construction."); - Assert.AreEqual(derived.BaseModel.Type, serialization.Type.BaseType, - "The serialization type should inherit the same resolved base."); - Assert.IsTrue(method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Override), - "JsonModelWriteCore should evaluate BaseModelProvider when the method is built, not when serialization is constructed"); - Assert.IsFalse(method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Virtual)); - } - // ------------------------------------------------------------------- // PersistableModelWriteCore: 'virtual' with system base, 'override' with regular // (the framework base already implements this; derived model re-introduces it) @@ -353,14 +328,5 @@ FakeMrwBase IPersistableModel.Create(BinaryData data, ModelReaderWr string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } - - private class DelayedBaseModelProvider(InputModelType inputModel) : ModelProvider(inputModel) - { - public ModelProvider? BaseModel { get; set; } - - protected override ModelProvider? BuildBaseModelProvider() => BaseModel; - - protected override CSharpType? BuildBaseType() => BaseModel?.Type; - } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs index e8bcb2fa0fb..97472c67514 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.TypeSpec.Generator.ClientModel.Providers; @@ -103,6 +104,21 @@ public void ValidateProperties() Assert.IsFalse(propertyHash.ContainsKey("PipelineMessageClassifier204")); } + [Test] + public void BodyDependencyTypesDoNotRootRequestBodyModels() + { + var requestBody = InputFactory.Model("CreateWidgetRequest"); + var operation = InputFactory.Operation( + "CreateWidget", + parameters: [InputFactory.BodyParameter("body", requestBody, isRequired: true)]); + var inputClient = InputFactory.Client( + "TestClient", + methods: [InputFactory.BasicServiceMethod("CreateWidget", operation)]); + var restClient = new ClientProvider(inputClient).RestClient; + + Assert.IsFalse(restClient.BodyDependencyTypes.Any(t => t.Name == requestBody.Name)); + } + [Test] public void Validate3xxRedirectStatusCode() { @@ -272,6 +288,57 @@ public void TestGetMethodParameters_ContentTypeAfterBody(bool isRequired, bool i Assert.AreEqual("skillId", methodParameters[0].Name); Assert.AreEqual("content", methodParameters[1].Name); Assert.AreEqual("contentType", methodParameters[2].Name); + Assert.AreEqual(typeof(string), methodParameters[2].Type.FrameworkType); + Assert.AreEqual(!isRequired, methodParameters[2].Type.IsNullable); + Assert.AreEqual( + isRequired ? ParameterValidationType.AssertNotNullOrEmpty : ParameterValidationType.None, + methodParameters[2].Validation); + } + + [Test] + public void ProtocolContentTypeParameterUsesTypeFactory() + { + var contentTypeEnum = InputFactory.StringEnum( + "ContentTypeEnum", + [("application/json", "application/json")], + isExtensible: true); + var contentTypeParameter = InputFactory.MethodParameter( + "contentType", + InputFactory.Union([contentTypeEnum], "contentType"), + isRequired: true, + location: InputRequestLocation.Header, + serializedName: "Content-Type"); + var operation = InputFactory.Operation( + "Upload", + parameters: [contentTypeParameter]); + var serviceMethod = InputFactory.BasicServiceMethod( + "Upload", + operation, + parameters: [contentTypeParameter]); + var client = InputFactory.Client("TestClient", methods: [serviceMethod]); + var factoryCalled = false; + + MockHelpers.LoadMockGenerator( + clients: () => [client], + createParameterCore: parameter => + { + factoryCalled = true; + return new ParameterProvider(parameter); + }); + + var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); + Assert.IsNotNull(clientProvider); + factoryCalled = false; + + var methodParameters = RestClientProvider.GetMethodParameters( + serviceMethod, + ScmMethodKind.Protocol, + clientProvider!); + + Assert.IsTrue(factoryCalled); + Assert.AreEqual(1, methodParameters.Count); + Assert.AreEqual(typeof(string), methodParameters[0].Type.FrameworkType); + Assert.AreEqual(ParameterValidationType.AssertNotNullOrEmpty, methodParameters[0].Validation); } [Test] @@ -362,6 +429,135 @@ public async Task ContentTypeAfterBodyInLastContractView() Assert.AreEqual("contentType", methodParameters[2].Name); // contentType after body } + [Test] + public async Task ContentTypeOrderPreservedFromLastContractViewWithNamedBody() + { + var contentTypeEnum = InputFactory.StringEnum("ContentTypeEnum", + [("application/json", "application/json"), ("application/xml", "application/xml")], + isExtensible: true); + var contentTypeHeader = InputFactory.HeaderParameter( + "contentType", + contentTypeEnum, + isRequired: true, + isContentType: true, + serializedName: "Content-Type"); + var bodyParam = InputFactory.BodyParameter("schemaContent", InputPrimitiveType.String, isRequired: true); + var groupNameParam = InputFactory.PathParameter("groupName", InputPrimitiveType.String, isRequired: true); + var pathParam = InputFactory.PathParameter("schemaName", InputPrimitiveType.String, isRequired: true); + var methodGroupNameParam = InputFactory.MethodParameter( + "groupName", + InputPrimitiveType.String, + isRequired: true, + location: InputRequestLocation.Path); + var methodSchemaNameParam = InputFactory.MethodParameter( + "schemaName", + InputPrimitiveType.String, + isRequired: true, + location: InputRequestLocation.Path); + var methodContentTypeParam = InputFactory.MethodParameter( + "contentType", + contentTypeEnum, + isRequired: true, + serializedName: "Content-Type", + location: InputRequestLocation.Header); + var methodBodyParam = InputFactory.MethodParameter( + "schemaContent", + InputPrimitiveType.String, + isRequired: true, + location: InputRequestLocation.Body); + + var operation = InputFactory.Operation( + "RegisterSchema", + parameters: [groupNameParam, pathParam, contentTypeHeader, bodyParam]); + + var serviceMethod = InputFactory.BasicServiceMethod( + "RegisterSchema", + operation, + parameters: [methodGroupNameParam, methodSchemaNameParam, methodContentTypeParam, methodBodyParam]); + + var client = InputFactory.Client("TestClient", methods: [serviceMethod]); + + var generator = await MockHelpers.LoadMockGeneratorAsync( + clients: () => [client], + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var clientProvider = generator.Object.OutputLibrary.TypeProviders.OfType().FirstOrDefault(); + Assert.IsNotNull(clientProvider); + Assert.IsNotNull(clientProvider!.LastContractView); + + var methodParameters = RestClientProvider.GetMethodParameters(serviceMethod, ScmMethodKind.Protocol, clientProvider!); + + Assert.AreEqual(4, methodParameters.Count); + Assert.AreEqual("groupName", methodParameters[0].Name); + Assert.AreEqual("schemaName", methodParameters[1].Name); + Assert.AreEqual("contentType", methodParameters[2].Name); + Assert.AreEqual("content", methodParameters[3].Name); + + var convenienceMethodParameters = RestClientProvider.GetMethodParameters(serviceMethod, ScmMethodKind.Convenience, clientProvider!); + + Assert.AreEqual(4, convenienceMethodParameters.Count); + Assert.AreEqual("groupName", convenienceMethodParameters[0].Name); + Assert.AreEqual("schemaName", convenienceMethodParameters[1].Name); + Assert.AreEqual("contentType", convenienceMethodParameters[2].Name); + Assert.AreEqual("schemaContent", convenienceMethodParameters[3].Name); + } + + [Test] + public void ContentTypeOrderUsesBodyMetadataWhenLastContractHasMultipleBinaryDataParameters() + { + var checksumParam = InputFactory.MethodParameter( + "checksum", + InputPrimitiveType.Base64, + isRequired: true, + location: InputRequestLocation.Query); + var contentTypeParam = InputFactory.MethodParameter( + "contentType", + InputPrimitiveType.String, + isRequired: true, + serializedName: "Content-Type", + location: InputRequestLocation.Header); + var payloadParam = InputFactory.MethodParameter( + "payload", + InputPrimitiveType.Base64, + isRequired: true, + location: InputRequestLocation.Body); + var operation = InputFactory.Operation( + "Upload", + parameters: [ + InputFactory.QueryParameter("checksum", InputPrimitiveType.Base64, isRequired: true), + InputFactory.HeaderParameter("Content-Type", InputPrimitiveType.String, isRequired: true, isContentType: true), + InputFactory.BodyParameter("payload", InputPrimitiveType.Base64, isRequired: true) + ]); + var serviceMethod = InputFactory.BasicServiceMethod( + "Upload", + operation, + parameters: [checksumParam, contentTypeParam, payloadParam]); + var lastContractView = new LastContractTestTypeProvider(); + lastContractView.Update(methods: + [ + new MethodProvider( + new MethodSignature( + "Upload", + null, + MethodSignatureModifiers.Public, + null, + null, + [ + new ParameterProvider("checksum", $"", typeof(BinaryData)), + new ParameterProvider("contentType", $"", typeof(string)), + new ParameterProvider("payload", $"", typeof(BinaryData)) + ]), + MethodBodyStatement.Empty, + lastContractView) + ]); + var provider = new LastContractTestTypeProvider(lastContractView); + var method = typeof(RestClientProvider).GetMethod("HasContentTypeBeforeBodyInLastContract", BindingFlags.NonPublic | BindingFlags.Static)!; + + var shouldPreserveOrder = (bool)method.Invoke(null, [serviceMethod, provider])!; + + Assert.IsTrue(shouldPreserveOrder); + } + [Test] public async Task ParameterNamePreservedFromLastContractView() { @@ -738,38 +934,6 @@ public void ValidateGetResponseClassifiersThrowsWhenNoSuccess() Assert.Fail("Expected Exception to be thrown."); } - [Test] - public void TestBuildCreateRequestMethodWithExplodedModelQueryParameter() - { - var filterModel = InputFactory.Model( - "filterOptions", - properties: - [ - InputFactory.Property("field", InputPrimitiveType.String, isRequired: true), - InputFactory.Property("value", InputPrimitiveType.String, isRequired: true), - ]); - var operation = InputFactory.Operation( - "sampleOp", - parameters: [InputFactory.QueryParameter("filter", filterModel, isRequired: true, explode: true)]); - var client = InputFactory.Client( - "TestClient", - methods: [InputFactory.BasicServiceMethod("Test", operation)]); - var clientProvider = new ClientProvider(client); - var restClientProvider = new MockClientProvider(client, clientProvider); - - var method = restClientProvider.Methods.FirstOrDefault(m => m.Signature.Name == "CreateSampleOpRequest"); - Assert.IsNotNull(method); - var body = method!.BodyStatements!.ToDisplayString(); - - // A model-typed query parameter with `explode` is expanded into one query entry per - // property (RFC 6570 form explode) using each property's wire name, instead of serializing - // the whole object via ConvertToString (which produced the type name). - Assert.IsTrue(body.Contains("uri.AppendQuery(\"field\", filter.Field, true);"), body); - Assert.IsTrue(body.Contains("uri.AppendQuery(\"value\", filter.Value, true);"), body); - Assert.IsFalse(body.Contains("AppendQuery(\"filter\""), body); - Assert.IsFalse(body.Contains("ConvertToString(filter)"), body); - } - [Test] public void TestBuildCreateRequestMethodWithQueryParameters() { @@ -1741,6 +1905,29 @@ protected override ScmMethodProvider[] BuildMethods() protected override TypeProvider[] BuildNestedTypes() => []; } + private class LastContractTestTypeProvider : TypeProvider + { + private readonly MethodProvider[] _methods; + private readonly TypeProvider? _lastContractView; + + public LastContractTestTypeProvider(params MethodProvider[] methods) + { + _methods = methods; + } + + public LastContractTestTypeProvider(TypeProvider lastContractView) + { + _methods = []; + _lastContractView = lastContractView; + } + + protected override string BuildName() => "TestClient"; + protected override string BuildNamespace() => "Sample"; + protected override string BuildRelativeFilePath() => "TestClient.cs"; + protected internal override MethodProvider[] BuildMethods() => _methods; + private protected override TypeProvider? BuildLastContractView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _lastContractView; + } + private static IEnumerable ValidateApiVersionPathParameterTestCases() { InputMethodParameter endpointParameter = InputFactory.MethodParameter( diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs new file mode 100644 index 00000000000..e7005ee3202 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs @@ -0,0 +1,20 @@ +#nullable disable + +using System; +using System.ClientModel; +using System.Threading; +using System.Threading.Tasks; + +namespace Sample +{ + public partial class TestClient + { + // This represents a previous contract where contentType appears before a named body parameter. + internal virtual Task RegisterSchemaAsync(string groupName, string schemaName, SchemaContentTypeValues contentType, BinaryData schemaContent, CancellationToken cancellationToken = default) { return null; } + internal virtual ClientResult RegisterSchema(string groupName, string schemaName, SchemaContentTypeValues contentType, BinaryData schemaContent, CancellationToken cancellationToken = default) { return null; } + } + + internal readonly partial struct SchemaContentTypeValues + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs new file mode 100644 index 00000000000..b21ea1df8bf --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs @@ -0,0 +1,16 @@ +#nullable disable + +using System.ClientModel.Primitives; + +namespace SampleNamespace +{ + public partial class TestClientOptions : ClientPipelineOptions + { + public enum ServiceVersion + { + V2023_10_01_Preview_1 = 0, + V2023_11_01 = 1, + V2024_01_01 = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs new file mode 100644 index 00000000000..5deb0d63350 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs @@ -0,0 +1,15 @@ +#nullable disable + +using System.ClientModel.Primitives; +using Microsoft.TypeSpec.Generator.Customizations; + +namespace SampleNamespace +{ + [CodeGenType("RawClientOptions")] + public partial class TestClientOptions : ClientPipelineOptions + { + public TestClientOptions(ServiceVersion version) + { + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs new file mode 100644 index 00000000000..a34d00e3c6e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs @@ -0,0 +1,6 @@ +namespace Sample +{ + internal partial class ClientA + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs new file mode 100644 index 00000000000..2bfb3b16ae8 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs @@ -0,0 +1,6 @@ +namespace Sample +{ + internal partial class ClientB + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs new file mode 100644 index 00000000000..3eb98f9a9e3 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs @@ -0,0 +1,6 @@ +namespace Sample +{ + internal partial class InternalClient + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs new file mode 100644 index 00000000000..b209cd1a18c --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Tests.Common; +using NUnit.Framework; + +namespace Microsoft.TypeSpec.Generator.ClientModel.Tests.ReferenceMap +{ + public class ClientBodyDependencyReferenceMapTests + { + [Test] + public async Task PublicOperationBodyParameterModelIsRetained() + { + var requestModel = InputFactory.Model("RequestBody"); + var parameter = InputFactory.BodyParameter("body", requestModel, isRequired: true); + var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST"); + var method = InputFactory.BasicServiceMethod("Create", operation); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [requestModel], + clients: [client], + customFiles: [], + expectedFiles: [], + publicModelNames: ["RequestBody"]); + } + + [Test] + public async Task PublicProtocolOnlyOperationBodyParameterModelIsRetained() + { + var requestModel = InputFactory.Model("RequestBody"); + var parameter = InputFactory.BodyParameter("body", requestModel, isRequired: true); + var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST", generateConvenienceMethod: false); + var method = InputFactory.BasicServiceMethod("Create", operation); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [requestModel], + clients: [client], + customFiles: [], + expectedFiles: [], + publicModelNames: ["RequestBody"]); + } + + [Test] + public async Task OperationResponseBodyModelRemainsPublicAsRootOutputModel() + { + var responseModel = InputFactory.Model("ResponseBody"); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); + var method = InputFactory.BasicServiceMethod( + "Get", + operation, + response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertPublicModels([responseModel], [client], ["ResponseBody"]); + } + + [Test] + public async Task InternalModelReferencedByPublicModelPropertyIsPublicized() + { + var dependencyModel = InputFactory.Model("DependencyModel", access: "internal"); + var responseModel = InputFactory.Model( + "ResponseBody", + properties: [InputFactory.Property("Dependency", dependencyModel)]); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); + var method = InputFactory.BasicServiceMethod( + "Get", + operation, + response: InputFactory.ServiceMethodResponse(responseModel, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertPublicModels([responseModel, dependencyModel], [client], ["ResponseBody", "DependencyModel"]); + } + + [Test] + public async Task InternalModelReferencedByPublicNonRootCollectionPropertyIsPublicized() + { + var dependencyModel = InputFactory.Model("DependencyModel", access: "internal"); + var responseModel = InputFactory.Model( + "ResponseBody", + properties: [InputFactory.Property("Dependencies", InputFactory.Array(dependencyModel))]); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); + var method = InputFactory.BasicServiceMethod( + "Get", + operation, + response: InputFactory.ServiceMethodResponse(responseModel, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [responseModel, dependencyModel], + clients: [client], + customFiles: [ + (Path.Combine("src", "Generated", "SampleModelFactory.cs"), """ + using System.Collections.Generic; + using Sample.Models; + + namespace Sample; + + public static partial class SampleModelFactory + { + public static ResponseBody ResponseBody(IEnumerable dependencies = default) => null; + } + """) + ], + expectedFiles: [], + publicModelNames: ["ResponseBody", "DependencyModel"], + configureGenerator: () => + { + var responseProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "ResponseBody"); + var dependencyProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "DependencyModel"); + CodeModelGenerator.Instance.AddTypeToKeep(responseProvider, isRoot: false); + CodeModelGenerator.Instance.AddTypeToKeep(dependencyProvider, isRoot: false); + }); + } + + [Test] + public async Task PublicInputRootsOverrideCustomInternalBoundary() + { + var customInternalModel = InputFactory.Model("CustomInternalModel"); + var publicWrapper = InputFactory.Model( + "PublicWrapper", + properties: [InputFactory.Property("CustomInternal", customInternalModel)]); + + var outputPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(outputPath); + try + { + var customPath = Path.Combine(outputPath, "src", "Custom", "CustomInternalModel.cs"); + Directory.CreateDirectory(Path.GetDirectoryName(customPath)!); + File.WriteAllText(customPath, """ + using Microsoft.TypeSpec.Generator.Customizations; + + namespace Sample.Models; + + [CodeGenType("CustomInternalModel")] + internal partial class CustomInternalModel + { + } + """); + var modelFactoryPath = Path.Combine(outputPath, "src", "Generated", "SampleModelFactory.cs"); + Directory.CreateDirectory(Path.GetDirectoryName(modelFactoryPath)!); + File.WriteAllText(modelFactoryPath, """ + using Sample.Models; + + namespace Sample; + + public static partial class SampleModelFactory + { + public static PublicWrapper PublicWrapper(CustomInternalModel customInternal = default) => null; + } + """); + + await MockHelpers.LoadMockGeneratorAsync( + inputModels: () => [publicWrapper, customInternalModel], + configuration: """{ "package-name": "Sample", "disable-xml-docs": true }""", + outputPath: outputPath); + + var publicWrapperProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "PublicWrapper"); + var customInternalProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "CustomInternalModel"); + CodeModelGenerator.Instance.AddTypeToKeep(publicWrapperProvider, isRoot: false); + CodeModelGenerator.Instance.AddTypeToKeep(customInternalProvider, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(CodeModelGenerator.Instance.OutputLibrary.TypeProviders); + + Assert.IsTrue(publicWrapperProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public), "PublicWrapper should remain public because it is an explicit input root."); + Assert.IsTrue(customInternalProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public), "Public input roots should preserve their declared accessibility."); + } + finally + { + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + if (Directory.Exists(outputPath)) + { + Directory.Delete(outputPath, recursive: true); + } + } + } + + [Test] + public async Task PublicOperationResponseBodyModelIsRetained() + { + var metadataOnlyModel = InputFactory.Model("MetadataOnlyResponse"); + var operation = InputFactory.Operation( + "Get", + responses: [ + InputFactory.OperationResponse(bodytype: InputPrimitiveType.String), + new InputOperationResponse([202], metadataOnlyModel, [], isErrorResponse: false, ["application/json"]) + ]); + var method = InputFactory.BasicServiceMethod( + "Get", + operation, + response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [metadataOnlyModel], + clients: [client], + customFiles: [], + expectedFiles: [], + publicModelNames: ["MetadataOnlyResponse"]); + } + + [Test] + public async Task EmptyCustomPartialModelIsKept() + { + var customizedModel = InputFactory.Model("CustomizedModel"); + + await GenerateAndAssertFiles( + enums: [], + models: [customizedModel], + clients: [], + customFiles: [( + Path.Combine("src", "CustomizedModel.cs"), + """ + namespace Sample.Models + { + public partial class CustomizedModel + { + } + } + """)], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "CustomizedModel.cs"), + Path.Combine("src", "Generated", "Models", "CustomizedModel.Serialization.cs") + ]); + } + + [Test] + public async Task InternalAdditionalRootModelIsRetainedAsInternal() + { + var metadataOnlyModel = InputFactory.Model("MetadataOnlyResponse", access: "internal"); + var operation = InputFactory.Operation( + "Get", + responses: [ + InputFactory.OperationResponse(bodytype: InputPrimitiveType.String), + new InputOperationResponse([202], metadataOnlyModel, [], isErrorResponse: false, ["application/json"]) + ]); + var method = InputFactory.BasicServiceMethod( + "Get", + operation, + response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [metadataOnlyModel], + clients: [client], + customFiles: [], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "MetadataOnlyResponse.cs"), + Path.Combine("src", "Generated", "Models", "MetadataOnlyResponse.Serialization.cs") + ], + internalModelNames: ["MetadataOnlyResponse"], + configureGenerator: () => + { + var provider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "MetadataOnlyResponse"); + CodeModelGenerator.Instance.AddTypeToKeep(provider); + }); + } + + [Test] + public async Task PublicAdditionalRootEnumIsRetained() + { + var metadataOnlyEnum = InputFactory.StringEnum( + "MetadataOnlyResponseKind", + [("Accepted", "accepted")]); + var operation = InputFactory.Operation( + "Get", + responses: [ + InputFactory.OperationResponse(bodytype: InputPrimitiveType.String), + new InputOperationResponse([202], metadataOnlyEnum, [], isErrorResponse: false, ["application/json"]) + ]); + var method = InputFactory.BasicServiceMethod( + "Get", + operation, + response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [metadataOnlyEnum], + models: [], + clients: [client], + customFiles: [], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "MetadataOnlyResponseKind.cs"), + Path.Combine("src", "Generated", "Models", "MetadataOnlyResponseKind.Serialization.cs") + ]); + } + + [Test] + public async Task PublicContentTypeHeaderEnumIsRetained() + { + var contentTypeEnum = InputFactory.StringEnum( + "UpdateSnapshotRequestContentType", + [ + ("ApplicationMergePatchJson", "application/merge-patch+json"), + ("ApplicationJson", "application/json") + ]); + var contentTypeParameter = InputFactory.MethodParameter( + "contentType", + InputFactory.Union([contentTypeEnum], "contentType"), + isRequired: true, + location: InputRequestLocation.Header, + serializedName: "Content-Type"); + var operation = InputFactory.Operation( + "UpdateSnapshot", + parameters: [contentTypeParameter], + httpMethod: "PATCH", + generateConvenienceMethod: false); + var method = InputFactory.BasicServiceMethod( + "UpdateSnapshot", + operation, + parameters: [ + InputFactory.MethodParameter("name", InputPrimitiveType.String, isRequired: true, location: InputRequestLocation.Path), + contentTypeParameter, + InputFactory.MethodParameter("content", InputPrimitiveType.Base64, isRequired: true) + ]); + var client = InputFactory.Client("ConfigurationClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [contentTypeEnum], + models: [], + clients: [client], + customFiles: [], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "UpdateSnapshotRequestContentType.cs"), + Path.Combine("src", "Generated", "Models", "UpdateSnapshotRequestContentType.Serialization.cs") + ], + configureGenerator: () => + CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(InputFactory.Union([contentTypeEnum], "contentType"))); + } + + [Test] + public async Task PublicEnumIsRetainedWhenNotOtherwiseReferenced() + { + var metadataOnlyEnum = InputFactory.StringEnum( + "MetadataOnlyKind", + [("One", "one")]); + + await GenerateAndAssertFiles( + enums: [metadataOnlyEnum], + models: [], + clients: [], + customFiles: [], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "MetadataOnlyKind.cs"), + Path.Combine("src", "Generated", "Models", "MetadataOnlyKind.Serialization.cs") + ]); + } + + [Test] + public async Task ContentTypeHeaderEnumReferencedByCustomSuppressionIsKept() + { + var contentTypeEnum = InputFactory.StringEnum( + "PutKeyValueRequestContentType", + [("ApplicationJson", "application/json")], + isExtensible: true); + var contentTypeParameter = InputFactory.HeaderParameter( + "contentType", + InputFactory.Union([contentTypeEnum], "contentType"), + isRequired: true, + isContentType: true, + serializedName: "Content-Type"); + var operation = InputFactory.Operation( + "SetConfigurationSettingInternal", + parameters: [contentTypeParameter], + httpMethod: "PUT"); + var method = InputFactory.BasicServiceMethod("SetConfigurationSettingInternal", operation); + var client = InputFactory.Client("ConfigurationClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [contentTypeEnum], + models: [], + clients: [client], + customFiles: [ + (Path.Combine("src", "PutKeyValueRequestContentType.cs"), """ + namespace Sample.Models; + + internal readonly partial struct PutKeyValueRequestContentType + { + public static PutKeyValueRequestContentType ApplicationJson { get; } = new PutKeyValueRequestContentType("application/json"); + } + """) + ], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "PutKeyValueRequestContentType.cs") + ]); + } + + [Test] + public async Task ContentTypeHeaderEnumReferencedOnlyByCustomSuppressionAttributeIsKept() + { + var contentTypeEnum = InputFactory.StringEnum( + "CreateSnapshotRequestContentType", + [("ApplicationJson", "application/json")], + isExtensible: true); + var contentTypeParameter = InputFactory.MethodParameter( + "contentType", + InputFactory.Union([contentTypeEnum], "contentType"), + isRequired: true, + location: InputRequestLocation.Header, + serializedName: "Content-Type"); + var operation = InputFactory.Operation( + "CreateSnapshot", + parameters: [contentTypeParameter], + httpMethod: "PUT", + generateConvenienceMethod: false); + var method = InputFactory.BasicServiceMethod( + "CreateSnapshot", + operation, + parameters: [ + InputFactory.MethodParameter("name", InputPrimitiveType.String, isRequired: true, location: InputRequestLocation.Path), + contentTypeParameter, + InputFactory.MethodParameter("content", InputPrimitiveType.Base64, isRequired: true) + ]); + var client = InputFactory.Client("ConfigurationClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [contentTypeEnum], + models: [], + clients: [client], + customFiles: [ + (Path.Combine("src", "ConfigurationClient.cs"), """ + namespace Sample; + + [Microsoft.TypeSpec.Generator.Customizations.CodeGenType("ConfigurationClient")] + [Microsoft.TypeSpec.Generator.Customizations.CodeGenSuppress("CreateSnapshot", typeof(string), typeof(CreateSnapshotRequestContentType))] + public partial class ConfigurationClient + { + } + """) + ], + expectedFiles: [ + Path.Combine("src", "Generated", "Models", "CreateSnapshotRequestContentType.cs") + ]); + } + + [Test] + public async Task PublicNestedBodyModelGraphRemainsPublic() + { + var nestedModel = InputFactory.Model("NestedToolParameter"); + var toolModel = InputFactory.Model( + "ToolConfig", + properties: [InputFactory.Property("Parameter", nestedModel)]); + var parameter = InputFactory.BodyParameter("tool", toolModel, isRequired: true); + var operation = InputFactory.Operation("Configure", parameters: [parameter], httpMethod: "POST"); + var method = InputFactory.BasicServiceMethod("Configure", operation); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [toolModel, nestedModel], + clients: [client], + customFiles: [], + expectedFiles: [], + publicModelNames: ["ToolConfig", "NestedToolParameter"]); + } + + [Test] + public async Task PublicNonDiscriminatorDerivedBodyModelRemainsPublic() + { + var baseTool = InputFactory.Model("BaseTool"); + var concreteTool = InputFactory.Model( + "ConcreteTool", + properties: [InputFactory.Property("Name", InputPrimitiveType.String)], + baseModel: baseTool); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: baseTool)]); + var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(baseTool, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertMixedModels( + [baseTool, concreteTool], + [client], + publicModelNames: ["BaseTool", "ConcreteTool"], + internalModelNames: []); + } + + [Test] + public async Task PublicModelSignatureDependencyIsPromotedToPublic() + { + var internalDependency = InputFactory.Model("InternalDependency", access: "internal"); + var responseModel = InputFactory.Model( + "ResponseBody", + properties: [InputFactory.Property("Dependency", internalDependency)]); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); + var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(responseModel, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertPublicModels([responseModel, internalDependency], [client], ["ResponseBody", "InternalDependency"]); + } + + [Test] + public async Task AzureClientPublicMethodSignatureReferencesStayPublic() + { + var signatureModel = InputFactory.Model("SignatureModel", @namespace: "Azure.Sample.Models"); + var methodParameter = InputFactory.MethodParameter("signature", signatureModel, isRequired: true); + var operation = InputFactory.Operation( + "Create", + parameters: [InputFactory.BodyParameter("signature", signatureModel, isRequired: true)], + httpMethod: "POST"); + var method = InputFactory.BasicServiceMethod("Create", operation, parameters: [methodParameter]); + var client = InputFactory.Client("SampleClient", clientNamespace: "Azure.Sample", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [signatureModel], + clients: [client], + customFiles: [], + expectedFiles: [], + publicModelNames: ["SignatureModel"], + packageName: "Azure.Sample"); + } + + [Test] + public async Task BasePreservedDerivedModelTraversesTransitiveDependencies() + { + var transitiveDependency = InputFactory.Model("TransitiveDependency"); + var dependency = InputFactory.Model( + "DerivedDependency", + properties: [InputFactory.Property("Transitive", transitiveDependency)]); + var baseModel = InputFactory.Model("BaseResult"); + var derivedModel = InputFactory.Model( + "DerivedResult", + properties: [InputFactory.Property("Dependency", dependency)], + baseModel: baseModel); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: baseModel)]); + var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(baseModel, [])); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [baseModel, derivedModel, dependency, transitiveDependency], + clients: [client], + customFiles: [], + expectedFiles: [], + publicModelNames: ["BaseResult", "DerivedResult", "DerivedDependency", "TransitiveDependency"]); + } + + [Test] + public async Task PublicCustomCodeArraySignatureReferencesStayPublic() + { + var generatedModel = InputFactory.Model("GeneratedModel"); + + await GenerateAndAssertFiles( + enums: [], + models: [generatedModel], + clients: [], + customFiles: [ + (Path.Combine("src", "PublicCustomApi.cs"), """ + using Sample.Models; + + namespace Sample; + + public partial class PublicCustomApi + { + public GeneratedModel[] Items { get; } = System.Array.Empty(); + } + """) + ], + expectedFiles: [], + publicModelNames: ["GeneratedModel"]); + } + + [Test] + public async Task PublicCustomCodeTypeConstraintsStayPublic() + { + var generatedModel = InputFactory.Model("GeneratedModel", access: "internal"); + + await GenerateAndAssertFiles( + enums: [], + models: [generatedModel], + clients: [], + customFiles: [ + (Path.Combine("src", "PublicCustomApi.cs"), """ + using Sample.Models; + + namespace Sample; + + public partial class PublicCustomApi where T : GeneratedModel + { + } + """) + ], + expectedFiles: [], + publicModelNames: ["GeneratedModel"]); + } + + [Test] + public async Task GeneratedRequestHeaderSetDelimitedReferenceKeepsExtensions() + { + var header = InputFactory.HeaderParameter("x-ms-custom", InputFactory.Array(InputPrimitiveType.String), isRequired: true); + var operation = InputFactory.Operation("Create", parameters: [header]); + var method = InputFactory.BasicServiceMethod("Create", operation); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [], + clients: [client], + customFiles: [], + expectedFiles: [Path.Combine("src", "Generated", "Internal", "PipelineRequestHeadersExtensions.cs")]); + } + + [Test] + public async Task GeneratedPrefixedDictionaryHeaderKeepsExtensions() + { + var header = InputFactory.HeaderParameter( + "x-ms-meta", + InputFactory.Dictionary(InputPrimitiveType.String), + isRequired: true, + collectionHeaderPrefix: "x-ms-meta-"); + var operation = InputFactory.Operation("Create", parameters: [header]); + var method = InputFactory.BasicServiceMethod("Create", operation); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [], + clients: [client], + customFiles: [], + expectedFiles: [Path.Combine("src", "Generated", "Internal", "PipelineRequestHeadersExtensions.cs")]); + } + + [Test] + public async Task BinaryDataBodyParameterDoesNotKeepBinaryContentHelpers() + { + var parameter = InputFactory.BodyParameter( + "content", + InputPrimitiveType.Base64, + isRequired: true, + contentTypes: ["application/octet-stream"], + defaultContentType: "application/octet-stream"); + var operation = InputFactory.Operation("Upload", parameters: [parameter], httpMethod: "POST"); + var method = InputFactory.BasicServiceMethod( + "Upload", + operation, + parameters: [InputFactory.MethodParameter("content", InputPrimitiveType.Base64, isRequired: true)]); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [], + clients: [client], + customFiles: [], + expectedFiles: [], + unexpectedFiles: [ + Path.Combine("src", "Generated", "Internal", "BinaryContentHelper.cs"), + Path.Combine("src", "Generated", "Internal", "Utf8JsonBinaryContent.cs") + ]); + } + + [Test] + public async Task CollectionBodyParameterKeepsBinaryContentHelpers() + { + var parameter = InputFactory.BodyParameter("items", InputFactory.Array(InputPrimitiveType.String), isRequired: true); + var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST"); + var method = InputFactory.BasicServiceMethod( + "Create", + operation, + parameters: [InputFactory.MethodParameter("items", InputFactory.Array(InputPrimitiveType.String), isRequired: true)]); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [], + clients: [client], + customFiles: [], + expectedFiles: [ + Path.Combine("src", "Generated", "Internal", "BinaryContentHelper.cs"), + Path.Combine("src", "Generated", "Internal", "Utf8JsonBinaryContent.cs") + ]); + } + + [Test] + public async Task CustomOnlyRequestHeaderSetDelimitedReferenceKeepsExtensions() + { + await GenerateAndAssertFiles( + enums: [], + models: [], + clients: [], + customFiles: [ + (Path.Combine("src", "CustomHeaders.cs"), """ + using System.ClientModel.Primitives; + + namespace Sample; + + public static class CustomHeaders + { + public static void Add(PipelineRequestHeaders headers, string[] values) + => headers.SetDelimited("x-ms-custom", values, ","); + } + """) + ], + expectedFiles: [Path.Combine("src", "Generated", "Internal", "PipelineRequestHeadersExtensions.cs")]); + } + + [Test] + public async Task CustomizedEnumSerializationProviderIsKeptWhenModelSerializationUsesEnum() + { + var statusEnum = InputFactory.StringEnum( + "Status", + [("Succeeded", "succeeded"), ("Failed", "failed")], + clientNamespace: "Sample"); + var resultModel = InputFactory.Model( + "OperationResult", + properties: [InputFactory.Property("Status", statusEnum, isRequired: true)], + @namespace: "Sample"); + var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: resultModel)]); + var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(resultModel, [])); + var client = InputFactory.Client("TestClient", methods: [method], clientNamespace: "Sample"); + + await GenerateAndAssertFiles( + enums: [statusEnum], + models: [resultModel], + clients: [client], + customFiles: [ + (Path.Combine("src", "Custom", "Status.cs"), """ + namespace Sample; + + [CodeGenType("Status")] + public enum Status + { + Succeeded, + Failed + } + """) + ], + expectedFiles: [Path.Combine("src", "Generated", "Models", "Status.Serialization.cs")]); + } + + [Test] + public async Task PublicBodyOnlyModelRemainsPublicWithCustomModelFactory() + { + var requestModel = InputFactory.Model("RequestBody"); + var parameter = InputFactory.BodyParameter("body", requestModel, isRequired: true); + var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST"); + var method = InputFactory.BasicServiceMethod("Create", operation); + var client = InputFactory.Client("TestClient", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [requestModel], + clients: [client], + customFiles: [ + (Path.Combine("src", "SampleModelFactory.cs"), """ + namespace Sample; + + [Microsoft.TypeSpec.Generator.Customizations.CodeGenType("SampleModelFactory")] + public static partial class SampleModelFactory + { + } + """) + ], + expectedFiles: [], + publicModelNames: ["RequestBody"]); + } + + [Test] + public async Task InternalCustomClientPartialOverridesLastContractPublicClient() + { + var responseModel = InputFactory.Model("CompactResource"); + var operation = InputFactory.Operation("Compact", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); + var method = InputFactory.BasicServiceMethod("Compact", operation, response: InputFactory.ServiceMethodResponse(responseModel, [])); + var client = InputFactory.Client("Responses", methods: [method]); + + await GenerateAndAssertFiles( + enums: [], + models: [responseModel], + clients: [client], + customFiles: [ + (Path.Combine("src", "Generated", "Responses.cs"), """ + namespace Sample; + + public partial class Responses + { + } + """), + (Path.Combine("src", "Custom", "Internal", "Responses.cs"), """ + namespace Sample; + + internal partial class Responses + { + } + """) + ], + expectedFiles: [], + publicModelNames: ["CompactResource"], + internalClientNames: ["Responses"]); + } + + private static async Task GenerateAndAssertInternalModels( + InputModelType[] models, + InputClient[] clients, + string[] modelNames) + => await GenerateAndAssertModels(models, clients, modelNames, shouldBePublic: false); + + private static async Task GenerateAndAssertPublicModels( + InputModelType[] models, + InputClient[] clients, + string[] modelNames) + => await GenerateAndAssertModels(models, clients, modelNames, shouldBePublic: true); + + private static async Task GenerateAndAssertMixedModels( + InputModelType[] models, + InputClient[] clients, + string[] publicModelNames, + string[] internalModelNames) + => await GenerateAndAssertModels(models, clients, publicModelNames, internalModelNames); + + private static async Task GenerateAndAssertModels( + InputModelType[] models, + InputClient[] clients, + string[] modelNames, + bool shouldBePublic) + => await GenerateAndAssertModels( + models, + clients, + shouldBePublic ? modelNames : [], + shouldBePublic ? [] : modelNames); + + private static async Task GenerateAndAssertModels( + InputModelType[] models, + InputClient[] clients, + string[] publicModelNames, + string[] internalModelNames) + { + await GenerateAndAssertFiles( + enums: [], + models: models, + clients: clients, + customFiles: [], + publicModelNames: publicModelNames, + internalModelNames: internalModelNames, + expectedFiles: []); + } + + private static async Task GenerateAndAssertFiles( + InputEnumType[] enums, + InputModelType[] models, + InputClient[] clients, + (string Path, string Content)[] customFiles, + string[] expectedFiles, + string[] unexpectedFiles = null!, + string[] publicModelNames = null!, + string[] internalModelNames = null!, + string[] internalClientNames = null!, + string packageName = "Sample", + Action? configureGenerator = null) + { + publicModelNames ??= []; + internalModelNames ??= []; + internalClientNames ??= []; + unexpectedFiles ??= []; + + var outputPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(outputPath); + try + { + foreach (var customFile in customFiles) + { + var customPath = Path.Combine(outputPath, customFile.Path); + Directory.CreateDirectory(Path.GetDirectoryName(customPath)!); + File.WriteAllText(customPath, customFile.Content); + } + + await MockHelpers.LoadMockGeneratorAsync( + inputEnums: () => enums, + inputModels: () => models, + clients: () => clients, + configuration: $$"""{ "package-name": "{{packageName}}", "disable-xml-docs": true }""", + outputPath: outputPath); + configureGenerator?.Invoke(); + + await new CSharpGen().ExecuteAsync(); + + foreach (var modelName in publicModelNames) + { + var modelPath = Path.Combine(outputPath, "src", "Generated", "Models", $"{modelName}.cs"); + Assert.IsTrue(File.Exists(modelPath), $"Expected generated model file '{modelPath}'."); + var text = File.ReadAllText(modelPath); + StringAssert.Contains($"public partial class {modelName}", text, $"{modelName} should be public."); + } + + foreach (var modelName in internalModelNames) + { + var modelPath = Path.Combine(outputPath, "src", "Generated", "Models", $"{modelName}.cs"); + Assert.IsTrue(File.Exists(modelPath), $"Expected generated model file '{modelPath}'."); + var text = File.ReadAllText(modelPath); + StringAssert.Contains($"internal partial class {modelName}", text, $"{modelName} should be internal."); + StringAssert.DoesNotContain($"public partial class {modelName}", text, $"{modelName} should not be public."); + } + + foreach (var clientName in internalClientNames) + { + var clientPath = Path.Combine(outputPath, "src", "Generated", $"{clientName}.cs"); + Assert.IsTrue(File.Exists(clientPath), $"Expected generated client file '{clientPath}'."); + var text = File.ReadAllText(clientPath); + StringAssert.Contains($"internal partial class {clientName}", text, $"{clientName} should be internal."); + StringAssert.DoesNotContain($"public partial class {clientName}", text, $"{clientName} should not be public."); + } + + var modelFactoryPath = Path.Combine(outputPath, "src", "Generated", "SampleModelFactory.cs"); + if (File.Exists(modelFactoryPath)) + { + var modelFactoryText = File.ReadAllText(modelFactoryPath); + foreach (var modelName in publicModelNames) + { + StringAssert.Contains($" {modelName}(", modelFactoryText, $"Model factory method for {modelName} should be generated."); + } + + foreach (var modelName in internalModelNames) + { + StringAssert.DoesNotContain($" {modelName}(", modelFactoryText, $"Model factory method for {modelName} should not be generated."); + } + } + + foreach (var expectedFile in expectedFiles) + { + var filePath = Path.Combine(outputPath, expectedFile); + Assert.IsTrue(File.Exists(filePath), $"Expected generated file '{filePath}'."); + } + + foreach (var unexpectedFile in unexpectedFiles) + { + var filePath = Path.Combine(outputPath, unexpectedFile); + Assert.IsFalse(File.Exists(filePath), $"Did not expect generated file '{filePath}'."); + } + } + finally + { + if (Directory.Exists(outputPath)) + { + Directory.Delete(outputPath, recursive: true); + } + } + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs index 9148f659e43..6c6e743ad89 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs @@ -34,7 +34,8 @@ public static async Task> LoadMockGeneratorAsync( Func>? apiVersions = null, string? configuration = null, Func? createCSharpTypeCore = null, - Func? createCSharpTypeCoreFallback = null) + Func? createCSharpTypeCoreFallback = null, + string? outputPath = null) { var mockGenerator = LoadMockGenerator( inputLiterals: inputLiterals, @@ -44,13 +45,13 @@ public static async Task> LoadMockGeneratorAsync( apiVersions: apiVersions, configuration: configuration, createCSharpTypeCore: createCSharpTypeCore, - createCSharpTypeCoreFallback: createCSharpTypeCoreFallback); + createCSharpTypeCoreFallback: createCSharpTypeCoreFallback, + outputPath: outputPath); var compilationResult = compilation == null ? null : await compilation(); var lastContractCompilationResult = lastContractCompilation == null ? null : await lastContractCompilation(); - var sourceInputModel = new Mock(() => new SourceInputModel(compilationResult, lastContractCompilationResult)) { CallBase = true }; - mockGenerator.Setup(p => p.SourceInputModel).Returns(sourceInputModel.Object); + mockGenerator.SetupProperty(p => p.SourceInputModel, new SourceInputModel(compilationResult, lastContractCompilationResult)); return mockGenerator; } @@ -76,7 +77,8 @@ public static Mock LoadMockGenerator( Func? createOutputLibrary = null, bool includeXmlDocs = false, Func? createCSharpTypeCoreFallback = null, - Func? createModelCore = null) + Func? createModelCore = null, + string? outputPath = null) { IReadOnlyList inputNsApiVersions = apiVersions?.Invoke() ?? []; IReadOnlyList inputNsLiterals = inputLiterals?.Invoke() ?? []; @@ -150,7 +152,7 @@ public static Mock LoadMockGenerator( { configuration = "{\"disable-xml-docs\": false, \"package-name\": \"Sample.Namespace\"}"; } - object?[] parameters = [_configFilePath, configuration]; + object?[] parameters = [outputPath ?? _configFilePath, configuration]; var config = loadMethod?.Invoke(null, parameters); var mockGeneratorContext = new Mock(config!); var mockGeneratorInstance = new Mock(mockGeneratorContext.Object) { CallBase = true }; @@ -186,8 +188,7 @@ public static Mock LoadMockGenerator( mockGeneratorInstance.Setup(p => p.OutputLibrary).Returns(createOutputLibrary); } - var sourceInputModel = new Mock(() => new SourceInputModel(null, null)) { CallBase = true }; - mockGeneratorInstance.Setup(p => p.SourceInputModel).Returns(sourceInputModel.Object); + mockGeneratorInstance.SetupProperty(p => p.SourceInputModel, new SourceInputModel(null, null)); codeModelInstance!.SetValue(null, mockGeneratorInstance.Object); clientModelInstance!.SetValue(null, mockGeneratorInstance.Object); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs index c013817a72e..94abf17e68e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs @@ -31,8 +31,8 @@ public async Task ExecuteAsync() var outputPath = CodeModelGenerator.Instance.Configuration.OutputDirectory; var generatedSourceOutputPath = CodeModelGenerator.Instance.Configuration.ProjectGeneratedDirectory; - // Resolve PackageReference items from the .csproj so custom code referencing - // external NuGet types (e.g., Azure.Storage.Common) compiles correctly. + // Resolve PackageReference items from the .csproj so custom code referencing external + // NuGet types compiles correctly. await GeneratedCodeWorkspace.AddPackageReferencesFromProject(); // Pre-walk the input library and resolve any external types that point at NuGet packages. @@ -90,36 +90,69 @@ await GeneratedCodeWorkspace.LoadBaselineContract(), { // Ensure back-compatibility processing is done after all visitors have run outputType.ProcessTypeForBackCompatibility(); + } - var writer = CodeModelGenerator.Instance.GetWriter(outputType); - generateFilesTasks.Add(generatedCodeWorkspace.AddGeneratedFile(writer.Write())); - - foreach (var serialization in outputType.SerializationProviders) + try + { + using var referenceMapSession = ProviderReferenceMapAnalyzer.PrepareForGeneration(output.TypeProviders); + foreach (var outputType in output.TypeProviders) { - writer = CodeModelGenerator.Instance.GetWriter(serialization); + if (!referenceMapSession.ShouldWriteProvider(outputType)) + { + continue; + } + + if (outputType is ModelFactoryProvider && outputType.Methods.Count == 0) + { + continue; + } + + var writer = CodeModelGenerator.Instance.GetWriter(outputType); generateFilesTasks.Add(generatedCodeWorkspace.AddGeneratedFile(writer.Write())); + + foreach (var serialization in outputType.SerializationProviders) + { + if (!referenceMapSession.ShouldWriteProvider(serialization)) + { + continue; + } + + writer = CodeModelGenerator.Instance.GetWriter(serialization); + generateFilesTasks.Add(generatedCodeWorkspace.AddGeneratedFile(writer.Write())); + } } - } - // Add all the generated files to the workspace - await Task.WhenAll(generateFilesTasks); + // Add all the generated files to the workspace + await Task.WhenAll(generateFilesTasks); - LoggingHelpers.LogElapsedTime("All generated types have been written into memory"); + referenceMapSession.RestorePreWriteModelFactoryMethods(); - // Delete any old generated files - DeleteDirectory(generatedSourceOutputPath, _filesToKeep); + LoggingHelpers.LogElapsedTime("All generated types have been written into memory"); - LoggingHelpers.LogElapsedTime("All old generated files have been deleted"); + // Delete any old generated files + DeleteDirectory(generatedSourceOutputPath, _filesToKeep); - await generatedCodeWorkspace.PostProcessAsync(); + LoggingHelpers.LogElapsedTime("All old generated files have been deleted"); + } + finally + { + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + } - // Write the generated files to the output directory + var generatedFiles = new List<(string Name, string Text)>(); await foreach (var file in generatedCodeWorkspace.GetGeneratedFilesAsync()) { if (string.IsNullOrEmpty(file.Text)) { continue; } + + generatedFiles.Add((file.Name, file.Text)); + } + + // Write the generated files to the output directory + foreach (var file in generatedFiles) + { var filename = Path.Combine(outputPath, file.Name); CodeModelGenerator.Instance.Emitter.Info($"Writing {Path.GetFullPath(filename)}"); Directory.CreateDirectory(Path.GetDirectoryName(filename)!); @@ -140,15 +173,30 @@ await GeneratedCodeWorkspace.LoadBaselineContract(), internal static void FilterAllCustomizedMembers(OutputLibrary output) { + var visited = new HashSet(); foreach (var typeProvider in output.TypeProviders) { - // Update the type with the potentially modified members, filtering out customized members - // after the visitors have been applied so that the filtering is done against the final version. - FilterCustomizedMembers(typeProvider); - foreach (var serializationProvider in typeProvider.SerializationProviders) - { - FilterCustomizedMembers(serializationProvider); - } + FilterAllCustomizedMembers(typeProvider, visited); + } + } + + private static void FilterAllCustomizedMembers(TypeProvider typeProvider, HashSet visited) + { + if (!visited.Add(typeProvider)) + { + return; + } + + // Update the type with the potentially modified members, filtering out customized members + // after the visitors have been applied so that the filtering is done against the final version. + FilterCustomizedMembers(typeProvider); + foreach (var serializationProvider in typeProvider.SerializationProviders) + { + FilterAllCustomizedMembers(serializationProvider, visited); + } + foreach (var nestedType in typeProvider.NestedTypes) + { + FilterAllCustomizedMembers(nestedType, visited); } } @@ -177,9 +225,10 @@ private static void DeleteDirectory(string path, string[] filesToKeep) return; } + var fileNamesToKeep = filesToKeep.ToHashSet(StringComparer.Ordinal); foreach (var file in directoryInfo.GetFiles("*", SearchOption.AllDirectories)) { - if (!filesToKeep.Contains(file.Name)) + if (!fileNamesToKeep.Contains(file.Name)) { file.Delete(); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs index e8732f15ffd..413cf395a7f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs @@ -26,6 +26,7 @@ public abstract class CodeModelGenerator { private List _visitors = []; private List _additionalMetadataReferences = []; + private readonly Dictionary> _customCodeMethodDependencies = new(StringComparer.Ordinal); private static CodeModelGenerator? _instance; private List _sharedSourceDirectories = []; public const string GeneratorMetadataName = "GeneratorName"; @@ -161,6 +162,25 @@ public virtual void AddMetadataReference(MetadataReference reference) _additionalMetadataReferences.Add(reference); } + /// + /// Registers a generated provider required by an unresolved custom-code method invocation. + /// + /// The invoked method name. + /// The generated provider that defines the method. + protected void AddCustomCodeMethodDependency(string methodName, TypeProvider provider) + { + if (!_customCodeMethodDependencies.TryGetValue(methodName, out var providers)) + { + providers = []; + _customCodeMethodDependencies.Add(methodName, providers); + } + + providers.Add(provider); + } + + internal IReadOnlyList GetCustomCodeMethodDependencies(string methodName) => + _customCodeMethodDependencies.TryGetValue(methodName, out var providers) ? providers : []; + public virtual void AddSharedSourceDirectory(string sharedSourceDirectory) { _sharedSourceDirectories.Add(sharedSourceDirectory); @@ -242,7 +262,7 @@ public void AddTypeToKeep(string typeName, bool isRoot = true) /// /// /// The provider's fully qualified name is resolved lazily, when the keep list is consumed during - /// post-processing. This makes it safe to call this method from a + /// reference-map analysis. This makes it safe to call this method from a /// constructor (including base constructors that run before the derived constructor body), since /// it does not force evaluation of — which would dispatch virtual /// Build* methods on a not-yet-fully-constructed instance. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs index c36686f637f..48a6039d4dd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs @@ -116,7 +116,7 @@ internal static SyntaxTree GetTree(TypeProvider provider) } var docs = await Task.WhenAll(documents); - LoggingHelpers.LogElapsedTime("Roslyn post processing complete"); + LoggingHelpers.LogElapsedTime("Roslyn document processing complete"); foreach (var doc in docs) { @@ -260,33 +260,6 @@ internal static Project AddDirectory(Project project, string directory, Func - /// This method invokes the postProcessor to do some post processing work - /// Depending on the configuration, it will either remove + internalize, just internalize or do nothing - /// - public async Task PostProcessAsync() - { - var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; - var nonRootTypes = CodeModelGenerator.Instance.NonRootTypes; - var postProcessor = new PostProcessor( - [.. CodeModelGenerator.Instance.TypeFactory.UnionVariantTypesToKeep, .. CodeModelGenerator.Instance.AdditionalRootTypes], - modelFactoryFullName: modelFactory.Type.FullyQualifiedName, - additionalNonRootTypeNames: nonRootTypes); - - switch (Configuration.UnreferencedTypesHandling) - { - case Configuration.UnreferencedTypesHandlingOption.KeepAll: - break; - case Configuration.UnreferencedTypesHandlingOption.Internalize: - _project = await postProcessor.InternalizeAsync(_project); - break; - case Configuration.UnreferencedTypesHandlingOption.RemoveOrInternalize: - _project = await postProcessor.InternalizeAsync(_project); - _project = await postProcessor.RemoveAsync(_project); - break; - } - } - /// /// Resolves PackageReference items from the project's .csproj file and adds their assemblies /// as metadata references so that custom code referencing external NuGet types compiles correctly. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs deleted file mode 100644 index dc42f801732..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs +++ /dev/null @@ -1,669 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Simplification; - -namespace Microsoft.TypeSpec.Generator -{ - internal class PostProcessor - { - private readonly string? _modelFactoryFullName; - private readonly HashSet _additionalNonRootTypeNames; - private readonly HashSet _typesToKeep; - private INamedTypeSymbol? _modelFactorySymbol; - - public PostProcessor( - HashSet typesToKeep, - string? modelFactoryFullName = null, - IEnumerable? additionalNonRootTypeNames = null) - { - _typesToKeep = typesToKeep; - _modelFactoryFullName = modelFactoryFullName; - _additionalNonRootTypeNames = new HashSet(additionalNonRootTypeNames ?? []); - } - - private record TypeSymbols( - HashSet DeclaredSymbols, - INamedTypeSymbol? ModelFactorySymbol, - IReadOnlyDictionary> DeclaredNodesCache, - IReadOnlyDictionary> DocumentsCache); - - /// - /// This method reads the project, returns the types defined in it and build symbol caches to accelerate the calculation - /// By default, the types defined in shared documents are not included. Please override to tweak this behavior. - /// - /// The of the - /// The project to extract type symbols from - /// If is true, only public types will be included. If is false, all types will be included - /// A instance of which includes the information of the declared symbols of the given accessibility, along with some useful cache that is useful in this class. - private async Task GetTypeSymbolsAsync(Compilation compilation, - Project project, - bool publicOnly = true) - { - var result = new HashSet(SymbolEqualityComparer.Default); - var declarationCache = - new Dictionary>(SymbolEqualityComparer.Default); - var documentCache = new Dictionary>(); - - if (_modelFactoryFullName != null) - { - _modelFactorySymbol = compilation.GetTypeByMetadataName(_modelFactoryFullName); - } - - foreach (var document in project.Documents) - { - if (ShouldIncludeDocument(document)) - { - var root = await document.GetSyntaxRootAsync(); - if (root == null) - { - continue; - } - - var semanticModel = compilation.GetSemanticModel(root.SyntaxTree); - - foreach (var typeDeclaration in root.DescendantNodes().OfType()) - { - var symbol = semanticModel.GetDeclaredSymbol(typeDeclaration); - if (symbol == null) - { - continue; - } - - if (publicOnly && symbol.DeclaredAccessibility != Accessibility.Public && - !document.Name.StartsWith("Internal/", StringComparison.Ordinal)) - { - continue; - } - - AddInList(declarationCache, symbol, typeDeclaration); - AddInList(documentCache, document, symbol, - () => new HashSet(SymbolEqualityComparer.Default)); - - // we do not add the model factory and additionalNonRootTypeSymbols to the declared symbol list - // so that it will never be included in any process of internalization or removal - if (SymbolEqualityComparer.Default.Equals(symbol, _modelFactorySymbol) - || _additionalNonRootTypeNames.Contains(symbol.Name) - || _additionalNonRootTypeNames.Contains(symbol.GetFullyQualifiedName())) - { - continue; - } - - result.Add(symbol); - } - } - } - - return new TypeSymbols(result, - _modelFactorySymbol, - declarationCache.ToDictionary(kv => kv.Key, kv => kv.Value.ToHashSet(), - (IEqualityComparer)SymbolEqualityComparer.Default), - documentCache.ToDictionary(kv => kv.Key, - kv => kv.Value.ToHashSet(SymbolEqualityComparer.Default))); - } - - protected virtual bool ShouldIncludeDocument(Document document) => - !GeneratedCodeWorkspace.IsGeneratedTestDocument(document); - - /// - /// This method marks the "not publicly" referenced types as internal if they are previously defined as public. It will do this job in the following steps: - /// 1. This method will read all the public types defined in the given , and build a cache for those symbols - /// 2. Build a public reference map for those symbols - /// 3. Finds all the root symbols, please override the to control which document you would like to include - /// 4. Visit all the symbols starting from the root symbols following the reference map to get all unvisited symbols - /// 5. Change the accessibility of the unvisited symbols in step 4 to internal - /// - /// The project to process - /// The processed . is immutable, therefore this should usually be a new instance - public async Task InternalizeAsync(Project project) - { - var compilation = await project.GetCompilationAsync(); - if (compilation == null) - { - return project; - } - - // first get all the declared symbols - var definitions = await GetTypeSymbolsAsync(compilation, project, true); - // build the reference map - var referenceMap = - await new ReferenceMapBuilder(compilation, project).BuildPublicReferenceMapAsync( - definitions.DeclaredSymbols, definitions.DeclaredNodesCache); - // get the root symbols - var rootSymbols = await GetRootSymbolsAsync(project, definitions); - // traverse all the root and recursively add all the things we met - var publicSymbols = VisitSymbolsFromRootAsync(rootSymbols, referenceMap); - - var symbolsToInternalize = definitions.DeclaredSymbols.Except(publicSymbols); - - var nodesToInternalize = new Dictionary(); - foreach (var symbol in symbolsToInternalize) - { - foreach (var node in definitions.DeclaredNodesCache[symbol]) - { - nodesToInternalize[node] = project.GetDocumentId(node.SyntaxTree)!; - } - } - - foreach (var (model, documentId) in nodesToInternalize) - { - project = MarkInternal(project, model, documentId); - } - - var modelNamesToRemove = - nodesToInternalize.Keys.Select(item => item.Identifier.Text); - project = await RemoveMethodsFromModelFactoryAsync(project, definitions, modelNamesToRemove.ToHashSet()); - - return project; - } - - private async Task RemoveMethodsFromModelFactoryAsync(Project project, - TypeSymbols definitions, - HashSet namesToRemove) - { - var modelFactorySymbol = definitions.ModelFactorySymbol; - if (modelFactorySymbol == null) - { - return project; - } - - var nodesToRemove = new List(); - - foreach (var method in modelFactorySymbol.GetMembers().OfType()) - { - if (namesToRemove.Contains(method.Name)) - { - foreach (var reference in method.DeclaringSyntaxReferences) - { - var node = await reference.GetSyntaxAsync(); - nodesToRemove.Add(node); - } - } - } - - // find the GENERATED document of model factory (we may have the customized document of this for overloads) - Document? modelFactoryGeneratedDocument = null; - // the nodes corresponding to the model factory symbol has never been changed therefore the nodes inside the cache are still usable - if (definitions.DeclaredNodesCache.TryGetValue(modelFactorySymbol, out var nodes)) - { - foreach (var declarationNode in nodes) - { - var document = project.GetDocument(declarationNode.SyntaxTree); - if (document != null && GeneratedCodeWorkspace.IsGeneratedDocument(document)) - { - modelFactoryGeneratedDocument = document; - break; - } - } - } - - // maybe this is possible, for instance, we could be adding the customization all entries previously inside the generated model factory so that the generated model factory is empty and removed. - if (modelFactoryGeneratedDocument == null) - { - return project; - } - - var root = await modelFactoryGeneratedDocument.GetSyntaxRootAsync(); - Debug.Assert(root is not null); - root = root.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia)!; - modelFactoryGeneratedDocument = modelFactoryGeneratedDocument.WithSyntaxRoot(root); - - // see if this class still has any method, if it contains nothing, we should remove this document - var methods = root.DescendantNodes().OfType(); - if (!methods.Any()) - { - return project.RemoveDocument(modelFactoryGeneratedDocument.Id); - } - - return modelFactoryGeneratedDocument.Project; - } - - /// - /// This method removes the no-referenced types from the . It will do this job in the following steps: - /// 1. This method will read all the defined types in the given , and build a cache for those symbols - /// 2. Build a reference map for those symbols (including non-public usage) - /// 3. Finds all the root symbols, please override the to control which document you would like to include - /// 4. Visit all the symbols starting from the root symbols following the reference map to get all unvisited symbols - /// 5. Remove the definition of the unvisited symbols in step 4 - /// - /// The project to process - /// The processed . is immutable, therefore this should usually be a new instance - public async Task RemoveAsync(Project project) - { - var compilation = await project.GetCompilationAsync(); - if (compilation == null) - { - return project; - } - - // find all the declarations, including non-public declared - var definitions = await GetTypeSymbolsAsync(compilation, project, false); - // build reference map - var referenceMap = - await new ReferenceMapBuilder(compilation, project).BuildAllReferenceMapAsync( - definitions.DeclaredSymbols, definitions.DocumentsCache); - // get root symbols - var rootSymbols = await GetRootSymbolsAsync(project, definitions); - // include model factory as a root symbol when doing the remove pass so that we are sure to include any internal - // helpers that are required by the model factory. - if (_modelFactorySymbol != null) - { - rootSymbols.Add(_modelFactorySymbol); - } - // traverse the map to determine the declarations that we are about to remove, starting from root nodes - var referencedSymbols = VisitSymbolsFromRootAsync(rootSymbols, referenceMap); - - referencedSymbols = AddSampleSymbols(referencedSymbols, definitions.DeclaredSymbols); - var referencedSet = new HashSet(referencedSymbols, SymbolEqualityComparer.Default); - - var symbolsToRemove = definitions.DeclaredSymbols.Except(referencedSet); - - var nodesToRemove = new List(); - foreach (var symbol in symbolsToRemove) - { - if (referencedSet.Contains(GetBase(symbol))) - { - continue; - } - nodesToRemove.AddRange(definitions.DeclaredNodesCache[symbol]); - } - - // remove them one by one - project = await RemoveModelsAsync(project, nodesToRemove); - - return project; - } - - private INamedTypeSymbol GetBase(INamedTypeSymbol symbol) - { - var baseType = symbol.BaseType; - if (baseType == null || baseType.SpecialType == SpecialType.System_Object) - { - return symbol; - } - - return GetBase(baseType); - } - - private IEnumerable AddSampleSymbols( - IEnumerable referencedSymbols, - HashSet declaredSymbols) - { - List symbolsToAdd = new List(); - foreach (var symbol in declaredSymbols) - { - if (symbol.ContainingNamespace.Name == "Samples" && symbol.Name.StartsWith("Samples_") && - !referencedSymbols.Any(s => s.Name == symbol.Name)) - { - symbolsToAdd.Add(symbol); - } - } - - return referencedSymbols.Concat(symbolsToAdd); - } - - /// - /// Do a BFS starting from the by following the - /// - /// - /// - /// - private static IEnumerable VisitSymbolsFromRootAsync( - IEnumerable rootSymbols, - ReferenceMap referenceMap) - { - var queue = new Queue(rootSymbols.Concat(referenceMap.GlobalReferencedSymbols)); - var visited = new HashSet(SymbolEqualityComparer.Default); - while (queue.Count > 0) - { - var definition = queue.Dequeue(); - if (visited.Contains(definition)) - { - continue; - } - - visited.Add(definition); - // add this definition to the result - yield return definition; - // add every type referenced by this node to the queue - foreach (var child in GetReferencedTypes(definition, referenceMap)) - { - queue.Enqueue(child); - } - } - } - - private static IEnumerable GetReferencedTypes(T definition, - IReadOnlyDictionary> referenceMap) where T : notnull - { - if (referenceMap.TryGetValue(definition, out var references)) - { - return references; - } - - return Enumerable.Empty(); - } - - private Project MarkInternal(Project project, BaseTypeDeclarationSyntax declarationNode, DocumentId documentId) - { - var newNode = ChangeModifier(declarationNode, SyntaxKind.PublicKeyword, SyntaxKind.InternalKeyword); - var tree = declarationNode.SyntaxTree; - var document = project.GetDocument(documentId)!; - var newRoot = tree.GetRoot().ReplaceNode(declarationNode, newNode) - .WithAdditionalAnnotations(Simplifier.Annotation); - document = document.WithSyntaxRoot(newRoot); - return document.Project; - } - - private async Task RemoveModelsAsync(Project project, - IEnumerable unusedModels) - { - // accumulate the definitions from the same document together - var documents = new Dictionary>(); - - foreach (var model in unusedModels) - { - var document = project.GetDocument(model.SyntaxTree); - Debug.Assert(document != null); - if (!documents.ContainsKey(document)) - { - documents.Add(document, new HashSet()); - } - - documents[document].Add(model); - } - - foreach (var models in documents.Values) - { - project = await RemoveModelsFromDocumentAsync(project, models); - } - - // remove what are now invalid references due to the models being removed - project = await RemoveInvalidRefs(project); - - return project; - } - - private static BaseTypeDeclarationSyntax ChangeModifier(BaseTypeDeclarationSyntax memberDeclaration, - SyntaxKind from, - SyntaxKind to) - { - var originalTokenInList = memberDeclaration.Modifiers.FirstOrDefault(token => token.IsKind(from)); - - // skip this if there is nothing to replace - if (originalTokenInList == default) - { - return memberDeclaration; - } - - var newToken = - SyntaxFactory.Token(originalTokenInList.LeadingTrivia, to, originalTokenInList.TrailingTrivia); - var newModifiers = memberDeclaration.Modifiers.Replace(originalTokenInList, newToken); - return memberDeclaration.WithModifiers(newModifiers); - } - - private async Task RemoveModelsFromDocumentAsync(Project project, - IEnumerable models) - { - var tree = models.First().SyntaxTree; - var document = project.GetDocument(tree); - if (document == null) - { - return project; - } - - var root = await tree.GetRootAsync(); - root = root.RemoveNodes(models, SyntaxRemoveOptions.KeepNoTrivia); - - var emptyNamespaces = root! - .DescendantNodes() - .OfType() - .Where(ns => !ns.Members.OfType().Any()) - .ToList(); - - if (emptyNamespaces.Any()) - { - root = root.RemoveNodes(emptyNamespaces, SyntaxRemoveOptions.KeepNoTrivia); - } - - document = document.WithSyntaxRoot(root!); - return document.Project; - } - - private async Task RemoveInvalidRefs(Project project) - { - var solution = project.Solution; - - // Process each document for invalid usings - foreach (var documentId in project.DocumentIds) - { - solution = await RemoveInvalidUsings(solution, documentId); - } - - // Process each document for invalid attributes (with fresh semantic models) - foreach (var documentId in project.DocumentIds) - { - solution = await RemoveInvalidAttributes(solution, documentId); - } - - return solution.GetProject(project.Id)!; - } - - private async Task RemoveInvalidUsings(Solution solution, DocumentId documentId) - { - var document = solution.GetDocument(documentId)!; - var root = await document.GetSyntaxRootAsync(); - var model = await document.GetSemanticModelAsync(); - - if (root is not CompilationUnitSyntax cu || model == null) - { - return solution; - } - - var invalidUsings = cu.Usings - .Where(u => - { - var info = model.GetSymbolInfo(u.Name!); - var sym = info.Symbol; - return sym is null || sym.Kind != SymbolKind.Namespace; - }) - .ToList(); - - if (invalidUsings.Count > 0) - { - cu = cu.RemoveNodes(invalidUsings, SyntaxRemoveOptions.KeepNoTrivia)!; - solution = solution.WithDocumentSyntaxRoot(documentId, cu); - } - - return solution; - } - - private async Task RemoveInvalidAttributes(Solution solution, DocumentId documentId) - { - var document = solution.GetDocument(documentId)!; - var root = await document.GetSyntaxRootAsync(); - var model = await document.GetSemanticModelAsync(); - - if (root is not CompilationUnitSyntax cu || model == null) - { - return solution; - } - - var attributes = cu.DescendantNodes().OfType(); - var firstAttribute = attributes.FirstOrDefault(); - - var invalidAttributes = attributes - .Where(attr => attr.Attributes.Any(attribute => - attribute.ArgumentList?.Arguments.Any(arg => - arg.Expression is TypeOfExpressionSyntax typeOfExpr && - model.GetTypeInfo(typeOfExpr.Type).Type?.TypeKind == TypeKind.Error) == true)) - .ToHashSet(); - - if (invalidAttributes.Count > 0) - { - cu = cu.RemoveNodes(invalidAttributes, SyntaxRemoveOptions.KeepNoTrivia)!; - - if (invalidAttributes.Contains(firstAttribute!)) - { - var leadingTrivia = firstAttribute!.GetLeadingTrivia(); - // Find where XML docs end and indentation begins - var xmlDocTrivia = new List(); - var lastXmlIndex = -1; - - for (int i = 0; i < leadingTrivia.Count; i++) - { - var trivia = leadingTrivia[i]; - if (trivia.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia)) - { - lastXmlIndex = i; - } - } - - // Collect trivia up to and including the last XML doc line's newline - if (lastXmlIndex >= 0) - { - for (int i = 0; i <= lastXmlIndex; i++) - { - xmlDocTrivia.Add(leadingTrivia[i]); - } - - // Include the newline after the last XML doc if present - if (lastXmlIndex + 1 < leadingTrivia.Count && - leadingTrivia[lastXmlIndex + 1].IsKind(SyntaxKind.EndOfLineTrivia)) - { - xmlDocTrivia.Add(leadingTrivia[lastXmlIndex + 1]); - } - } - - // Find the updated type and add the XML docs to it - var updatedType = cu.DescendantNodes() - .OfType() - .FirstOrDefault(); - - if (updatedType != null && xmlDocTrivia.Any()) - { - var existingTrivia = updatedType.GetLeadingTrivia(); - cu = cu.ReplaceNode(updatedType, - updatedType.WithLeadingTrivia(xmlDocTrivia.Concat(existingTrivia))); - } - } - - solution = solution.WithDocumentSyntaxRoot(documentId, cu); - } - - return solution; - } - - private async Task> GetRootSymbolsAsync(Project project, TypeSymbols modelSymbols) - { - var result = new HashSet(SymbolEqualityComparer.Default); - foreach (var symbol in modelSymbols.DeclaredSymbols) - { - foreach (var declarationNode in modelSymbols.DeclaredNodesCache[symbol]) - { - var document = project.GetDocument(declarationNode.SyntaxTree); - if (document == null) - { - continue; - } - - if (await IsRootDocument(document)) - { - result.Add(symbol); - break; - // if any of the declaring document of this symbol is considered as a root document, we add the symbol to the root list, skipping the processing of any other documents of this symbol - } - } - } - - return result; - } - - protected virtual async Task IsRootDocument(Document document) - { - var root = await document.GetSyntaxRootAsync(); - // a document is a root document, when - // 1. it is a custom document (not generated or shared) - // 2. it is a client - // 3. user exceptions - return GeneratedCodeWorkspace.IsCustomDocument(document) || IsClientDocument(document) || - ShouldKeepType(root, _typesToKeep); - } - - private static bool ShouldKeepType(SyntaxNode? root, HashSet typesToKeep) - { - if (root is null) - { - return false; - } - - // use `BaseTypeDeclarationSyntax` to also include enums because `EnumDeclarationSyntax` extends `BaseTypeDeclarationSyntax` - // `ClassDeclarationSyntax` and `StructDeclarationSyntax` both inherit `TypeDeclarationSyntax` - var typeNodes = root.DescendantNodes().OfType(); - // there is possibility that we have multiple types defined in the same document (for instance, custom code) - return typeNodes.Any(t => - { - // Get simple name - var simpleName = t.Identifier.Text; - if (typesToKeep.Contains(simpleName)) - { - return true; - } - - // Get fully qualified name - var fullName = GetFullyQualifiedName(t); - return typesToKeep.Contains(fullName); - }); - } - - private static string GetFullyQualifiedName(BaseTypeDeclarationSyntax typeDeclaration) - { - var namespaceDeclaration = typeDeclaration.Ancestors() - .OfType() - .FirstOrDefault(); - - return namespaceDeclaration != null - ? $"{namespaceDeclaration.Name}.{typeDeclaration.Identifier.Text}" - : typeDeclaration.Identifier.Text; - } - - private static bool IsClientDocument(Document document) - { - return document.Name.EndsWith("Client.cs", StringComparison.Ordinal); - } - - private static void AddInList(Dictionary dictionary, - TKey key, - TValue value, - Func? collectionConstructor = null) where TKey : notnull where TList : ICollection, new() - { - if (dictionary.TryGetValue(key, out var list)) - { - list.Add(value); - } - else - { - TList newList; - if (collectionConstructor == null) - { - newList = new TList(); - } - else - { - newList = collectionConstructor(); - } - - newList.Add(value); - dictionary.Add(key, newList); - } - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs deleted file mode 100644 index 7fe83d20f2e..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Microsoft.CodeAnalysis; - -namespace Microsoft.TypeSpec.Generator -{ - internal class ReferenceMap : IReadOnlyDictionary> - { - private Dictionary> _referenceMap; - - private List _globalReference; - - public ReferenceMap() - { - _referenceMap = new(SymbolEqualityComparer.Default); - _globalReference = new(); - } - - /// - /// Adds the value into the list corresponding to key - /// - /// - /// - /// true if the value is added into the list, false if the value already exists in the list - internal bool AddInList(INamedTypeSymbol key, INamedTypeSymbol value) - { - if (_referenceMap.TryGetValue(key, out var list)) - { - // the list is guaranteed to be a HashSet - var set = (HashSet)list; - return set.Add(value); - } - else - { - var newList = new HashSet(SymbolEqualityComparer.Default) { value }; - _referenceMap.Add(key, newList); - return true; - } - } - - internal void AddGlobal(INamedTypeSymbol typeSymbol) - { - _globalReference.Add(typeSymbol); - } - - public IEnumerable GlobalReferencedSymbols => _globalReference; - - public IEnumerable this[INamedTypeSymbol key] => _referenceMap[key]; - - public IEnumerable Keys => _referenceMap.Keys; - - public IEnumerable> Values => _referenceMap.Values; - - public int Count => _referenceMap.Count; - - public bool ContainsKey(INamedTypeSymbol key) => _referenceMap.ContainsKey(key); - - public IEnumerator>> GetEnumerator() => - _referenceMap.GetEnumerator(); - - public bool TryGetValue(INamedTypeSymbol key, [MaybeNullWhen(false)] out IEnumerable value) => - _referenceMap.TryGetValue(key, out value); - - IEnumerator IEnumerable.GetEnumerator() => _referenceMap.GetEnumerator(); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs deleted file mode 100644 index a4b1e31f90b..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Xml.Linq; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.FindSymbols; - -namespace Microsoft.TypeSpec.Generator -{ - internal class ReferenceMapBuilder - { - private readonly Compilation _compilation; - private readonly Project _project; - - public ReferenceMapBuilder(Compilation compilation, Project project) - { - _compilation = compilation; - _project = project; - } - - public async Task BuildPublicReferenceMapAsync(IEnumerable definitions, IReadOnlyDictionary> nodeCache) - { - var referenceMap = new ReferenceMap(); - foreach (var definition in definitions) - { - await ProcessPublicSymbolAsync(definition, referenceMap, nodeCache); - } - - return referenceMap; - } - - public async Task BuildAllReferenceMapAsync(IEnumerable definitions, IReadOnlyDictionary> documentCache) - { - var referenceMap = new ReferenceMap(); - foreach (var definition in definitions) - { - await ProcessSymbolAsync(definition, referenceMap, documentCache); - } - - return referenceMap; - } - - private async Task ProcessPublicSymbolAsync(INamedTypeSymbol symbol, ReferenceMap referenceMap, IReadOnlyDictionary> cache) - { - // only add to reference when myself is public - if (symbol.DeclaredAccessibility != Accessibility.Public) - { - return; - } - - // process myself, adding base and generic arguments - AddTypeSymbol(symbol, symbol, referenceMap); - - // add my sibling classes - foreach (var declaration in cache[symbol]) - { - // first find all the derived types from this type - foreach (var derivedTypeSymbol in await SymbolFinder.FindDerivedClassesAsync(symbol, _project.Solution)) - { - AddTypeSymbol(symbol, derivedTypeSymbol, referenceMap); - } - } - - // go over all the members - foreach (var member in symbol.GetMembers()) - { - // only go through the public members - if (member.DeclaredAccessibility != Accessibility.Public) - { - continue; - } - - switch (member) - { - case IMethodSymbol methodSymbol: - ProcessMethodSymbol(symbol, methodSymbol, referenceMap); - break; - case IPropertySymbol propertySymbol: - ProcessPropertySymbol(symbol, propertySymbol, referenceMap); - break; - case IFieldSymbol fieldSymbol: - ProcessFieldSymbol(symbol, fieldSymbol, referenceMap); - break; - case IEventSymbol eventSymbol: - ProcessEventSymbol(symbol, eventSymbol, referenceMap); - break; - case INamedTypeSymbol innerTypeSymbol: - break; // do nothing for the inner types - default: - throw new InvalidOperationException($"This case has not been covered {member.GetType()}"); - } - } - } - - private async Task ProcessSymbolAsync(INamedTypeSymbol symbol, ReferenceMap referenceMap, IReadOnlyDictionary> documentCache) - { - foreach (var reference in await SymbolFinder.FindReferencesAsync(symbol, _project.Solution)) - { - await AddReferenceToReferenceMapAsync(symbol, reference, referenceMap, documentCache); - } - - // static class can have direct references, like ClassName.Method, but the extension methods might not have direct reference to the class itself - // therefore here we find the references of all its members and add them to the reference map - await ProcessExtensionSymbol(symbol, referenceMap, documentCache); - } - - private async Task ProcessExtensionSymbol(INamedTypeSymbol extensionClassSymbol, ReferenceMap referenceMap, IReadOnlyDictionary> documentCache) - { - if (!extensionClassSymbol.IsStatic) - { - return; - } - - foreach (var member in extensionClassSymbol.GetMembers()) - { - if (member is not IMethodSymbol methodSymbol) - { - continue; - } - - if (!methodSymbol.IsExtensionMethod) - { - continue; - } - - foreach (var reference in await SymbolFinder.FindReferencesAsync(member, _project.Solution)) - { - await AddReferenceToReferenceMapAsync(extensionClassSymbol, reference, referenceMap, documentCache); - } - - // this is to hook the extension class like this: - // internal static class FooExtensions - // { - // public static string ToSerialString(this Foo foo) => foo.ToString(); - // public static Foo ToFoo(this string foo) => // omit body - // } - - // if this is an extension method, we add it to the reference map of the type it is extending to pretend that this class is a part of that type - // handle the first method above - if (methodSymbol.Parameters.FirstOrDefault()?.Type is INamedTypeSymbol typeSymbol) - { - referenceMap.AddInList(typeSymbol, extensionClassSymbol); - } - - // we also add the return type into the reference map of the extension class to cover both cases - // handle the second method above - if (methodSymbol.ReturnType is INamedTypeSymbol returnTypeSymbol) - { - referenceMap.AddInList(returnTypeSymbol, extensionClassSymbol); - } - } - } - - private async Task AddReferenceToReferenceMapAsync(INamedTypeSymbol symbol, ReferencedSymbol reference, ReferenceMap referenceMap, IReadOnlyDictionary> documentCache) - { - foreach (var location in reference.Locations) - { - var document = location.Document; - - // skip this reference if it comes from a document that does not define any symbol - if (!documentCache.TryGetValue(document, out var candidateReferenceSymbols)) - { - continue; - } - - if (candidateReferenceSymbols.Count == 1) - { - referenceMap.AddInList(candidateReferenceSymbols.Single(), symbol); - } - else - { - // fallback to calculate the symbol when the document contains multiple type symbols - // this should never happen in the generated code - // customized code might have this issue - var root = await document.GetSyntaxRootAsync(); - if (root == null) - { - continue; - } - // get the node of this reference - var node = root.FindNode(location.Location.SourceSpan); - var owner = GetOwnerTypeOfReference(node); - if (owner == null) - { - referenceMap.AddGlobal(symbol); - } - else - { - var semanticModel = _compilation.GetSemanticModel(owner.SyntaxTree); - var ownerSymbol = semanticModel.GetDeclaredSymbol(owner); - - if (ownerSymbol == null) - { - continue; - } - // add it to the map - referenceMap.AddInList(ownerSymbol, symbol); - } - } - } - } - - /// - /// This method recursively adds all related types in to the reference map as the value of key - /// - /// - /// - /// - private void AddTypeSymbol(ITypeSymbol keySymbol, ITypeSymbol? valueSymbol, ReferenceMap referenceMap) - { - if (keySymbol is not INamedTypeSymbol keyTypeSymbol) - { - return; - } - - if (valueSymbol is not INamedTypeSymbol valueTypeSymbol) - { - return; - } - // add the class and all its partial classes to the map - // this will make all the partial classes are referencing each other in the reference map - // when we make the travesal over the reference map, we will not only remove one of the partial class, instead we will either keep all the partial classes (if at least one of them has references), or remove all of them (if none of them has references) - if (!referenceMap.AddInList(keyTypeSymbol, valueTypeSymbol)) - { - return; // we short cut if the valueTypeSymbol has already existed in the list to avoid infinite loops - } - // add the base type - AddTypeSymbol(keyTypeSymbol, valueTypeSymbol.BaseType, referenceMap); - // add the interfaces if there is any - foreach (var interfaceSymbol in valueTypeSymbol.Interfaces) - { - AddTypeSymbol(keyTypeSymbol, interfaceSymbol, referenceMap); - } - // add the generic type arguments - foreach (var typeArgument in valueTypeSymbol.TypeArguments) - { - AddTypeSymbol(keyTypeSymbol, typeArgument, referenceMap); - } - } - - private void ProcessMethodSymbol(INamedTypeSymbol keySymbol, IMethodSymbol methodSymbol, ReferenceMap referenceMap) - { - // add the return type - AddTypeSymbol(keySymbol, methodSymbol.ReturnType, referenceMap); - // add the parameters - foreach (var parameter in methodSymbol.Parameters) - { - AddTypeSymbol(keySymbol, parameter.Type, referenceMap); - } - } - - private void ProcessPropertySymbol(INamedTypeSymbol keySymbol, IPropertySymbol propertySymbol, ReferenceMap referenceMap) - { - AddTypeSymbol(keySymbol, propertySymbol.Type, referenceMap); - - // find the node that defines myself - var xml = propertySymbol.GetDocumentationCommentXml(); - if (string.IsNullOrEmpty(xml)) - { - return; - } - - var xDocument = XDocument.Parse(xml); - var cRefs = xDocument.Descendants().Attributes("cref").Select(a => a.Value).Where(a => a[0] == 'T' && a[1] == ':').Select(a => a.Substring(2)); - - foreach (var cref in cRefs) - { - var symbol = _compilation.GetTypeByMetadataName(cref); - AddTypeSymbol(keySymbol, symbol, referenceMap); - } - } - - private void ProcessFieldSymbol(INamedTypeSymbol keySymbol, IFieldSymbol fieldSymbol, ReferenceMap referenceMap) => AddTypeSymbol(keySymbol, fieldSymbol.Type, referenceMap); - - private void ProcessEventSymbol(INamedTypeSymbol keySymbol, IEventSymbol eventSymbol, ReferenceMap referenceMap) => AddTypeSymbol(keySymbol, eventSymbol.Type, referenceMap); - - /// - /// Returns the node that defines inside the document, which should be , or - /// The here should come from the result of , therefore a result is guaranteed - /// - /// - /// - private static BaseTypeDeclarationSyntax? GetOwnerTypeOfReference(SyntaxNode node) - { - SyntaxNode? current = node; - while (current != null) - { - if (current is BaseTypeDeclarationSyntax declarationNode) - { - return declarationNode; - } - - current = current.Parent; - } - - // this means owner of the reference is outside a type definition. For instance, we could have an assembly attribute that is referencing a class using `nameof` - return null; - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs index 49fe9723973..4797be0d90b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs @@ -45,11 +45,11 @@ private bool IsPublicContext(TypeProvider provider) private void WriteType(CodeWriter writer) { - if (IsPublicContext(_provider)) + if (_provider.PreserveTypeXmlDocs || _provider.ShouldWriteTypeXmlDocs || IsPublicContext(_provider)) { writer.WriteXmlDocsNoScope(_provider.XmlDocs); } - foreach (var attribute in _provider.GetAttributes()) + foreach (var attribute in _provider.GetAttributesForWrite()) { attribute.Write(writer); if (attribute is AttributeStatement) @@ -207,6 +207,11 @@ private void WriteConstructors(CodeWriter writer) private void WriteMethods(CodeWriter writer) { + if (_provider is ModelFactoryProvider { PreserveLeadingMethodSeparator: true } && _provider.Methods.Count > 0) + { + writer.WriteLine(); + } + for (int i = 0; i < _provider.Methods.Count; i++) { writer.WriteMethod(_provider.Methods[i]); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs index b2c2915f915..90e71ace797 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs @@ -48,7 +48,25 @@ public CanonicalTypeProvider(TypeProvider generatedTypeProvider, InputType? inpu protected override IReadOnlyList BuildAttributes() { - return [.. _generatedTypeProvider.Attributes, .. _generatedTypeProvider.CustomCodeView?.Attributes ?? []]; + // TODO https://github.com/microsoft/typespec/issues/11232: Move this generated/custom attribute merge into a shared TypeProvider API. + return DeduplicateAttributes( + _generatedTypeProvider.Attributes, + _generatedTypeProvider.CustomCodeView?.Attributes); + } + + private static IReadOnlyList DeduplicateAttributes(params IEnumerable?[] attributeSets) + { + var seen = new HashSet(); + var attributes = new List(); + foreach (var attribute in attributeSets.SelectMany(static attributeSet => attributeSet ?? [])) + { + if (seen.Add(attribute.ToDisplayString())) + { + attributes.Add(attribute); + } + } + + return attributes; } private protected override CanonicalTypeProvider BuildCanonicalView() => this; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs index ae2495a64ba..f4fbf891762 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs @@ -30,6 +30,8 @@ protected internal ModelFactoryProvider(IEnumerable models) _models = models; } + internal bool PreserveLeadingMethodSeparator { get; set; } + protected override string BuildName() => string.Concat(CodeModelGenerator.Instance.TypeFactory.ServiceName, ModelFactorySuffix); protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs index 5f0faf734e7..34b7e129827 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs @@ -22,6 +22,8 @@ internal sealed class NamedTypeSymbolProvider : TypeProvider { private INamedTypeSymbol _namedTypeSymbol; private readonly Compilation _compilation; + private string? _metadataName; + private string? _metadataSimpleName; private TypeProvider? _baseTypeProvider; public NamedTypeSymbolProvider(INamedTypeSymbol namedTypeSymbol, Compilation compilation) @@ -30,9 +32,40 @@ public NamedTypeSymbolProvider(INamedTypeSymbol namedTypeSymbol, Compilation com _compilation = compilation; } + internal string MetadataName + { + get + { + if (_metadataName != null) + { + return _metadataName; + } + + var ns = _namedTypeSymbol.ContainingNamespace.GetFullyQualifiedNameFromDisplayString(); + var typeName = GetMetadataName(_namedTypeSymbol); + _metadataName = string.IsNullOrEmpty(ns) ? typeName : $"{ns}.{typeName}"; + return _metadataName; + } + } + + internal string MetadataSimpleName => _metadataSimpleName ??= _namedTypeSymbol.Name; + private protected sealed override NamedTypeSymbolProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => null; private protected sealed override TypeProvider? BuildLastContractView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => null; + protected override CSharpType[] GetTypeArguments() => + [.. _namedTypeSymbol.TypeParameters.Select(parameter => parameter.GetCSharpType())]; + + private static string GetMetadataName(INamedTypeSymbol symbol) + { + if (symbol.ContainingType is null) + { + return symbol.MetadataName; + } + + return $"{GetMetadataName(symbol.ContainingType)}+{symbol.MetadataName}"; + } + protected override string BuildRelativeFilePath() => throw new InvalidOperationException("This type should not be writing in generation"); protected override string BuildName() => _namedTypeSymbol.Name; @@ -314,6 +347,9 @@ protected internal override MethodProvider[] BuildMethods() GetNullableCSharpType(methodSymbol.ReturnType), GetSymbolXmlDoc(methodSymbol, "returns"), [.. methodSymbol.Parameters.Select(p => ConvertToParameterProvider(methodSymbol, p))], + GenericArguments: methodSymbol.TypeParameters.IsEmpty + ? null + : [.. methodSymbol.TypeParameters.Select(parameter => parameter.GetCSharpType())], ExplicitInterface: explicitInterface?.ContainingType?.GetCSharpType()); methods.Add(new MethodProvider(signature, MethodBodyStatement.Empty, this)); @@ -321,6 +357,384 @@ [.. methodSymbol.Parameters.Select(p => ConvertToParameterProvider(methodSymbol, return [.. methods]; } + protected internal override IReadOnlyList BuildBodyDependencyTypes() + { + var dependencies = new HashSet(); + foreach (var syntaxReference in _namedTypeSymbol.DeclaringSyntaxReferences) + { + var syntax = syntaxReference.GetSyntax(); + if (IsGeneratedSourceFile(syntax.SyntaxTree.FilePath)) + { + continue; + } + + AddBodyDependencyTypes(syntax, dependencies); + } + + return [.. dependencies]; + } + + protected internal override IReadOnlyList BuildSignatureDependencyTypes() + { + var dependencies = new HashSet(); + foreach (var syntaxReference in _namedTypeSymbol.DeclaringSyntaxReferences) + { + var syntax = syntaxReference.GetSyntax(); + if (IsGeneratedSourceFile(syntax.SyntaxTree.FilePath) || + syntax is not TypeDeclarationSyntax typeDeclaration || + !IsPublic(typeDeclaration.Modifiers)) + { + continue; + } + + var semanticModel = _compilation.GetSemanticModel(typeDeclaration.SyntaxTree); + var namespaceCandidates = GetNamespaceCandidates(typeDeclaration); + AddPublicTypeSignatureDependencyTypes(typeDeclaration, dependencies, semanticModel, namespaceCandidates); + } + + return [.. dependencies]; + } + + private void AddBodyDependencyTypes(SyntaxNode syntax, HashSet dependencies) + { + var semanticModel = _compilation.GetSemanticModel(syntax.SyntaxTree); + AddSyntaxTypeReferences(syntax, dependencies, semanticModel, GetNamespaceCandidates(syntax)); + + foreach (var invocation in syntax.DescendantNodes().OfType()) + { + var invocationName = GetInvocationName(invocation); + if (invocationName == null) + { + continue; + } + + foreach (var provider in CodeModelGenerator.Instance.GetCustomCodeMethodDependencies(invocationName)) + { + dependencies.Add(provider.Type); + } + } + } + + private void AddPublicSignatureDependencyTypes(MemberDeclarationSyntax member, HashSet dependencies) + { + var semanticModel = _compilation.GetSemanticModel(member.SyntaxTree); + var namespaceCandidates = GetNamespaceCandidates(member); + switch (member) + { + case MethodDeclarationSyntax method: + AddSyntaxTypeReferences(method.ReturnType, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(method.ParameterList, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(method.ConstraintClauses, dependencies, semanticModel, namespaceCandidates); + break; + case ConstructorDeclarationSyntax constructor: + AddSyntaxTypeReferences(constructor.ParameterList, dependencies, semanticModel, namespaceCandidates); + break; + case ConversionOperatorDeclarationSyntax conversion: + AddSyntaxTypeReferences(conversion.Type, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(conversion.ParameterList, dependencies, semanticModel, namespaceCandidates); + break; + case OperatorDeclarationSyntax @operator: + AddSyntaxTypeReferences(@operator.ReturnType, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(@operator.ParameterList, dependencies, semanticModel, namespaceCandidates); + break; + case PropertyDeclarationSyntax property: + AddSyntaxTypeReferences(property.Type, dependencies, semanticModel, namespaceCandidates); + break; + case IndexerDeclarationSyntax indexer: + AddSyntaxTypeReferences(indexer.Type, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(indexer.ParameterList, dependencies, semanticModel, namespaceCandidates); + break; + case FieldDeclarationSyntax field: + AddSyntaxTypeReferences(field.Declaration.Type, dependencies, semanticModel, namespaceCandidates); + break; + case EventFieldDeclarationSyntax eventField: + AddSyntaxTypeReferences(eventField.Declaration.Type, dependencies, semanticModel, namespaceCandidates); + break; + case EventDeclarationSyntax @event: + AddSyntaxTypeReferences(@event.Type, dependencies, semanticModel, namespaceCandidates); + break; + case DelegateDeclarationSyntax @delegate: + AddSyntaxTypeReferences(@delegate.ReturnType, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(@delegate.ParameterList, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(@delegate.ConstraintClauses, dependencies, semanticModel, namespaceCandidates); + break; + case TypeDeclarationSyntax type: + AddPublicTypeSignatureDependencyTypes(type, dependencies, semanticModel, namespaceCandidates); + break; + case BaseTypeDeclarationSyntax type: + AddSyntaxTypeReferences(type.BaseList, dependencies, semanticModel, namespaceCandidates); + break; + } + } + + private void AddPublicTypeSignatureDependencyTypes( + TypeDeclarationSyntax typeDeclaration, + HashSet dependencies, + SemanticModel semanticModel, + IReadOnlyList namespaceCandidates) + { + AddSyntaxTypeReferences(typeDeclaration.BaseList, dependencies, semanticModel, namespaceCandidates); + AddSyntaxTypeReferences(typeDeclaration.ConstraintClauses, dependencies, semanticModel, namespaceCandidates); + foreach (var member in typeDeclaration.Members) + { + if (IsPublicApiMember(member)) + { + AddPublicSignatureDependencyTypes(member, dependencies); + } + } + } + + private static void AddSyntaxTypeReferences(SyntaxNode? node, HashSet dependencies, SemanticModel semanticModel, IReadOnlyList namespaceCandidates) + { + if (node == null) + { + return; + } + + foreach (var type in node.DescendantNodesAndSelf().OfType()) + { + if (type.IsPartOfStructuredTrivia()) + { + continue; + } + + AddSyntaxTypeReference(type, dependencies, semanticModel, namespaceCandidates); + } + } + + private static void AddSyntaxTypeReferences(IEnumerable nodes, HashSet dependencies, SemanticModel semanticModel, IReadOnlyList namespaceCandidates) + { + foreach (var node in nodes) + { + AddSyntaxTypeReferences(node, dependencies, semanticModel, namespaceCandidates); + } + } + + private static bool IsPublicApiMember(MemberDeclarationSyntax member) + => member switch + { + EventDeclarationSyntax @event => IsPublic(@event.Modifiers) || IsImplicitPublicInterfaceMember(@event), + EventFieldDeclarationSyntax @event => IsPublic(@event.Modifiers) || IsImplicitPublicInterfaceMember(@event), + BaseFieldDeclarationSyntax field => IsPublic(field.Modifiers) || IsImplicitPublicInterfaceMember(field), + BaseMethodDeclarationSyntax method => IsPublic(method.Modifiers) || IsImplicitPublicInterfaceMember(method), + BasePropertyDeclarationSyntax property => IsPublic(property.Modifiers) || IsImplicitPublicInterfaceMember(property), + DelegateDeclarationSyntax @delegate => IsPublic(@delegate.Modifiers) || IsImplicitPublicInterfaceMember(@delegate), + BaseTypeDeclarationSyntax type => IsPublic(type.Modifiers) || IsImplicitPublicInterfaceMember(type), + _ => false + }; + + private static bool IsPublic(SyntaxTokenList modifiers) + => modifiers.Any(static modifier => + modifier.IsKind(SyntaxKind.PublicKeyword) || + modifier.IsKind(SyntaxKind.ProtectedKeyword)); + + private static bool IsImplicitPublicInterfaceMember(MemberDeclarationSyntax member) + => member.Parent is InterfaceDeclarationSyntax && + !member.Modifiers.Any(static modifier => + modifier.IsKind(SyntaxKind.PrivateKeyword) || + modifier.IsKind(SyntaxKind.InternalKeyword)); + + private static bool IsGeneratedSourceFile(string filePath) => + filePath.Contains("/Generated/", StringComparison.Ordinal) || + filePath.Contains("\\Generated\\", StringComparison.Ordinal); + + private static CSharpType CreateUnresolvedDependencyType(string name, int genericArgumentCount = 0) + => new( + name, + string.Empty, + isValueType: false, + isNullable: false, + declaringType: null, + args: [.. Enumerable.Range(0, genericArgumentCount).Select(static _ => CreateUnresolvedDependencyType(string.Empty))], + isPublic: false, + isStruct: false); + + private static void AddSyntaxTypeReference(TypeSyntax type, HashSet dependencies, SemanticModel semanticModel, IReadOnlyList namespaceCandidates) + { + if (TryAddSemanticTypeReference(type, dependencies, semanticModel)) + { + return; + } + + if (!IsSyntacticTypeReference(type)) + { + return; + } + + switch (type) + { + case IdentifierNameSyntax identifier: + AddUnresolvedDependencyType(dependencies, identifier.Identifier.ValueText, namespaceCandidates); + break; + case GenericNameSyntax genericName: + AddUnresolvedDependencyType(dependencies, genericName.Identifier.ValueText, namespaceCandidates, genericName.TypeArgumentList.Arguments.Count); + foreach (var argument in genericName.TypeArgumentList.Arguments) + { + AddSyntaxTypeReference(argument, dependencies, semanticModel, namespaceCandidates); + } + break; + case QualifiedNameSyntax qualifiedName: + AddQualifiedUnresolvedDependencyType(dependencies, qualifiedName); + AddSyntaxTypeReference(qualifiedName.Right, dependencies, semanticModel, namespaceCandidates); + break; + case AliasQualifiedNameSyntax aliasQualifiedName: + AddSyntaxTypeReference(aliasQualifiedName.Name, dependencies, semanticModel, namespaceCandidates); + break; + case ArrayTypeSyntax arrayType: + AddSyntaxTypeReference(arrayType.ElementType, dependencies, semanticModel, namespaceCandidates); + break; + case NullableTypeSyntax nullableType: + AddSyntaxTypeReference(nullableType.ElementType, dependencies, semanticModel, namespaceCandidates); + break; + case PointerTypeSyntax pointerType: + AddSyntaxTypeReference(pointerType.ElementType, dependencies, semanticModel, namespaceCandidates); + break; + case TupleTypeSyntax tupleType: + foreach (var element in tupleType.Elements) + { + AddSyntaxTypeReference(element.Type, dependencies, semanticModel, namespaceCandidates); + } + break; + } + } + + private static bool TryAddSemanticTypeReference(TypeSyntax type, HashSet dependencies, SemanticModel semanticModel) + { + var typeSymbol = semanticModel.GetTypeInfo(type).Type ?? + semanticModel.GetTypeInfo(type).ConvertedType ?? + (semanticModel.GetSymbolInfo(type).Symbol as INamedTypeSymbol); + if (typeSymbol is not INamedTypeSymbol namedTypeSymbol || + namedTypeSymbol.TypeKind == TypeKind.Error || + namedTypeSymbol.SpecialType == SpecialType.System_Void) + { + return false; + } + + dependencies.Add(namedTypeSymbol.GetCSharpType()); + return true; + } + + private static void AddUnresolvedDependencyType(HashSet dependencies, string name, IReadOnlyList namespaceCandidates, int genericArgumentCount = 0) + { + if (string.Equals(name, "var", StringComparison.Ordinal) || + string.Equals(name, "dynamic", StringComparison.Ordinal)) + { + return; + } + + dependencies.Add(CreateUnresolvedDependencyType(name, genericArgumentCount)); + foreach (var ns in namespaceCandidates) + { + dependencies.Add(CreateDependencyType(name, ns, genericArgumentCount)); + } + } + + private static void AddQualifiedUnresolvedDependencyType(HashSet dependencies, QualifiedNameSyntax qualifiedName) + { + var fullName = qualifiedName.ToString(); + var lastDot = fullName.LastIndexOf('.'); + if (lastDot <= 0 || lastDot == fullName.Length - 1) + { + return; + } + + dependencies.Add(CreateDependencyType(fullName.Substring(lastDot + 1), fullName.Substring(0, lastDot))); + } + + private static CSharpType CreateDependencyType(string name, string ns, int genericArgumentCount = 0) + => new( + name, + ns, + isValueType: false, + isNullable: false, + declaringType: null, + args: [.. Enumerable.Range(0, genericArgumentCount).Select(static _ => CreateUnresolvedDependencyType(string.Empty))], + isPublic: false, + isStruct: false); + + private static IReadOnlyList GetNamespaceCandidates(SyntaxNode node) + { + var namespaces = new HashSet(StringComparer.Ordinal); + for (var current = node; current != null; current = current.Parent) + { + switch (current) + { + case BaseNamespaceDeclarationSyntax namespaceDeclaration: + namespaces.Add(namespaceDeclaration.Name.ToString()); + break; + } + } + + if (node.SyntaxTree.GetRoot() is CompilationUnitSyntax compilationUnit) + { + foreach (var usingDirective in compilationUnit.Usings) + { + if (usingDirective.Alias == null && !usingDirective.StaticKeyword.IsKind(SyntaxKind.StaticKeyword) && usingDirective.Name != null) + { + namespaces.Add(usingDirective.Name.ToString()); + } + } + } + + return [.. namespaces]; + } + + private static bool IsSyntacticTypeReference(TypeSyntax type) + { + var parent = type.Parent; + return parent switch + { + ArrayTypeSyntax arrayType => arrayType.ElementType == type && IsSyntacticTypeReference(arrayType), + NullableTypeSyntax nullableType => nullableType.ElementType == type && IsSyntacticTypeReference(nullableType), + PointerTypeSyntax pointerType => pointerType.ElementType == type && IsSyntacticTypeReference(pointerType), + TupleElementSyntax tupleElement => tupleElement.Type == type, + TypeArgumentListSyntax typeArgumentList => typeArgumentList.Arguments.Contains(type), + QualifiedNameSyntax qualifiedName => qualifiedName.Right == type && IsSyntacticTypeReference(qualifiedName), + AliasQualifiedNameSyntax aliasQualifiedName => aliasQualifiedName.Name == type && IsSyntacticTypeReference(aliasQualifiedName), + SimpleBaseTypeSyntax simpleBaseType => simpleBaseType.Type == type, + ParameterSyntax parameter => parameter.Type == type, + VariableDeclarationSyntax variableDeclaration => variableDeclaration.Type == type, + PropertyDeclarationSyntax property => property.Type == type, + IndexerDeclarationSyntax indexer => indexer.Type == type, + MethodDeclarationSyntax method => method.ReturnType == type, + LocalFunctionStatementSyntax localFunction => localFunction.ReturnType == type, + DelegateDeclarationSyntax @delegate => @delegate.ReturnType == type, + OperatorDeclarationSyntax @operator => @operator.ReturnType == type, + ConversionOperatorDeclarationSyntax conversion => conversion.Type == type, + TypeConstraintSyntax typeConstraint => typeConstraint.Type == type, + ObjectCreationExpressionSyntax objectCreation => objectCreation.Type == type, + MemberAccessExpressionSyntax memberAccess => memberAccess.Expression == type && LooksLikeTypeName(type), + CastExpressionSyntax cast => cast.Type == type, + DefaultExpressionSyntax @default => @default.Type == type, + SizeOfExpressionSyntax sizeOf => sizeOf.Type == type, + TypeOfExpressionSyntax typeOf => typeOf.Type == type, + DeclarationExpressionSyntax declaration => declaration.Type == type, + _ => false + }; + } + + private static bool LooksLikeTypeName(TypeSyntax type) + => type switch + { + IdentifierNameSyntax identifier => IsUppercaseIdentifier(identifier.Identifier.ValueText), + GenericNameSyntax genericName => IsUppercaseIdentifier(genericName.Identifier.ValueText), + QualifiedNameSyntax qualifiedName => LooksLikeTypeName(qualifiedName.Right), + AliasQualifiedNameSyntax aliasQualifiedName => LooksLikeTypeName(aliasQualifiedName.Name), + _ => false + }; + + private static bool IsUppercaseIdentifier(string name) + => name.Length > 0 && char.IsUpper(name[0]); + + private static string? GetInvocationName(InvocationExpressionSyntax invocation) + => invocation.Expression switch + { + IdentifierNameSyntax identifier => identifier.Identifier.ValueText, + MemberAccessExpressionSyntax memberAccess => memberAccess.Name.Identifier.ValueText, + GenericNameSyntax genericName => genericName.Identifier.ValueText, + _ => null + }; + private static bool IsPartialMethodDeclaration(IMethodSymbol methodSymbol) { foreach (var syntaxReference in methodSymbol.DeclaringSyntaxReferences) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs index 83380c4299b..31bc0d3fd63 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs @@ -22,6 +22,7 @@ public abstract class TypeProvider private Lazy _lastContractView; private Lazy _canonicalView; private Lazy _specView; + private Lazy _declaringTypeName; private readonly InputType? _inputType; protected TypeProvider(InputType? inputType = default) @@ -30,6 +31,7 @@ protected TypeProvider(InputType? inputType = default) _canonicalView = new(BuildCanonicalView); _lastContractView = new(() => BuildLastContractView()); _specView = new(BuildSpecView); + _declaringTypeName = new(() => GetDeclaringTypeName(DeclaringTypeProvider)); _inputType = inputType; } @@ -44,14 +46,26 @@ protected TypeProvider() : this(null) => CodeModelGenerator.Instance.SourceInputModel.FindForTypeInCustomization( generatedTypeNamespace ?? BuildNamespace(), generatedTypeName ?? BuildName(), - // Use the Type.Name so that any customizations to the declaring type are applied for the lookup. - DeclaringTypeProvider?.Type.Name); + _declaringTypeName.Value); private protected virtual TypeProvider? BuildLastContractView(string? generatedTypeName = null, string? generatedTypeNamespace = null) => CodeModelGenerator.Instance.SourceInputModel.FindForTypeInLastContract( generatedTypeNamespace ?? CustomCodeView?.Type.Namespace ?? BuildNamespace(), generatedTypeName ?? CustomCodeView?.Name ?? BuildName(), - DeclaringTypeProvider?.Type.Name); + _declaringTypeName.Value); + + private static string? GetDeclaringTypeName(TypeProvider? declaringTypeProvider) + { + if (declaringTypeProvider is null) + { + return null; + } + + var parentName = GetDeclaringTypeName(declaringTypeProvider.DeclaringTypeProvider); + return parentName is null + ? declaringTypeProvider.Type.Name + : $"{parentName}+{declaringTypeProvider.Type.Name}"; + } private protected virtual TypeProvider BuildSpecView() => new SpecTypeProvider(this); @@ -143,6 +157,17 @@ public XmlDocProvider XmlDocs private set => _xmlDocs = value; } + internal bool PreserveTypeXmlDocs { get; private set; } + + protected internal virtual bool ShouldWriteTypeXmlDocs => false; + + protected internal virtual bool IsClientProvider => false; + + internal void PreserveXmlDocs() + { + PreserveTypeXmlDocs = true; + } + public string? Deprecated { get => _deprecated; @@ -300,7 +325,21 @@ private IReadOnlyList ApplyCustomizationFilter(IEnumerable? _serializationProviders; - public IReadOnlyList SerializationProviders => _serializationProviders ??= BuildSerializationProviders(); + public IReadOnlyList SerializationProviders => _serializationProviders ??= BuildSerializationProvidersInternal(); + + internal TypeProvider? SerializationProviderOwner { get; private set; } + + private IReadOnlyList? _helperDependencyTypes; + internal IReadOnlyList HelperDependencyTypes => _helperDependencyTypes ??= BuildHelperDependencyTypes(); + protected internal virtual IReadOnlyList BuildHelperDependencyTypes() => []; + + private IReadOnlyList? _bodyDependencyTypes; + public IReadOnlyList BodyDependencyTypes => _bodyDependencyTypes ??= BuildBodyDependencyTypes(); + protected internal virtual IReadOnlyList BuildBodyDependencyTypes() => []; + + private IReadOnlyList? _signatureDependencyTypes; + public IReadOnlyList SignatureDependencyTypes => _signatureDependencyTypes ??= BuildSignatureDependencyTypes(); + protected internal virtual IReadOnlyList BuildSignatureDependencyTypes() => []; private IReadOnlyList? _attributes; @@ -323,6 +362,31 @@ public IReadOnlyList Attributes internal IReadOnlyList GetAttributes() => _attributes ??= BuildAttributes(); + internal IReadOnlyList GetAttributesForWrite() => BuildAttributesForWrite(); + + /// + /// Builds the attributes emitted by the writer. Providers whose generated attributes depend on final + /// generation decisions can override this without replacing attributes updated by visitors. + /// + protected internal virtual IReadOnlyList BuildAttributesForWrite() => GetAttributes(); + + /// + /// Indicates whether this provider's attributes should contribute to reference-map analysis. + /// + protected internal virtual bool ShouldAnalyzeAttributesInReferenceMap => true; + + /// + /// Determines whether a provider remains in the generated output after reference-map analysis. + /// + protected static bool ShouldWriteProvider(TypeProvider provider) => + ProviderReferenceMapAnalyzer.ShouldWriteProvider(provider); + + /// + /// Determines whether a type remains resolvable after reference-map analysis. + /// + protected static bool IsResolvableBuildableType(CSharpType type) => + ProviderReferenceMapAnalyzer.IsResolvableBuildableType(type); + protected virtual CSharpType[] GetTypeArguments() => []; internal PropertyProvider[] FilterCustomizedProperties(IEnumerable specProperties) @@ -505,6 +569,20 @@ private TypeProvider[] BuildNestedTypesInternal() protected virtual TypeProvider[] BuildSerializationProviders() => []; + private IReadOnlyList BuildSerializationProvidersInternal() + => AssignSerializationProviderOwners(BuildSerializationProviders()); + + private IReadOnlyList AssignSerializationProviderOwners(IEnumerable serializationProviders) + { + var providers = (serializationProviders as IReadOnlyList) ?? [.. serializationProviders]; + foreach (var serializationProvider in providers) + { + serializationProvider.SerializationProviderOwner = this; + } + + return providers; + } + protected virtual CSharpType BuildEnumUnderlyingType() => throw new InvalidOperationException("Not an EnumProvider type"); protected virtual IReadOnlyList BuildAttributes() => []; @@ -548,8 +626,10 @@ public virtual void Reset() _serializationProviders = null; _nestedTypes = null; _xmlDocs = null; + PreserveTypeXmlDocs = false; _declarationModifiers = null; _relativeFilePath = null; + _declaringTypeName = new(() => GetDeclaringTypeName(DeclaringTypeProvider)); _customCodeView = new(() => BuildCustomCodeView()); _canonicalView = new(BuildCanonicalView); _lastContractView = new(() => BuildLastContractView()); @@ -622,7 +702,7 @@ public void Update( } if (serializations != null) { - _serializationProviders = (serializations as IReadOnlyList) ?? serializations.ToList(); + _serializationProviders = AssignSerializationProviderOwners(serializations); } if (nestedTypes != null) { @@ -642,7 +722,7 @@ public void Update( } if (attributes != null) { - _attributes = (attributes as IReadOnlyList) ?? [.. attributes]; + _attributes = [.. attributes]; } if (name != null) @@ -661,6 +741,7 @@ public void Update( private void ResetMembersBasedOnIdentityChange(string? name = null, string? @namespace = null) { + _declaringTypeName = new(() => GetDeclaringTypeName(DeclaringTypeProvider)); // Reset the custom code view to reflect the new namespace _customCodeView = new(BuildCustomCodeView(name ?? Type.Name, @namespace ?? Type.Namespace)); name = _customCodeView.Value?.Name ?? name ?? Type.Name; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs new file mode 100644 index 00000000000..8ece3a31fa3 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Snippets; +using Microsoft.TypeSpec.Generator.Statements; + +namespace Microsoft.TypeSpec.Generator +{ + internal static partial class ProviderReferenceMapAnalyzer + { + private static void AddGeneratedBodyReferences(IReadOnlyList providers, ProviderReferenceGraph graph) + { + var generatedProviders = GetGeneratedProviders(providers); + var serializationProviderNamesByType = GetSerializationProviderNamesByType(generatedProviders); + foreach (var (provider, isSerializationProvider) in GetBodyReferenceProviders(providers)) + { + if (IsModelFactoryProvider(provider) || + !IsGeneratedBodyReferenceCandidate(provider, isSerializationProvider)) + { + continue; + } + + var providerName = GetProviderTypeName(provider.Type); + if (!graph.Nodes.Contains(providerName)) + { + continue; + } + + var bodyReferences = CollectStructuredBodyReferences(provider); + AddStructuredBodyReferenceTypes( + graph.References[providerName], + provider, + bodyReferences.Types, + graph.Nodes, + serializationProviderNamesByType); + AddExtensionMethodProviderReferences( + graph.References[providerName], + bodyReferences.ExtensionMethods, + generatedProviders, + graph.Nodes); + AddProviderBodyDependencyTypes(graph.References[providerName], provider.BodyDependencyTypes, graph.Nodes); + AddGeneratedProviderNamespaceBodyDependencyTypes(graph.References[providerName], provider, graph.Nodes); + } + } + + private static void AddGeneratedProviderNamespaceBodyDependencyTypes(HashSet references, TypeProvider provider, HashSet nodes) + { + var providerNamespace = provider.Type.Namespace; + if (string.IsNullOrEmpty(providerNamespace)) + { + return; + } + + foreach (var dependency in provider.BodyDependencyTypes) + { + AddGeneratedProviderNamespaceBodyDependencyType(references, dependency, providerNamespace, nodes); + } + } + + private static void AddGeneratedProviderNamespaceBodyDependencyType(HashSet references, CSharpType? dependency, string providerNamespace, HashSet nodes) + { + if (dependency == null) + { + return; + } + + AddNamespaceBodyDependencyName(references, providerNamespace, dependency, nodes); + foreach (var argument in dependency.Arguments) + { + AddGeneratedProviderNamespaceBodyDependencyType(references, argument, providerNamespace, nodes); + } + } + + private static void AddNamespaceBodyDependencyName(HashSet references, string providerNamespace, CSharpType dependency, HashSet nodes) + { + var dependencyName = GetSimpleName(GetProviderTypeName(dependency)); + AddExactMetadataNameMatch(references, $"{providerNamespace}.{dependencyName}", nodes); + var aritylessDependencyName = StripGenericArity(dependencyName); + if (!string.Equals(aritylessDependencyName, dependencyName, StringComparison.Ordinal)) + { + AddExactMetadataNameMatch(references, $"{providerNamespace}.{aritylessDependencyName}", nodes); + } + } + + private static void AddStructuredBodyReferenceTypes( + HashSet references, + TypeProvider provider, + IReadOnlyList dependencies, + HashSet nodes, + IReadOnlyDictionary serializationProviderNamesByType) + { + foreach (var dependency in dependencies) + { + if (!IsEnumProviderDependency(dependency, nodes)) + { + AddTypeReference( + references, + dependency, + nodes, + serializationProviderNamesByType, + provider.Type.Namespace); + } + } + } + + private static StructuredBodyReferences CollectStructuredBodyReferences(TypeProvider provider) + { + var references = new HashSet(); + var extensionMethods = new HashSet(); + var visited = new HashSet(ReferenceEqualityComparer.Instance); + + foreach (var field in provider.Fields) + { + CollectStructuredBodyReferences(field.InitializationValue, references, extensionMethods, visited); + } + + foreach (var property in provider.Properties) + { + CollectStructuredBodyReferences(property.Body, references, extensionMethods, visited); + } + + foreach (var constructor in provider.Constructors) + { + CollectStructuredBodyReferences(constructor.BodyExpression, references, extensionMethods, visited); + CollectStructuredBodyReferences(constructor.BodyStatements, references, extensionMethods, visited); + } + + foreach (var method in provider.Methods) + { + if (method.IsMethodSuppressed()) + { + continue; + } + + CollectStructuredBodyReferences(method.BodyExpression, references, extensionMethods, visited); + CollectStructuredBodyReferences(method.BodyStatements, references, extensionMethods, visited); + } + + return new([.. references], [.. extensionMethods]); + } + + private static void CollectStructuredBodyReferences( + object? value, + HashSet references, + HashSet extensionMethods, + HashSet visited) + { + switch (value) + { + case null: + case string: + case FormattableString: + return; + } + + if (!value.GetType().IsValueType && !visited.Add(value)) + { + return; + } + + if (value is InvokeMethodExpression { ExtensionType: null, MethodName: { } methodName } invocation) + { + var receiverType = GetExpressionType(invocation.InstanceReference); + if (receiverType != null) + { + extensionMethods.Add(new(methodName, receiverType)); + } + } + + switch (value) + { + case CSharpType type: + references.Add(type); + return; + case Type type: + references.Add(type); + return; + case ParameterProvider parameter: + references.Add(parameter.Type); + CollectStructuredBodyReferences(parameter.DefaultValue, references, extensionMethods, visited); + CollectStructuredBodyReferences(parameter.InitializationValue, references, extensionMethods, visited); + return; + case MethodSignatureBase signature: + CollectStructuredBodyReferences(signature.ReturnType, references, extensionMethods, visited); + CollectStructuredBodyReferences(signature.Parameters, references, extensionMethods, visited); + return; + case KeyValuePair positionalArgument: + CollectStructuredBodyReferences(positionalArgument.Value, references, extensionMethods, visited); + return; + case FieldProvider field: + references.Add(field.Type); + CollectStructuredBodyReferences(field.InitializationValue, references, extensionMethods, visited); + return; + } + + if (IsStructuredBodyReferenceObject(value)) + { + foreach (var property in value.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (property.GetIndexParameters().Length > 0) + { + continue; + } + + CollectStructuredBodyReferences(property.GetValue(value), references, extensionMethods, visited); + } + + return; + } + + if (value is not IEnumerable values) + { + return; + } + + foreach (var item in values) + { + CollectStructuredBodyReferences(item, references, extensionMethods, visited); + } + } + + private static CSharpType? GetExpressionType(ValueExpression? expression) => + expression switch + { + VariableExpression variable => variable.Type, + ScopedApi scopedApi => scopedApi.Type, + _ => null + }; + + private static void AddExtensionMethodProviderReferences( + HashSet references, + IReadOnlyList extensionMethods, + IReadOnlyList generatedProviders, + HashSet nodes) + { + foreach (var extensionMethod in extensionMethods) + { + var provider = FindUniqueExtensionMethodProvider(extensionMethod, generatedProviders); + if (provider != null) + { + AddTypeReference(references, provider.Type, nodes); + } + } + } + + private static TypeProvider? FindUniqueExtensionMethodProvider( + ExtensionMethodReference extensionMethod, + IReadOnlyList generatedProviders) + { + TypeProvider? match = null; + foreach (var provider in generatedProviders) + { + if (!provider.Methods.Any(method => IsMatchingExtensionMethod(method.Signature, extensionMethod))) + { + continue; + } + + if (match != null) + { + return null; + } + + match = provider; + } + + return match; + } + + private static bool IsMatchingExtensionMethod(MethodSignature signature, ExtensionMethodReference extensionMethod) + { + if (!signature.Modifiers.HasFlag(MethodSignatureModifiers.Extension) || + !string.Equals(signature.Name, extensionMethod.Name, StringComparison.Ordinal)) + { + return false; + } + + return extensionMethod.ReceiverType == null || + signature.Parameters.Count > 0 && + string.Equals( + GetProviderTypeName(signature.Parameters[0].Type), + GetProviderTypeName(extensionMethod.ReceiverType), + StringComparison.Ordinal); + } + + private readonly record struct StructuredBodyReferences( + IReadOnlyList Types, + IReadOnlyList ExtensionMethods); + + private readonly record struct ExtensionMethodReference(string Name, CSharpType? ReceiverType); + + private static bool IsEnumProviderDependency(CSharpType dependency, HashSet nodes) + { + var providerName = GetProviderTypeName(dependency); + if (!nodes.Contains(providerName)) + { + return false; + } + + foreach (var provider in CodeModelGenerator.Instance.OutputLibrary.TypeProviders) + { + if (provider is EnumProvider && + string.Equals(GetProviderTypeName(provider.Type), providerName, StringComparison.Ordinal)) + { + return true; + } + } + + return false; + } + + private static bool IsStructuredBodyReferenceObject(object value) => + value is ValueExpression || + value is MethodBodyStatement || + value is PropertyBody; + + private static void AddProviderBodyDependencyTypes( + HashSet references, + IReadOnlyList dependencies, + HashSet nodes, + bool includeSimpleNameReferences = false, + bool includeUnqualifiedSimpleNameReferences = false) + { + foreach (var dependency in dependencies) + { + AddProviderBodyDependencyType(references, dependency, nodes, includeSimpleNameReferences, includeUnqualifiedSimpleNameReferences); + } + } + + private static void AddProviderBodyDependencyType( + HashSet references, + CSharpType? dependency, + HashSet nodes, + bool includeSimpleNameReferences, + bool includeUnqualifiedSimpleNameReferences) + { + if (dependency == null) + { + return; + } + + AddTypeReference(references, dependency, nodes); + if (includeSimpleNameReferences && + !string.IsNullOrEmpty(dependency.Namespace) && + dependency.Arguments.Count == 0) + { + AddMatchingName(references, dependency.Name, nodes); + } + else if (includeUnqualifiedSimpleNameReferences && + string.IsNullOrEmpty(dependency.Namespace) && + dependency.Arguments.Count == 0) + { + AddUnambiguousMatchingName(references, dependency.Name, nodes); + } + foreach (var argument in dependency.Arguments) + { + AddProviderBodyDependencyType(references, argument, nodes, includeSimpleNameReferences, includeUnqualifiedSimpleNameReferences); + } + } + + private static IReadOnlyList<(TypeProvider Provider, bool IsSerializationProvider)> GetBodyReferenceProviders(IReadOnlyList providers) + { + var bodyReferenceProviders = new List<(TypeProvider Provider, bool IsSerializationProvider)>(); + foreach (var provider in providers) + { + bodyReferenceProviders.Add((provider, false)); + foreach (var serializationProvider in provider.SerializationProviders) + { + bodyReferenceProviders.Add((serializationProvider, true)); + } + } + + return bodyReferenceProviders; + } + + private static bool IsGeneratedBodyReferenceCandidate(TypeProvider provider, bool isSerializationProvider) + { + return IsGeneratedImplementationBodyReferenceCandidate(provider, isSerializationProvider) || + provider.HelperDependencyTypes.Count > 0 || + provider.BodyDependencyTypes.Count > 0; + } + + private static bool IsGeneratedImplementationBodyReferenceCandidate(TypeProvider provider, bool isSerializationProvider) + { + if (provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Static) || + provider.IsClientProvider || + isSerializationProvider) + { + return true; + } + + return provider is not ModelProvider && + provider is not EnumProvider && + !IsModelFactoryProvider(provider) && + provider.DeclaringTypeProvider == null && + provider.SerializationProviders.Count == 0; + } + + private static void AddSignatureReferences( + HashSet references, + MethodSignatureBase signature, + HashSet nodes, + IReadOnlyDictionary? serializationProviderNamesByType, + bool includeAttributes = true, + bool includeAttributeArguments = true, + string? providerNamespace = null, + string? containingProviderTypeName = null, + IReadOnlySet? contextualTypeExclusions = null) + { + HashSet? signatureTypeExclusions = contextualTypeExclusions == null + ? null + : new(contextualTypeExclusions, StringComparer.Ordinal); + if (signature is MethodSignature { GenericArguments: not null } genericMethodSignature) + { + signatureTypeExclusions ??= new(StringComparer.Ordinal); + signatureTypeExclusions.UnionWith(genericMethodSignature.GenericArguments.Select(argument => argument.Name)); + } + + AddTypeReference(references, signature.ReturnType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); + if (includeAttributes) + { + AddAttributes(references, signature.Attributes, nodes, serializationProviderNamesByType, includeAttributeArguments); + } + + foreach (var parameter in signature.Parameters) + { + AddTypeReference(references, parameter.Type, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); + if (includeAttributes) + { + AddAttributes(references, parameter.Attributes, nodes, serializationProviderNamesByType, includeAttributeArguments); + } + } + + if (signature is MethodSignature methodSignature) + { + AddTypeReference(references, methodSignature.ExplicitInterface, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); + if (methodSignature.GenericArguments != null) + { + foreach (var genericArgument in methodSignature.GenericArguments) + { + AddTypeReference(references, genericArgument, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); + } + } + + if (methodSignature.GenericParameterConstraints != null) + { + foreach (var constraint in methodSignature.GenericParameterConstraints) + { + AddTypeReference(references, constraint.Type, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); + } + } + } + + if (signature is ConstructorSignature constructorSignature) + { + AddTypeReference(references, constructorSignature.Type, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); + } + } + + private static void AddAttributes( + HashSet references, + IReadOnlyList attributes, + HashSet nodes, + IReadOnlyDictionary? serializationProviderNamesByType, + bool includeArguments) + { + foreach (var attribute in attributes) + { + AddTypeReference(references, attribute.Type, nodes, serializationProviderNamesByType); + if (!includeArguments) + { + continue; + } + + foreach (var argument in attribute.Arguments) + { + AddAttributeArgumentReference(references, argument, nodes, serializationProviderNamesByType); + } + + foreach (var (_, argument) in attribute.PositionalArguments) + { + AddAttributeArgumentReference(references, argument, nodes, serializationProviderNamesByType); + } + } + } + + private static bool IsAttributeNamed(AttributeStatement attribute, string name) + => string.Equals(attribute.Type.Name, name, StringComparison.Ordinal) || + string.Equals(attribute.Type.Name, $"{name}Attribute", StringComparison.Ordinal); + + private static void AddAttributeArgumentReference( + HashSet references, + ValueExpression argument, + HashSet nodes, + IReadOnlyDictionary? serializationProviderNamesByType) + { + if (argument is TypeOfExpression typeOf) + { + AddTypeReference(references, typeOf.Type, nodes, serializationProviderNamesByType); + AddMatchingName(references, typeOf.Type.Name, nodes); + } + } + + private static void AddTypeReference( + HashSet references, + CSharpType? type, + HashSet nodes, + IReadOnlyDictionary? serializationProviderNamesByType = null, + string? providerNamespace = null, + string? containingProviderTypeName = null, + IReadOnlySet? contextualTypeExclusions = null) + { + if (type == null) + { + return; + } + + if (type.IsArray) + { + AddTypeReference(references, type.ElementType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); + return; + } + + var providerTypeName = GetProviderTypeName(type); + var matchedContainingType = string.IsNullOrEmpty(type.Namespace) && + contextualTypeExclusions?.Contains(type.Name) != true && + !string.IsNullOrEmpty(containingProviderTypeName) && + AddExactMetadataNameMatch(references, $"{containingProviderTypeName}.{providerTypeName}", nodes); + if (!matchedContainingType && nodes.Contains(providerTypeName)) + { + references.Add(providerTypeName); + } + + if (serializationProviderNamesByType != null && + serializationProviderNamesByType.TryGetValue(providerTypeName, out var serializationProviderNames)) + { + foreach (var serializationProviderName in serializationProviderNames) + { + references.Add(serializationProviderName); + } + } + else if (!matchedContainingType && + !nodes.Contains(providerTypeName) && + string.IsNullOrEmpty(type.Namespace) && + !string.IsNullOrEmpty(providerNamespace)) + { + AddExactMetadataNameMatch(references, $"{providerNamespace}.{providerTypeName}", nodes); + } + + AddTypeReference(references, type.BaseType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); + AddTypeReference(references, type.DeclaringType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); + if (type.IsUnion) + { + foreach (var unionItemType in type.UnionItemTypes) + { + AddTypeReference(references, unionItemType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); + } + } + foreach (var argument in type.Arguments) + { + AddTypeReference(references, argument, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); + } + } + + private static string GetSimpleName(string fullyQualifiedName) + { + var lastDot = fullyQualifiedName.LastIndexOf('.'); + return lastDot < 0 ? fullyQualifiedName : fullyQualifiedName.Substring(lastDot + 1); + } + + private static string? GetNamespaceName(string fullyQualifiedName) + { + var lastDot = fullyQualifiedName.LastIndexOf('.'); + return lastDot < 0 ? null : fullyQualifiedName.Substring(0, lastDot); + } + + private static string GetProviderTypeName(CSharpType type) + { + var name = type.Arguments.Count > 0 && !type.Name.Contains('`', StringComparison.Ordinal) + ? $"{type.Name}`{type.Arguments.Count}" + : type.Name; + if (type.DeclaringType is { } declaringType) + { + return $"{GetProviderTypeName(declaringType)}.{name}"; + } + + return string.IsNullOrEmpty(type.Namespace) ? name : $"{type.Namespace}.{name}"; + } + + private static string StripGenericArity(string name) + { + var tick = name.IndexOf('`'); + var typeArgumentStart = name.IndexOf('<'); + var genericSuffixStart = tick < 0 + ? typeArgumentStart + : typeArgumentStart < 0 + ? tick + : Math.Min(tick, typeArgumentStart); + return genericSuffixStart < 0 ? name : name.Substring(0, genericSuffixStart); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs new file mode 100644 index 00000000000..622aa980a89 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; + +namespace Microsoft.TypeSpec.Generator +{ + internal static partial class ProviderReferenceMapAnalyzer + { + private static HashSet GetCustomInternalBoundaryNodes( + ProviderReferenceGraph publicGraph, + HashSet customInternalDeclarations) + { + var boundaryNodes = new HashSet(StringComparer.Ordinal); + foreach (var node in publicGraph.Nodes) + { + if (!publicGraph.References.TryGetValue(node, out var references)) + { + continue; + } + + if (references.Overlaps(customInternalDeclarations)) + { + boundaryNodes.Add(node); + } + } + + return boundaryNodes; + } + + private static HashSet GetPublicDeclaredNodes( + IReadOnlyList generatedProviders, + HashSet nodes) + { + return GetGeneratedDeclaredNodes(generatedProviders, nodes, publicOnly: false); + } + + private static HashSet GetPublicApiTraversalNodes( + HashSet internalizeDeclaredNodes, + HashSet publicDeclaredNodes, + HashSet generatedInternalDeclarations, + HashSet generatedImplementationInternalDeclarations) + { + var traversalNodes = new HashSet(StringComparer.Ordinal); + foreach (var node in internalizeDeclaredNodes) + { + if (generatedInternalDeclarations.Contains(node) || + generatedImplementationInternalDeclarations.Contains(node)) + { + continue; + } + + traversalNodes.Add(node); + } + + foreach (var node in publicDeclaredNodes) + { + if (!generatedInternalDeclarations.Contains(node) && + !generatedImplementationInternalDeclarations.Contains(node)) + { + traversalNodes.Add(node); + } + } + + return traversalNodes; + } + + private static HashSet GetInternalizeCandidates( + HashSet internalizeDeclaredNodes, + HashSet publicReachable, + HashSet customInternalDeclarations, + HashSet generatedInternalDeclarations, + HashSet customInternalBoundaryNodes, + HashSet customPublicRoots, + HashSet publicRoots, + HashSet nodes, + IReadOnlyDictionary> references) + { + var candidates = new HashSet(StringComparer.Ordinal); + foreach (var node in internalizeDeclaredNodes) + { + var isNonRootKept = IsKeptName(node, CodeModelGenerator.Instance.NonRootTypes, nodes); + var isPublicReachableNonRootKept = isNonRootKept && publicReachable.Contains(node); + if (!publicReachable.Contains(node) || + customInternalDeclarations.Contains(node) || + generatedInternalDeclarations.Contains(node) && !customPublicRoots.Contains(node) && !isPublicReachableNonRootKept || + customInternalBoundaryNodes.Contains(node) && (!publicRoots.Contains(node) || isNonRootKept) || + isNonRootKept && + references.TryGetValue(node, out var nodeReferences) && + (nodeReferences.Overlaps(customInternalDeclarations) || + nodeReferences.Overlaps(generatedInternalDeclarations))) + { + candidates.Add(node); + } + } + + // If a public non-root type exposes something that must remain internal, make the + // exposing type internal too. That avoids generating public APIs with internal types. + var addedCandidate = true; + while (addedCandidate) + { + addedCandidate = false; + foreach (var node in internalizeDeclaredNodes) + { + var isNonRootKept = IsKeptName(node, CodeModelGenerator.Instance.NonRootTypes, nodes); + if (candidates.Contains(node) || + publicRoots.Contains(node) && !isNonRootKept || + !references.TryGetValue(node, out var nodeReferences) || + !nodeReferences.Overlaps(candidates)) + { + continue; + } + + candidates.Add(node); + addedCandidate = true; + } + } + + // Non-root keep entries preserve the declared type/file, but deliberately do not + // root their dependencies. They can still be internalized when needed to avoid + // exposing custom/internal types through a public surface. + RemoveKeptNonRootNames(candidates, nodes, references, customInternalDeclarations, generatedInternalDeclarations, customInternalBoundaryNodes); + return candidates; + } + + private static void RemovePublicApiExposedCandidates( + HashSet internalizeDeclaredNodes, + HashSet candidates, + HashSet customInternalDeclarations, + IReadOnlyDictionary> references) + { + var removedCandidate = true; + while (removedCandidate) + { + removedCandidate = false; + foreach (var candidate in candidates.ToArray()) + { + if (customInternalDeclarations.Contains(candidate)) + { + continue; + } + + foreach (var node in internalizeDeclaredNodes) + { + if (candidates.Contains(node) || + !references.TryGetValue(node, out var nodeReferences) || + !nodeReferences.Contains(candidate)) + { + continue; + } + + candidates.Remove(candidate); + removedCandidate = true; + break; + } + } + } + } + + private static void AddNestedInternalizeCandidates( + IReadOnlyList generatedProviders, + HashSet candidates, + HashSet nodes) + { + var addedCandidate = true; + while (addedCandidate) + { + addedCandidate = false; + foreach (var provider in generatedProviders) + { + var declaringType = provider.DeclaringTypeProvider?.Type; + if (declaringType == null || + !candidates.Contains(GetProviderTypeName(declaringType))) + { + continue; + } + + var providerName = GetProviderTypeName(provider.Type); + if (nodes.Contains(providerName) && candidates.Add(providerName)) + { + addedCandidate = true; + } + } + } + } + + /// + /// Internalizes dependencies whose generated predecessors are all internal, unless the dependency + /// is an explicit public root. Repeats until transitive internal-only dependencies are included. + /// + private static void AddInternalOnlyDependencyCandidates( + HashSet internalizeDeclaredNodes, + HashSet candidates, + HashSet customInternalDeclarations, + HashSet generatedInternalDeclarations, + HashSet explicitPublicRoots, + IReadOnlyDictionary> references, + HashSet generatedImplementationInternalDeclarations) + { + var addedCandidate = true; + while (addedCandidate) + { + addedCandidate = false; + foreach (var node in internalizeDeclaredNodes) + { + if (candidates.Contains(node) || explicitPublicRoots.Contains(node)) + { + continue; + } + + var hasPredecessor = false; + var allPredecessorsInternalized = true; + foreach (var (owner, children) in references) + { + if (string.Equals(owner, node, StringComparison.Ordinal) || + generatedImplementationInternalDeclarations.Contains(owner) || + !children.Contains(node)) + { + continue; + } + + hasPredecessor = true; + if (!candidates.Contains(owner) && + !customInternalDeclarations.Contains(owner) && + !generatedInternalDeclarations.Contains(owner)) + { + allPredecessorsInternalized = false; + break; + } + } + + if (hasPredecessor && allPredecessorsInternalized && candidates.Add(node)) + { + addedCandidate = true; + } + } + } + } + + /// + /// Finds generated declarations that must be promoted to public because they are exposed by a + /// reachable public API, while respecting explicit internal boundaries and helper-only roots. + /// + private static HashSet GetPublicCandidates( + HashSet publicDeclaredNodes, + HashSet publicReachable, + HashSet customInternalDeclarations, + HashSet customInternalBoundaryNodes, + HashSet internalizeHelperRoots, + HashSet publicRootExclusions, + HashSet generatedInternalDeclarations, + HashSet publicRoots, + Dictionary> publicApiReferences, + Dictionary> internalizeReferences, + HashSet generatedImplementationInternalDeclarations) + { + var candidates = new HashSet(StringComparer.Ordinal); + foreach (var node in publicDeclaredNodes) + { + if (customInternalDeclarations.Contains(node) || + customInternalBoundaryNodes.Contains(node) || + internalizeHelperRoots.Contains(node) || + publicRootExclusions.Contains(node) || + !publicReachable.Contains(node)) + { + continue; + } + + if (generatedInternalDeclarations.Contains(node) && + !publicRoots.Contains(node) && + !HasPublicApiPredecessor(node, publicApiReferences, publicReachable, generatedImplementationInternalDeclarations)) + { + continue; + } + + if (!publicRoots.Contains(node) && + !HasPublicApiPredecessor(node, internalizeReferences, publicReachable, generatedInternalDeclarations, generatedImplementationInternalDeclarations)) + { + continue; + } + + candidates.Add(node); + } + + return candidates; + } + + private static HashSet GetRemovalCandidates( + IReadOnlyList providers, + IReadOnlyList generatedProviders, + ProviderReferenceGraph graph, + HashSet customRemovalRoots, + HashSet generatedDiscriminatorBaseNames) + { + var removeRoots = GetRootNames( + providers, + graph.Nodes, + helperRoots: [], + includeModelFactory: true, + includeAdditionalRoots: true, + publicClientRootsOnly: false); + + removeRoots.UnionWith(customRemovalRoots); + AddKeptNonRootNames(removeRoots, graph.Nodes); + + var removeReachableWithoutHelpers = GetReachableTypes(removeRoots, graph.References); + AddDerivedModelReferences(providers, graph.Nodes, graph.References, removeReachableWithoutHelpers, generatedDiscriminatorBaseNames); + removeReachableWithoutHelpers = GetReachableTypes(removeRoots, graph.References); + AddBasePreservedReferences(generatedProviders, graph.Nodes, graph.References, removeReachableWithoutHelpers); + + var removeHelperRoots = GetHelperRootNames(generatedProviders, graph.Nodes, removeReachableWithoutHelpers, graph.References, includeModelSerializationProviders: true); + removeRoots.UnionWith(removeHelperRoots); + + var removeReachable = GetReachableTypes(removeRoots, graph.References); + AddBasePreservedReferences(generatedProviders, graph.Nodes, graph.References, removeReachable); + + var removeDeclaredNodes = GetGeneratedDeclaredNodes(generatedProviders, graph.Nodes, publicOnly: false); + removeDeclaredNodes.ExceptWith(removeReachable); + return removeDeclaredNodes; + } + + private static void AddKeptNonRootNames(HashSet roots, HashSet nodes) + { + var nonRootTypes = CodeModelGenerator.Instance.NonRootTypes; + foreach (var node in nodes) + { + if (IsKeptName(node, nonRootTypes, nodes)) + { + roots.Add(node); + } + } + } + + private static void RemoveKeptNonRootNames( + HashSet candidates, + HashSet nodes, + IReadOnlyDictionary> references, + HashSet customInternalDeclarations, + HashSet generatedInternalDeclarations, + HashSet customInternalBoundaryNodes) + { + var nonRootTypes = CodeModelGenerator.Instance.NonRootTypes; + foreach (var node in nodes) + { + if (customInternalDeclarations.Contains(node) || + generatedInternalDeclarations.Contains(node) || + customInternalBoundaryNodes.Contains(node)) + { + continue; + } + + if (IsKeptName(node, nonRootTypes, nodes) && + !HasCandidateReference(node, candidates, references)) + { + candidates.Remove(node); + } + } + } + + private static bool HasCandidateReference( + string node, + HashSet candidates, + IReadOnlyDictionary> references) + { + if (references.TryGetValue(node, out var nodeReferences)) + { + foreach (var reference in nodeReferences) + { + if (!string.Equals(reference, node, StringComparison.Ordinal) && + candidates.Contains(reference)) + { + return true; + } + } + } + + foreach (var (source, sourceReferences) in references) + { + if (!string.Equals(source, node, StringComparison.Ordinal) && + candidates.Contains(source) && + sourceReferences.Contains(node)) + { + return true; + } + } + + return false; + } + + private static Dictionary> CloneReferences(IReadOnlyDictionary> references) + { + var clone = new Dictionary>(StringComparer.Ordinal); + foreach (var (name, referencedNames) in references) + { + clone.Add(name, new HashSet(referencedNames, StringComparer.Ordinal)); + } + + return clone; + } + + private static void AddDerivedModelReferences( + IReadOnlyList providers, + HashSet nodes, + Dictionary> references, + HashSet publicBaseModels, + HashSet generatedDiscriminatorBaseNames) + { + var modelProviders = new List(); + var discriminatorProviders = new List(); + var discriminatorBaseNames = new HashSet(StringComparer.Ordinal); + foreach (var provider in providers) + { + if (provider is not ModelProvider modelProvider || + !modelProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + continue; + } + + modelProviders.Add(modelProvider); + + if (modelProvider.DiscriminatorProperty != null) + { + discriminatorBaseNames.Add(GetProviderTypeName(modelProvider.Type)); + } + + if (!modelProvider.IsUnknownDiscriminatorModel && + (modelProvider.DiscriminatorProperty != null || modelProvider.DiscriminatorValue != null)) + { + discriminatorProviders.Add(modelProvider); + } + } + + discriminatorBaseNames.UnionWith(generatedDiscriminatorBaseNames); + var addedReference = true; + while (addedReference) + { + addedReference = false; + foreach (var provider in discriminatorProviders) + { + var providerName = GetProviderTypeName(provider.Type); + if (!nodes.Contains(providerName)) + { + continue; + } + + if (!publicBaseModels.Contains(providerName)) + { + continue; + } + + foreach (var derivedModel in provider.DerivedModels) + { + if (derivedModel.IsUnknownDiscriminatorModel || + !derivedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + continue; + } + + var before = references[providerName].Count; + AddTypeReference(references[providerName], derivedModel.Type, nodes); + var derivedName = GetProviderTypeName(derivedModel.Type); + if (nodes.Contains(derivedName) && publicBaseModels.Add(derivedName) || references[providerName].Count != before) + { + addedReference = true; + } + } + } + + foreach (var provider in modelProviders) + { + if (provider.IsUnknownDiscriminatorModel || + !provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + continue; + } + + var providerName = GetProviderTypeName(provider.Type); + if (!nodes.Contains(providerName)) + { + continue; + } + + var baseTypeName = provider.BaseType == null ? null : GetProviderTypeName(provider.BaseType); + if (baseTypeName == null || + !discriminatorBaseNames.Contains(baseTypeName) || + !nodes.Contains(baseTypeName) || + !publicBaseModels.Contains(baseTypeName)) + { + continue; + } + + var before = references[baseTypeName].Count; + references[baseTypeName].Add(providerName); + if (publicBaseModels.Add(providerName) || references[baseTypeName].Count != before) + { + addedReference = true; + } + } + } + } + + private static void AddBasePreservedReferences( + IReadOnlyList providers, + HashSet nodes, + IReadOnlyDictionary> references, + HashSet reachableTypes) + { + var basePreservedRoots = new HashSet(StringComparer.Ordinal); + var addedRoot = true; + while (addedRoot) + { + addedRoot = false; + foreach (var provider in GetGeneratedProviders(providers)) + { + var providerName = GetProviderTypeName(provider.Type); + if (!nodes.Contains(providerName) || reachableTypes.Contains(providerName) || basePreservedRoots.Contains(providerName)) + { + continue; + } + + var baseTypeName = provider.BaseType == null ? null : GetProviderTypeName(provider.BaseType); + if (baseTypeName == null || !reachableTypes.Contains(baseTypeName)) + { + continue; + } + + if (basePreservedRoots.Add(providerName)) + { + addedRoot = true; + } + } + + if (addedRoot) + { + reachableTypes.UnionWith(GetReachableTypes(basePreservedRoots, references)); + } + } + } + + private static IReadOnlyList GetGeneratedProviders(IReadOnlyList providers) + { + var generatedProviders = new List(); + var visited = new HashSet(); + foreach (var provider in providers) + { + AddGeneratedProvider(generatedProviders, visited, provider); + } + + return generatedProviders; + } + + private static void AddGeneratedProvider(List generatedProviders, HashSet visited, TypeProvider provider) + { + if (!visited.Add(provider)) + { + return; + } + + generatedProviders.Add(provider); + foreach (var nestedType in provider.NestedTypes) + { + AddGeneratedProvider(generatedProviders, visited, nestedType); + } + + foreach (var serializationProvider in provider.SerializationProviders) + { + AddGeneratedProvider(generatedProviders, visited, serializationProvider); + } + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs new file mode 100644 index 00000000000..ac67a94f7c7 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs @@ -0,0 +1,915 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.CodeAnalysis; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; + +namespace Microsoft.TypeSpec.Generator +{ + internal static partial class ProviderReferenceMapAnalyzer + { + private static bool IsKept(CSharpType type, HashSet roots, HashSet nodes) + { + var providerName = GetProviderTypeName(type); + return IsKeptName(providerName, type.Name, roots, nodes); + } + + private static bool IsKeptName(string providerName, HashSet roots, HashSet nodes) + { + return IsKeptName(providerName, StripGenericArity(GetSimpleName(providerName)), roots, nodes); + } + + private static bool IsKeptName(string providerName, string simpleName, HashSet roots, HashSet nodes) + { + return MatchesGeneratedNode(providerName, simpleName, roots, nodes); + } + + private static bool MatchesGeneratedNode( + string providerName, + string simpleName, + HashSet candidateNames, + HashSet nodes, + bool ignoreGenericArity = true) + { + if (candidateNames.Contains(providerName) && nodes.Contains(providerName)) + { + return true; + } + + var simpleNameLookup = ignoreGenericArity + ? _simpleNameLookupCache.GetValue(nodes, BuildSimpleNameLookup) + : _metadataSimpleNameLookupCache.GetValue(nodes, BuildMetadataSimpleNameLookup); + if (!simpleNameLookup.TryGetValue(simpleName, out var matches) || matches.Length != 1) + { + return false; + } + + var matchingNode = matches[0]; + return (string.Equals(providerName, simpleName, StringComparison.Ordinal) || + string.Equals(providerName, matchingNode, StringComparison.Ordinal)) && + (candidateNames.Contains(matchingNode) || candidateNames.Contains(simpleName)); + } + + private static bool IsClientProviderRoot(TypeProvider provider, bool publicOnly) => + provider.IsClientProvider && + (!publicOnly || provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + + private static bool IsAdditionalRootProvider(TypeProvider provider, HashSet roots, HashSet nodes) + { + return provider.DeclaringTypeProvider == null && IsKept(provider.Type, roots, nodes); + } + + private static bool IsModelFactoryProvider(TypeProvider provider) + => provider is ModelFactoryProvider; + + private static bool IsGeneratedInternalHelperDeclaration(TypeProvider provider) + { + if (provider is ModelProvider || + provider is EnumProvider || + IsModelFactoryProvider(provider) || + provider.DeclaringTypeProvider != null || + provider.SerializationProviders.Count > 0 || + IsModelSerializationProviderDeclaration(provider)) + { + return false; + } + + return !string.Equals(provider.RelativeFilePath, Path.Combine("src", "Generated", "Models", $"{provider.Name}.cs"), StringComparison.Ordinal); + } + + private static bool IsModelSerializationProviderDeclaration(TypeProvider provider) => + provider.SerializationProviderOwner != null; + + private static HashSet GetHelperRootNames( + IReadOnlyList providers, + HashSet nodes, + HashSet reachableTypes, + IReadOnlyDictionary>? references = null, + bool includeModelSerializationProviders = false) + { + var roots = new HashSet(StringComparer.Ordinal); + var generatedHelperNames = references == null ? null : GetGeneratedHelperNames(providers, nodes, includeModelSerializationProviders); + foreach (var provider in GetGeneratedProviders(providers)) + { + var providerName = GetProviderTypeName(provider.Type); + var isModelFactory = IsModelFactoryProvider(provider); + if (!reachableTypes.Contains(providerName) && !isModelFactory) + { + continue; + } + + AddHelperDependencies(roots, provider.HelperDependencyTypes, nodes, references == null ? null : references[providerName], provider.Type.Namespace); + if (references != null) + { + AddReferencedHelperRoots(roots, references[providerName], generatedHelperNames!); + } + + foreach (var property in provider.Properties) + { + AddInitializationHelperRoot(roots, property.Type, nodes); + AddParameterValidationHelperRoot(roots, property.AsParameter, nodes); + } + + foreach (var field in provider.Fields) + { + AddParameterValidationHelperRoot(roots, field.AsParameter, nodes); + } + + foreach (var constructor in provider.Constructors) + { + foreach (var parameter in constructor.Signature.Parameters) + { + AddParameterValidationHelperRoot(roots, parameter, nodes); + } + } + + foreach (var method in provider.Methods) + { + // Only factory methods for reachable models can instantiate collection helpers. + if (isModelFactory && + (method.Signature.ReturnType == null || !reachableTypes.Contains(GetProviderTypeName(method.Signature.ReturnType)))) + { + continue; + } + + foreach (var parameter in method.Signature.Parameters) + { + AddParameterValidationHelperRoot(roots, parameter, nodes); + if (isModelFactory) + { + AddModelFactoryCollectionInitializationHelperRoot(roots, parameter.Type, nodes); + } + } + } + } + + return roots; + } + + private static HashSet GetGeneratedHelperNames(IReadOnlyList providers, HashSet nodes, bool includeModelSerializationProviders) + { + var helpers = new HashSet(StringComparer.Ordinal); + foreach (var provider in GetGeneratedProviders(providers)) + { + if (!IsGeneratedInternalHelperDeclaration(provider) && + (!includeModelSerializationProviders || !IsModelSerializationProviderDeclaration(provider))) + { + continue; + } + + var providerName = GetProviderTypeName(provider.Type); + if (nodes.Contains(providerName)) + { + helpers.Add(providerName); + } + } + + return helpers; + } + + private static void AddReferencedHelperRoots(HashSet roots, HashSet referencedNames, HashSet generatedHelperNames) + { + foreach (var referencedName in referencedNames) + { + if (generatedHelperNames.Contains(referencedName)) + { + roots.Add(referencedName); + } + } + } + + private static void AddParameterValidationHelperRoot(HashSet roots, ParameterProvider parameter, HashSet nodes) + { + if (parameter.Validation != ParameterValidationType.None) + { + AddTypeReference(roots, new ArgumentDefinition().Type, nodes); + } + } + + private static void AddHelperDependencies( + HashSet roots, + IReadOnlyList dependencies, + HashSet nodes, + HashSet? referencedNames, + string? providerNamespace) + { + foreach (var dependency in dependencies) + { + var matches = new HashSet(StringComparer.Ordinal); + AddTypeReference(matches, dependency, nodes); + AddProviderNamespaceDependencyMatches(matches, dependency, providerNamespace, nodes); + foreach (var match in matches) + { + roots.Add(match); + } + } + } + + private static void AddProviderNamespaceDependencyMatches(HashSet matches, CSharpType? dependency, string? providerNamespace, HashSet nodes) + { + if (dependency == null || string.IsNullOrEmpty(providerNamespace)) + { + return; + } + + AddNamespaceBodyDependencyName(matches, providerNamespace, dependency, nodes); + foreach (var argument in dependency.Arguments) + { + AddProviderNamespaceDependencyMatches(matches, argument, providerNamespace, nodes); + } + } + + private static void AddInitializationHelperRoot(HashSet roots, CSharpType? type, HashSet nodes) + { + if (type == null) + { + return; + } + + var initializationType = type.PropertyInitializationType; + if (!string.Equals(initializationType.FullyQualifiedName, type.FullyQualifiedName, StringComparison.Ordinal)) + { + AddMatchingName(roots, initializationType.Name, nodes); + } + + if (type is { IsList: true, IsReadOnlyMemory: false }) + { + AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.ListInitializationType, nodes); + } + + if (type.IsDictionary) + { + AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType, nodes); + } + + foreach (var argument in type.Arguments) + { + AddInitializationHelperRoot(roots, argument, nodes); + } + } + + private static void AddModelFactoryCollectionInitializationHelperRoot(HashSet roots, CSharpType? type, HashSet nodes) + { + if (type == null) + { + return; + } + + if (type is { IsList: true, IsReadOnlyMemory: false }) + { + AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.ListInitializationType, nodes); + } + + if (type.IsDictionary) + { + AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType, nodes); + } + + foreach (var argument in type.Arguments) + { + AddModelFactoryCollectionInitializationHelperRoot(roots, argument, nodes); + } + } + + private static void AddMatchingName(HashSet target, string name, HashSet nodes) + { + if (nodes.Contains(name)) + { + target.Add(name); + return; + } + + var simpleNameLookup = _simpleNameLookupCache.GetValue(nodes, BuildSimpleNameLookup); + if (!simpleNameLookup.TryGetValue(name, out var matches)) + { + return; + } + + foreach (var match in matches) + { + target.Add(match); + } + } + + private static void AddUnambiguousMatchingName(HashSet target, string name, HashSet nodes) + { + if (nodes.Contains(name)) + { + target.Add(name); + return; + } + + var simpleNameLookup = _simpleNameLookupCache.GetValue(nodes, BuildSimpleNameLookup); + if (simpleNameLookup.TryGetValue(name, out var matches) && matches.Length == 1) + { + target.Add(matches[0]); + } + } + + private static void AddMatchingNamesWithSimpleNameSuffix(HashSet target, string suffix, HashSet nodes) + { + foreach (var node in nodes) + { + if (GetSimpleName(node).EndsWith(suffix, StringComparison.Ordinal)) + { + target.Add(node); + } + } + } + + private static Dictionary BuildSimpleNameLookup(HashSet nodes) + => BuildSimpleNameLookup(nodes, ignoreGenericArity: true); + + private static Dictionary BuildMetadataSimpleNameLookup(HashSet nodes) + => BuildSimpleNameLookup(nodes, ignoreGenericArity: false); + + private static Dictionary BuildSimpleNameLookup( + HashSet nodes, + bool ignoreGenericArity) + { + var lookup = new Dictionary>(StringComparer.Ordinal); + foreach (var node in nodes) + { + if (IsNestedNode(node, nodes)) + { + continue; + } + + var simpleName = GetSimpleName(node); + if (ignoreGenericArity) + { + simpleName = StripGenericArity(simpleName); + } + if (!lookup.TryGetValue(simpleName, out var matchingNodes)) + { + matchingNodes = []; + lookup.Add(simpleName, matchingNodes); + } + + matchingNodes.Add(node); + } + + var result = new Dictionary(StringComparer.Ordinal); + foreach (var (simpleName, matchingNodes) in lookup) + { + result.Add(simpleName, [.. matchingNodes]); + } + + return result; + } + + private static bool IsNestedNode(string node, HashSet nodes) + { + var dotIndex = node.IndexOf('.'); + while (dotIndex >= 0) + { + if (nodes.Contains(node.Substring(0, dotIndex))) + { + return true; + } + + dotIndex = node.IndexOf('.', dotIndex + 1); + } + + return false; + } + + private static HashSet GetReachableTypes(HashSet roots, IReadOnlyDictionary> references) + { + return GetReachableTypes(roots, references, expandableNodes: null); + } + + private static HashSet GetReachableTypes( + HashSet roots, + IReadOnlyDictionary> references, + HashSet? expandableNodes) + { + var reachable = new HashSet(StringComparer.Ordinal); + var queue = new Queue(roots); + while (queue.Count > 0) + { + var current = queue.Dequeue(); + if (!reachable.Add(current)) + { + continue; + } + + if (expandableNodes != null && !expandableNodes.Contains(current)) + { + continue; + } + + if (!references.TryGetValue(current, out var children)) + { + continue; + } + + foreach (var child in children) + { + queue.Enqueue(child); + } + } + + return reachable; + } + + private static bool HasPublicApiPredecessor( + string name, + IReadOnlyDictionary> references, + HashSet publicReachable, + HashSet generatedImplementationInternalDeclarations) + => HasPublicApiPredecessor(name, references, publicReachable, excludedPredecessors: null, generatedImplementationInternalDeclarations); + + private static bool HasPublicApiPredecessor( + string name, + IReadOnlyDictionary> references, + HashSet publicReachable, + HashSet? excludedPredecessors, + HashSet generatedImplementationInternalDeclarations) + { + foreach (var (owner, children) in references) + { + if (!publicReachable.Contains(owner) || + string.Equals(owner, name, StringComparison.Ordinal) || + excludedPredecessors?.Contains(owner) == true || + generatedImplementationInternalDeclarations.Contains(owner) || + !children.Contains(name)) + { + continue; + } + + return true; + } + + return false; + } + + private static HashSet GetRootNames( + IReadOnlyList providers, + HashSet nodes, + HashSet helperRoots, + bool includeModelFactory, + bool includeAdditionalRoots, + bool publicClientRootsOnly) + { + var generator = CodeModelGenerator.Instance; + var roots = new HashSet(StringComparer.Ordinal); + var modelFactoryName = GetProviderTypeName(generator.OutputLibrary.ModelFactory.Value.Type); + + foreach (var provider in providers) + { + var name = GetProviderTypeName(provider.Type); + if (IsClientProviderRoot(provider, publicClientRootsOnly) || + includeAdditionalRoots && IsAdditionalRootProvider(provider, generator.AdditionalRootTypes, nodes) || + includeModelFactory && string.Equals(name, modelFactoryName, StringComparison.Ordinal) || + includeModelFactory && helperRoots.Contains(name)) + { + roots.Add(name); + } + } + + return roots; + } + + private static void RemoveMethodsFromModelFactory(HashSet namesToRemove, HashSet nodes) + { + if (namesToRemove.Count == 0) + { + return; + } + + var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; + _preWriteModelFactory = modelFactory; + _preWriteModelFactoryMethods ??= [.. modelFactory.Methods]; + var removedLeadingMethod = false; + var methodsToKeep = new List(); + for (int i = 0; i < modelFactory.Methods.Count; i++) + { + var method = modelFactory.Methods[i]; + if (!ShouldRemoveModelFactoryMethod(method, namesToRemove, nodes)) + { + methodsToKeep.Add(method); + continue; + } + + if (i == 0) + { + removedLeadingMethod = true; + } + } + + if (removedLeadingMethod && methodsToKeep.Count > 0) + { + modelFactory.PreserveLeadingMethodSeparator = true; + } + + modelFactory.Update(methods: methodsToKeep); + } + + private static bool ShouldRemoveModelFactoryMethod( + MethodProvider method, + HashSet namesToRemove, + HashSet nodes) + { + if (method.Signature.ReturnType == null) + { + return MatchesGeneratedNode( + method.Signature.Name, + method.Signature.Name, + namesToRemove, + nodes); + } + + var returnTypeName = GetProviderTypeName(method.Signature.ReturnType); + return MatchesGeneratedNode( + returnTypeName, + StripGenericArity(GetSimpleName(returnTypeName)), + namesToRemove, + nodes); + } + + private static HashSet GetGeneratedDeclaredNodes(IReadOnlyList providers, HashSet nodes, bool publicOnly) + { + var generator = CodeModelGenerator.Instance; + var declaredNodes = new HashSet(StringComparer.Ordinal); + foreach (var provider in GetGeneratedProviders(providers)) + { + if (IsModelFactoryProvider(provider)) + { + continue; + } + + if (publicOnly && !provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + continue; + } + + var name = GetProviderTypeName(provider.Type); + if (!nodes.Contains(name)) + { + continue; + } + + declaredNodes.Add(name); + } + + return declaredNodes; + } + + private static HashSet GetCustomCodeGeneratedTypeRoots(IReadOnlyList providers, HashSet generatedTypeNames) + { + var roots = new HashSet(StringComparer.Ordinal); + foreach (var customCodeView in GetCustomCodeViews(providers)) + { + AddCustomCodeViewGeneratedTypeRoot(roots, customCodeView, generatedTypeNames); + AddCustomCodeViewRoots(roots, customCodeView, generatedTypeNames, publicOnly: false); + } + + return roots; + } + + private static HashSet GetCustomCodePublicGeneratedTypeRoots(IReadOnlyList providers, HashSet generatedTypeNames) + { + var roots = new HashSet(StringComparer.Ordinal); + foreach (var customCodeView in GetCustomCodeViews(providers)) + { + if (!customCodeView.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + continue; + } + + AddCustomCodeViewGeneratedTypeRoot(roots, customCodeView, generatedTypeNames); + AddCustomCodeViewRoots(roots, customCodeView, generatedTypeNames, publicOnly: true); + } + + return roots; + } + + private static IEnumerable GetCustomCodeViews(IReadOnlyList providers) + { + var visited = new HashSet(StringComparer.Ordinal); + var modelFactoryCustomCodeView = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value.CustomCodeView; + if (modelFactoryCustomCodeView != null && visited.Add(GetCustomCodeViewIdentity(modelFactoryCustomCodeView))) + { + yield return modelFactoryCustomCodeView; + } + + foreach (var provider in providers) + { + var customCodeView = provider.CustomCodeView; + if (customCodeView == null || !visited.Add(GetCustomCodeViewIdentity(customCodeView))) + { + continue; + } + + yield return customCodeView; + } + + foreach (var customTypeProvider in CodeModelGenerator.Instance.SourceInputModel.CustomizationTypeProviders) + { + if (visited.Add(GetCustomCodeViewIdentity(customTypeProvider))) + { + yield return customTypeProvider; + } + } + } + + private static string GetCustomCodeViewIdentity(TypeProvider customCodeView) => + customCodeView is NamedTypeSymbolProvider namedTypeSymbolProvider + ? namedTypeSymbolProvider.MetadataName + : GetProviderTypeName(customCodeView.Type); + + private static void AddCustomCodeViewGeneratedTypeRoot(HashSet roots, TypeProvider customCodeView, HashSet generatedTypeNames) + { + if (customCodeView is NamedTypeSymbolProvider namedTypeSymbolProvider) + { + AddExactMetadataNameMatch(roots, namedTypeSymbolProvider.MetadataName, generatedTypeNames); + return; + } + + AddTypeReference(roots, customCodeView.Type, generatedTypeNames); + } + + private static void AddCustomCodeViewRoots( + HashSet roots, + TypeProvider customCodeView, + HashSet generatedTypeNames, + bool publicOnly) + { + var containingProviderTypeName = NormalizeMetadataTypeName(GetCustomCodeViewIdentity(customCodeView)); + var contextualTypeExclusions = customCodeView.Type.Arguments + .Select(argument => argument.Name) + .ToHashSet(StringComparer.Ordinal); + AddTypeReference(roots, customCodeView.BaseType, generatedTypeNames); + AddProviderBodyDependencyTypes(roots, customCodeView.SignatureDependencyTypes, generatedTypeNames, includeUnqualifiedSimpleNameReferences: true); + if (!publicOnly) + { + AddProviderBodyDependencyTypes(roots, customCodeView.BodyDependencyTypes, generatedTypeNames); + AddCustomCodeViewNamespaceBodyDependencyTypes(roots, customCodeView, generatedTypeNames); + AddAttributes(roots, customCodeView.Attributes, generatedTypeNames, serializationProviderNamesByType: null, includeArguments: true); + } + + foreach (var implementedType in customCodeView.Implements) + { + AddTypeReference(roots, implementedType, generatedTypeNames); + } + + foreach (var constructor in customCodeView.Constructors) + { + if (publicOnly && !IsPublic(constructor.Signature.Modifiers)) + { + continue; + } + + AddSignatureReferences( + roots, + constructor.Signature, + generatedTypeNames, + serializationProviderNamesByType: null, + includeAttributes: !publicOnly, + containingProviderTypeName: containingProviderTypeName, + contextualTypeExclusions: contextualTypeExclusions); + } + + foreach (var method in customCodeView.Methods) + { + if (publicOnly && !IsPublic(method.Signature.Modifiers)) + { + continue; + } + + AddSignatureReferences( + roots, + method.Signature, + generatedTypeNames, + serializationProviderNamesByType: null, + includeAttributes: !publicOnly, + containingProviderTypeName: containingProviderTypeName, + contextualTypeExclusions: contextualTypeExclusions); + } + + foreach (var property in customCodeView.Properties) + { + if (publicOnly && !IsPublic(property.Modifiers)) + { + continue; + } + + AddTypeReference( + roots, + property.Type, + generatedTypeNames, + containingProviderTypeName: containingProviderTypeName, + contextualTypeExclusions: contextualTypeExclusions); + AddTypeReference(roots, property.ExplicitInterface, generatedTypeNames); + if (!publicOnly) + { + AddAttributes(roots, property.Attributes, generatedTypeNames, serializationProviderNamesByType: null, includeArguments: true); + } + } + + foreach (var field in customCodeView.Fields) + { + if (publicOnly && !IsPublic(field.Modifiers)) + { + continue; + } + + AddTypeReference( + roots, + field.Type, + generatedTypeNames, + containingProviderTypeName: containingProviderTypeName, + contextualTypeExclusions: contextualTypeExclusions); + if (!publicOnly) + { + AddAttributes(roots, field.Attributes, generatedTypeNames, serializationProviderNamesByType: null, includeArguments: true); + } + } + } + + private static void AddCustomCodeViewNamespaceBodyDependencyTypes(HashSet roots, TypeProvider customCodeView, HashSet generatedTypeNames) + { + var customNamespace = customCodeView.Type.Namespace; + if (string.IsNullOrEmpty(customNamespace)) + { + return; + } + + var customMemberNames = GetCustomCodeViewMemberNames(customCodeView); + foreach (var dependency in customCodeView.BodyDependencyTypes) + { + AddNamespaceBodyDependencyType(roots, dependency, customNamespace, customMemberNames, generatedTypeNames); + } + } + + private static void AddNamespaceBodyDependencyType(HashSet roots, CSharpType? dependency, string customNamespace, HashSet customMemberNames, HashSet generatedTypeNames) + { + if (dependency == null) + { + return; + } + + var dependencyName = GetProviderTypeName(dependency); + var simpleDependencyName = StripGenericArity(GetSimpleName(dependencyName)); + if (string.IsNullOrEmpty(dependency.Namespace) && + !customMemberNames.Contains(simpleDependencyName)) + { + for (var namespaceCandidate = customNamespace; namespaceCandidate != null; namespaceCandidate = GetNamespaceName(namespaceCandidate)) + { + AddExactMetadataNameMatch(roots, $"{namespaceCandidate}.{dependencyName}", generatedTypeNames); + if (!string.Equals(simpleDependencyName, dependencyName, StringComparison.Ordinal)) + { + AddExactMetadataNameMatch(roots, $"{namespaceCandidate}.{simpleDependencyName}", generatedTypeNames); + } + } + } + + foreach (var argument in dependency.Arguments) + { + AddNamespaceBodyDependencyType(roots, argument, customNamespace, customMemberNames, generatedTypeNames); + } + } + + private static HashSet GetCustomCodeViewMemberNames(TypeProvider customCodeView) + { + var memberNames = new HashSet(StringComparer.Ordinal); + foreach (var property in customCodeView.Properties) + { + memberNames.Add(property.Name); + } + + foreach (var field in customCodeView.Fields) + { + memberNames.Add(field.Name); + } + + foreach (var method in customCodeView.Methods) + { + memberNames.Add(method.Signature.Name); + } + + return memberNames; + } + + /// + /// Matches internal custom declarations to the generated provider identities whose accessibility + /// they constrain. Metadata names preserve nested-type identity when available. + /// + private static HashSet GetCustomCodeInternalGeneratedTypeDeclarations(IReadOnlyList providers, HashSet generatedTypeNames) + { + var declarations = new HashSet(StringComparer.Ordinal); + foreach (var customCodeView in GetCustomCodeViews(providers)) + { + if (!customCodeView.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) + { + continue; + } + + if (customCodeView is NamedTypeSymbolProvider namedTypeSymbolProvider) + { + AddExactMetadataNameMatch(declarations, namedTypeSymbolProvider.MetadataName, generatedTypeNames); + } + else + { + AddTypeReference(declarations, customCodeView.Type, generatedTypeNames); + } + } + + return declarations; + } + + private static bool AddExactMetadataNameMatch(HashSet target, string metadataName, HashSet generatedTypeNames) + { + var normalizedName = NormalizeMetadataTypeName(metadataName); + if (!string.IsNullOrEmpty(normalizedName) && generatedTypeNames.Contains(normalizedName)) + { + target.Add(normalizedName); + return true; + } + + return false; + } + + private static string NormalizeMetadataTypeName(string metadataName) + { + var arrayIndex = metadataName.IndexOf('[', StringComparison.Ordinal); + if (arrayIndex > 0) + { + metadataName = metadataName.Substring(0, arrayIndex); + } + + return metadataName.Replace('+', '.'); + } + + private static HashSet GetGeneratedPersistableModelProxyTypeNames(IReadOnlyList providers, HashSet generatedTypeNames) + { + var proxyTypes = new HashSet(StringComparer.Ordinal); + foreach (var provider in GetGeneratedProviders(providers)) + { + if (!provider.ShouldAnalyzeAttributesInReferenceMap) + { + continue; + } + + if (provider.Attributes.Any(static attribute => IsAttributeNamed(attribute, "PersistableModelProxy"))) + { + AddTypeReference(proxyTypes, provider.Type, generatedTypeNames); + } + } + + return proxyTypes; + } + + private static HashSet GetGeneratedInternalTypeDeclarations( + IReadOnlyList providers, + HashSet generatedTypeNames) + { + var declarations = new HashSet(StringComparer.Ordinal); + var nonInternalDeclarations = new HashSet(StringComparer.Ordinal); + foreach (var provider in GetGeneratedProviders(providers)) + { + if (provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) + { + AddTypeReference(declarations, provider.Type, generatedTypeNames); + } + else + { + AddTypeReference(nonInternalDeclarations, provider.Type, generatedTypeNames); + } + } + + declarations.ExceptWith(nonInternalDeclarations); + return declarations; + } + + private static HashSet GetGeneratedImplementationInternalTypeDeclarations( + IReadOnlyList providers, + HashSet generatedInternalDeclarations) + { + var implementationDeclarations = new HashSet(StringComparer.Ordinal); + foreach (var provider in GetGeneratedProviders(providers)) + { + if (!provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Static) && + !IsGeneratedInternalImplementation(provider)) + { + continue; + } + + AddTypeReference(implementationDeclarations, provider.Type, generatedInternalDeclarations); + } + + return implementationDeclarations; + } + + private static bool IsGeneratedInternalImplementation(TypeProvider provider) + => provider.RelativeFilePath.Contains( + $"{Path.DirectorySeparatorChar}Generated{Path.DirectorySeparatorChar}Internal{Path.DirectorySeparatorChar}", + StringComparison.Ordinal); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs new file mode 100644 index 00000000000..25382973239 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Statements; + +namespace Microsoft.TypeSpec.Generator +{ + internal static partial class ProviderReferenceMapAnalyzer + { + private static ProviderReferenceMapResult? _latestResult; + private static readonly ConditionalWeakTable, Dictionary> _simpleNameLookupCache = new(); + private static readonly ConditionalWeakTable, Dictionary> _metadataSimpleNameLookupCache = new(); + private static TypeProvider? _preWriteModelFactory; + private static MethodProvider[]? _preWriteModelFactoryMethods; + + public static ProviderReferenceMapResult? LatestResult => _latestResult; + + public static ProviderReferenceMapSession PrepareForGeneration(IReadOnlyList providers) + { + ResetPreWriteAccessibility(); + ApplyPreWriteAccessibility(providers); + Analyze(providers); + return new ProviderReferenceMapSession(); + } + + public static bool ShouldWriteProvider(TypeProvider provider) => + _latestResult?.RemoveCandidates.Contains(GetProviderTypeName(provider.Type)) != true; + + public static bool IsResolvableBuildableType(CSharpType type) + { + if (TryGetProvider(type, exact: true, out var provider)) + { + return IsResolvableBuildableProvider(provider); + } + + if (MatchesRemovedProvider(type)) + { + return false; + } + + return !TryGetProvider(type, exact: false, out provider) || + IsResolvableBuildableProvider(provider); + } + + private static bool IsResolvableBuildableProvider(TypeProvider provider) => + provider is not SystemObjectModelProvider && + provider is not ModelProvider { IsExternal: true } && + ShouldWriteProvider(provider); + + private static bool TryGetProvider(CSharpType type, bool exact, out TypeProvider provider) + { + var outputProvider = FindOutputProviderByName( + CodeModelGenerator.Instance.OutputLibrary.TypeProviders, + GetProviderTypeName(type)); + if (outputProvider != null) + { + provider = outputProvider; + return true; + } + + if (!exact && string.IsNullOrEmpty(type.Namespace)) + { + if (_latestResult != null) + { + var simpleNameLookup = _metadataSimpleNameLookupCache.GetValue(_latestResult.Nodes, BuildMetadataSimpleNameLookup); + var simpleName = GetSimpleName(GetProviderTypeName(type)); + if (!simpleNameLookup.TryGetValue(simpleName, out var matches) || + matches.Length != 1) + { + provider = null!; + return false; + } + + outputProvider = FindOutputProviderByName( + CodeModelGenerator.Instance.OutputLibrary.TypeProviders, + matches[0]); + if (outputProvider != null) + { + provider = outputProvider; + return true; + } + } + else if (CodeModelGenerator.Instance.TypeFactory.TypeProvidersByName.TryGetValue(type.Name, out var mappedProvider)) + { + provider = mappedProvider; + return true; + } + } + + provider = null!; + return false; + } + + private static TypeProvider? FindOutputProviderByName(IEnumerable providers, string name) + { + foreach (var provider in providers) + { + if (string.Equals(GetProviderTypeName(provider.Type), name, StringComparison.Ordinal)) + { + return provider; + } + + var nestedProvider = FindOutputProviderByName(provider.NestedTypes, name); + if (nestedProvider != null) + { + return nestedProvider; + } + + var serializationProvider = FindOutputProviderByName(provider.SerializationProviders, name); + if (serializationProvider != null) + { + return serializationProvider; + } + } + + return null; + } + + private static bool MatchesRemovedProvider(CSharpType type) + { + if (_latestResult == null || _latestResult.RemoveCandidates.Count == 0) + { + return false; + } + + var providerName = GetProviderTypeName(type); + if (_latestResult.RemoveCandidates.Contains(providerName)) + { + return true; + } + + return string.IsNullOrEmpty(type.Namespace) && + MatchesGeneratedNode( + providerName, + GetSimpleName(providerName), + _latestResult.RemoveCandidates, + _latestResult.Nodes, + ignoreGenericArity: false); + } + + public static void ResetPreWriteAccessibility() + { + RestorePreWriteModelFactoryMethods(); + _latestResult = null; + } + + public static void ApplyPreWriteAccessibility(IReadOnlyList providers) + { + if (Configuration.UnreferencedTypesHandling == Configuration.UnreferencedTypesHandlingOption.KeepAll) + { + return; + } + + // Accessibility has to be adjusted before files are written. Roslyn can remove files + // later, but it cannot safely change provider declarations or model factory signatures. + var (internalizeCandidates, publicCandidates, nodes) = GetPreWriteAccessibilityCandidates(providers); + foreach (var provider in GetGeneratedProviders(providers)) + { + var providerName = GetProviderTypeName(provider.Type); + if (internalizeCandidates.Contains(providerName)) + { + if (provider.DeclaringTypeProvider is null) + { + provider.PreserveXmlDocs(); + } + provider.Update(modifiers: MakeInternal(provider.DeclarationModifiers)); + } + else if (publicCandidates.Contains(providerName) && !IsGeneratedInternalImplementation(provider)) + { + provider.Update(modifiers: MakePublic(provider.DeclarationModifiers)); + } + } + + RemoveMethodsFromModelFactory(internalizeCandidates, nodes); + } + + public static void RestorePreWriteModelFactoryMethods() + { + if (_preWriteModelFactory == null || _preWriteModelFactoryMethods == null) + { + return; + } + + _preWriteModelFactory.Update(methods: _preWriteModelFactoryMethods); + _preWriteModelFactory = null; + _preWriteModelFactoryMethods = null; + } + + public static void Analyze(IReadOnlyList providers) + { + var generatedProviders = GetGeneratedProviders(providers); + + // Build two graphs from provider metadata: the full implementation graph for removal, + // and the public-surface graph for accessibility decisions. + var graph = BuildGraph(generatedProviders); + var publicGraph = BuildGraph(generatedProviders, publicOnly: true); + + var customPublicRoots = GetCustomCodePublicGeneratedTypeRoots(generatedProviders, graph.Nodes); + var customCodeRemovalRoots = GetCustomCodeGeneratedTypeRoots(generatedProviders, graph.Nodes); + var customRemovalRoots = new HashSet(customCodeRemovalRoots, StringComparer.Ordinal); + var customInternalDeclarations = GetCustomCodeInternalGeneratedTypeDeclarations(generatedProviders, graph.Nodes); + var generatedInternalDeclarations = GetGeneratedInternalTypeDeclarations(generatedProviders, graph.Nodes); + + // Helper types are rooted after an initial reachability pass so unused infrastructure + // such as change-tracking dictionaries can still be removed when no reachable type needs them. + var generatedDiscriminatorBaseNames = GetGeneratedPersistableModelProxyTypeNames(generatedProviders, publicGraph.Nodes); + var (internalizeCandidates, publicCandidates, _) = GetAccessibilityCandidates( + providers, + generatedProviders, + graph, + publicGraph, + customPublicRoots, + customInternalDeclarations, + generatedInternalDeclarations, + generatedDiscriminatorBaseNames); + + var removeCandidates = new HashSet(StringComparer.Ordinal); + if (Configuration.UnreferencedTypesHandling == Configuration.UnreferencedTypesHandlingOption.RemoveOrInternalize) + { + // Body-only generated dependencies are needed to avoid deleting helper files, but they do + // not contribute to public API reachability for internalization. + AddGeneratedBodyReferences(providers, graph); + removeCandidates = GetRemovalCandidates( + providers, + generatedProviders, + graph, + customRemovalRoots, + generatedDiscriminatorBaseNames); + } + + _latestResult = new ProviderReferenceMapResult( + internalizeCandidates, + publicCandidates, + removeCandidates, + graph.Nodes); + if (Configuration.UnreferencedTypesHandling == Configuration.UnreferencedTypesHandlingOption.RemoveOrInternalize) + { + RemoveMethodsFromModelFactory(removeCandidates, graph.Nodes); + } + } + + private static (HashSet InternalizeCandidates, HashSet PublicCandidates, HashSet Nodes) GetPreWriteAccessibilityCandidates(IReadOnlyList providers) + { + var generatedProviders = GetGeneratedProviders(providers); + var graph = BuildGraph(generatedProviders); + var publicGraph = BuildGraph(generatedProviders, publicOnly: true); + var customPublicRoots = GetCustomCodePublicGeneratedTypeRoots(generatedProviders, graph.Nodes); + var customInternalDeclarations = GetCustomCodeInternalGeneratedTypeDeclarations(generatedProviders, graph.Nodes); + var generatedInternalDeclarations = GetGeneratedInternalTypeDeclarations(generatedProviders, graph.Nodes); + var generatedDiscriminatorBaseNames = new HashSet(StringComparer.Ordinal); + + var (internalizeCandidates, publicCandidates, _) = GetAccessibilityCandidates( + providers, + generatedProviders, + graph, + publicGraph, + customPublicRoots, + customInternalDeclarations, + generatedInternalDeclarations, + generatedDiscriminatorBaseNames); + + return (internalizeCandidates, publicCandidates, graph.Nodes); + } + + /// + /// Computes accessibility changes by traversing public signatures from explicit API roots, + /// then propagating internal boundaries and determining which reachable declarations must be public. + /// + private static (HashSet InternalizeCandidates, HashSet PublicCandidates, HashSet InternalizeHelperRoots) GetAccessibilityCandidates( + IReadOnlyList providers, + IReadOnlyList generatedProviders, + ProviderReferenceGraph graph, + ProviderReferenceGraph publicGraph, + HashSet customPublicRoots, + HashSet customInternalDeclarations, + HashSet generatedInternalDeclarations, + HashSet generatedDiscriminatorBaseNames) + { + var internalizeReferences = CloneReferences(publicGraph.References); + + // Build the public API roots and add derived-model edges that are known only after traversal. + var internalizeRoots = GetRootNames( + providers, + graph.Nodes, + helperRoots: [], + includeModelFactory: false, + includeAdditionalRoots: true, + publicClientRootsOnly: true); + + var generatedPublicReachable = GetReachableTypes(internalizeRoots, internalizeReferences); + AddDerivedModelReferences(providers, publicGraph.Nodes, internalizeReferences, generatedPublicReachable, generatedDiscriminatorBaseNames); + internalizeRoots.UnionWith(customPublicRoots); + var internalizeReachableWithoutHelpers = GetReachableTypes(internalizeRoots, internalizeReferences); + AddDerivedModelReferences(providers, publicGraph.Nodes, internalizeReferences, internalizeReachableWithoutHelpers, generatedDiscriminatorBaseNames); + internalizeReachableWithoutHelpers = GetReachableTypes(internalizeRoots, internalizeReferences); + var publicRoots = new HashSet(internalizeRoots, StringComparer.Ordinal); + var publicApiReferences = CloneReferences(publicGraph.References); + var internalizeHelperRoots = GetHelperRootNames(generatedProviders, graph.Nodes, internalizeReachableWithoutHelpers, graph.References); + internalizeRoots.UnionWith(internalizeHelperRoots); + var internalizeDeclaredNodes = GetGeneratedDeclaredNodes(generatedProviders, graph.Nodes, publicOnly: true); + var customInternalBoundaryNodes = GetCustomInternalBoundaryNodes(publicGraph, customInternalDeclarations); + var publicDeclaredNodes = GetPublicDeclaredNodes(generatedProviders, graph.Nodes); + var generatedImplementationInternalDeclarations = GetGeneratedImplementationInternalTypeDeclarations(generatedProviders, generatedInternalDeclarations); + var publicApiTraversalNodes = GetPublicApiTraversalNodes( + internalizeDeclaredNodes, + publicDeclaredNodes, + generatedInternalDeclarations, + generatedImplementationInternalDeclarations); + + // First determine everything that cannot remain public, including transitive internal-only + // dependencies and nested types whose declaring type becomes internal. + var publicReachable = GetReachableTypes(publicRoots, internalizeReferences, publicApiTraversalNodes); + var internalizeCandidates = GetInternalizeCandidates( + internalizeDeclaredNodes, + publicReachable, + customInternalDeclarations, + generatedInternalDeclarations, + customInternalBoundaryNodes, + customPublicRoots, + publicRoots, + graph.Nodes, + internalizeReferences); + AddNestedInternalizeCandidates(generatedProviders, internalizeCandidates, graph.Nodes); + AddInternalOnlyDependencyCandidates( + internalizeDeclaredNodes, + internalizeCandidates, + customInternalDeclarations, + generatedInternalDeclarations, + publicRoots, + internalizeReferences, + generatedImplementationInternalDeclarations); + RemovePublicApiExposedCandidates( + internalizeDeclaredNodes, + internalizeCandidates, + customInternalDeclarations, + internalizeReferences); + AddNestedInternalizeCandidates(generatedProviders, internalizeCandidates, graph.Nodes); + + // Recompute reachability without internalized roots, then promote only declarations that + // are still exposed by a public predecessor. + publicRoots.ExceptWith(internalizeCandidates); + publicReachable = GetReachableTypes(publicRoots, internalizeReferences, publicApiTraversalNodes); + var publicRootExclusions = GetRootNames( + providers, + graph.Nodes, + helperRoots: [], + includeModelFactory: true, + includeAdditionalRoots: true, + publicClientRootsOnly: true); + var publicCandidates = GetPublicCandidates( + publicDeclaredNodes, + publicReachable, + customInternalDeclarations, + customInternalBoundaryNodes, + internalizeHelperRoots, + publicRootExclusions, + generatedInternalDeclarations, + publicRoots, + publicApiReferences, + internalizeReferences, + generatedImplementationInternalDeclarations); + return (internalizeCandidates, publicCandidates, internalizeHelperRoots); + } + + private static ProviderReferenceGraph BuildGraph(IReadOnlyList generatedProviders, bool publicOnly = false) + { + // Each generated provider becomes a node, and provider metadata supplies the edges: + // inheritance, signatures, properties, fields, nested/serialization providers, attributes, + // and selected implementation dependencies. This avoids parsing generated C# just to + // rediscover generated-to-generated references. + var serializationProviderNamesByType = GetSerializationProviderNamesByType(generatedProviders); + IReadOnlyDictionary? serializationReferenceNamesByType = publicOnly ? null : serializationProviderNamesByType; + var nodes = new HashSet(StringComparer.Ordinal); + var references = new Dictionary>(StringComparer.Ordinal); + foreach (var provider in generatedProviders) + { + var providerName = GetProviderTypeName(provider.Type); + if (nodes.Add(providerName)) + { + references.Add(providerName, new HashSet(StringComparer.Ordinal)); + } + } + + foreach (var provider in generatedProviders) + { + var current = GetProviderTypeName(provider.Type); + var providerNamespace = provider.Type.Namespace; + AddTypeReference(references[current], provider.Type, nodes, serializationReferenceNamesByType, providerNamespace); + AddTypeReference(references[current], provider.BaseType, nodes, serializationReferenceNamesByType, providerNamespace); + AddTypeReference(references[current], provider.DeclaringTypeProvider?.Type, nodes, serializationReferenceNamesByType, providerNamespace); + + if (publicOnly && !provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) + { + continue; + } + + if (!publicOnly && IsKept(provider.Type, CodeModelGenerator.Instance.NonRootTypes, nodes)) + { + continue; + } + + // Model factory signatures mention many models, but methods for unreachable models + // are removed with those models. Only helper dependencies contribute reachability. + if (IsModelFactoryProvider(provider)) + { + continue; + } + + foreach (var implementedType in provider.Implements) + { + AddTypeReference(references[current], implementedType, nodes, serializationReferenceNamesByType, providerNamespace); + } + + if (!publicOnly) + { + foreach (var nestedType in provider.NestedTypes) + { + AddTypeReference(references[current], nestedType.Type, nodes, serializationReferenceNamesByType, providerNamespace); + } + } + + if (!publicOnly) + { + foreach (var serializationProvider in provider.SerializationProviders) + { + AddTypeReference(references[current], serializationProvider.Type, nodes, serializationReferenceNamesByType, providerNamespace); + } + } + + foreach (var signatureDependency in provider.SignatureDependencyTypes) + { + AddTypeReference(references[current], signatureDependency, nodes, serializationReferenceNamesByType, providerNamespace); + } + + foreach (var property in provider.Properties) + { + if (publicOnly && !IsPublic(property.Modifiers)) + { + continue; + } + + AddTypeReference(references[current], property.Type, nodes, serializationReferenceNamesByType, providerNamespace); + AddTypeReference(references[current], property.ExplicitInterface, nodes, serializationReferenceNamesByType, providerNamespace); + if (!publicOnly) + { + AddAttributes(references[current], property.Attributes, nodes, serializationReferenceNamesByType, includeArguments: false); + } + } + + foreach (var field in provider.Fields) + { + if (publicOnly && !field.Modifiers.HasFlag(FieldModifiers.Public)) + { + continue; + } + + AddTypeReference(references[current], field.Type, nodes, serializationReferenceNamesByType, providerNamespace); + if (!publicOnly) + { + AddAttributes(references[current], field.Attributes, nodes, serializationReferenceNamesByType, includeArguments: false); + } + } + + foreach (var constructor in provider.Constructors) + { + if (publicOnly && !IsPublic(constructor.Signature.Modifiers)) + { + continue; + } + + AddSignatureReferences(references[current], constructor.Signature, nodes, serializationReferenceNamesByType, includeAttributes: !publicOnly, includeAttributeArguments: false, providerNamespace: providerNamespace); + } + + foreach (var method in provider.Methods) + { + if (method.IsMethodSuppressed()) + { + continue; + } + + if (publicOnly && !IsPublic(method.Signature.Modifiers)) + { + continue; + } + + AddSignatureReferences(references[current], method.Signature, nodes, serializationReferenceNamesByType, includeAttributes: !publicOnly, includeAttributeArguments: false, providerNamespace: providerNamespace); + } + } + + return new ProviderReferenceGraph(nodes, references); + } + + private static Dictionary GetSerializationProviderNamesByType(IReadOnlyList generatedProviders) + { + var namesByType = new Dictionary>(StringComparer.Ordinal); + foreach (var provider in generatedProviders) + { + if (provider.SerializationProviderOwner is { } owner) + { + AddSerializationProviderName(owner.Type, provider.Type); + } + + if (provider.SerializationProviders.Count == 0) + { + continue; + } + + foreach (var serializationProvider in provider.SerializationProviders) + { + AddSerializationProviderName(provider.Type, serializationProvider.Type); + } + } + + var result = new Dictionary(StringComparer.Ordinal); + foreach (var (providerName, serializationProviderNames) in namesByType) + { + result.Add(providerName, [.. serializationProviderNames]); + } + + return result; + + void AddSerializationProviderName(CSharpType ownerType, CSharpType serializationProviderType) + { + var ownerName = GetProviderTypeName(ownerType); + if (!namesByType.TryGetValue(ownerName, out var serializationProviderNames)) + { + serializationProviderNames = new HashSet(StringComparer.Ordinal); + namesByType.Add(ownerName, serializationProviderNames); + } + + serializationProviderNames.Add(GetProviderTypeName(serializationProviderType)); + } + } + + private static bool IsPublic(MethodSignatureModifiers modifiers) => modifiers.HasFlag(MethodSignatureModifiers.Public); + private static bool IsPublic(FieldModifiers modifiers) => modifiers.HasFlag(FieldModifiers.Public); + + private static TypeSignatureModifiers MakeInternal(TypeSignatureModifiers modifiers) + => (modifiers & ~(TypeSignatureModifiers.Public | TypeSignatureModifiers.Private | TypeSignatureModifiers.Protected)) | TypeSignatureModifiers.Internal; + + private static TypeSignatureModifiers MakePublic(TypeSignatureModifiers modifiers) + => (modifiers & ~(TypeSignatureModifiers.Internal | TypeSignatureModifiers.Private | TypeSignatureModifiers.Protected)) | TypeSignatureModifiers.Public; + + private sealed record ProviderReferenceGraph( + HashSet Nodes, + Dictionary> References); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs new file mode 100644 index 00000000000..30519d304e2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Microsoft.TypeSpec.Generator +{ + internal sealed record ProviderReferenceMapResult( + HashSet InternalizeCandidates, + HashSet PublicCandidates, + HashSet RemoveCandidates, + HashSet Nodes) + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs new file mode 100644 index 00000000000..54be2cd1d43 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Microsoft.TypeSpec.Generator.Providers; + +namespace Microsoft.TypeSpec.Generator +{ + internal sealed class ProviderReferenceMapSession : IDisposable + { + private bool _disposed; + + public bool ShouldWriteProvider(TypeProvider provider) => ProviderReferenceMapAnalyzer.ShouldWriteProvider(provider); + + public void RestorePreWriteModelFactoryMethods() => ProviderReferenceMapAnalyzer.RestorePreWriteModelFactoryMethods(); + + public void Dispose() + { + if (_disposed) + { + return; + } + + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + _disposed = true; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs index 05359e3abc8..74f26fa321d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs @@ -24,7 +24,23 @@ internal static IEnumerable GetSymbols(INamespaceSymbol namespaceSy foreach (INamedTypeSymbol symbol in namespaceSymbol.GetTypeMembers()) { - yield return symbol; + foreach (var type in GetSymbols(symbol)) + { + yield return type; + } + } + } + + private static IEnumerable GetSymbols(INamedTypeSymbol typeSymbol) + { + yield return typeSymbol; + + foreach (var nestedTypeSymbol in typeSymbol.GetTypeMembers()) + { + foreach (var type in GetSymbols(nestedTypeSymbol)) + { + yield return type; + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs index a329166ee4b..00133c450df 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs @@ -22,6 +22,7 @@ public class SourceInputModel public ApiCompatBaseline ApiCompatBaseline { get; } private readonly Lazy> _nameMap; + private readonly Lazy> _customizationTypeProviders; public SourceInputModel(Compilation? customization, Compilation? lastContract) : this(customization, lastContract, ApiCompatBaseline.Empty) @@ -35,6 +36,7 @@ public SourceInputModel(Compilation? customization, Compilation? lastContract, A ApiCompatBaseline = apiCompatBaseline ?? ApiCompatBaseline.Empty; _nameMap = new(PopulateNameMap); + _customizationTypeProviders = new(PopulateCustomizationTypeProviders); } private IReadOnlyDictionary PopulateNameMap() @@ -67,32 +69,33 @@ private IReadOnlyDictionary PopulateNameMap() public TypeProvider? FindForTypeInLastContract(string ns, string name, string? declaringTypeName = null) { - return FindTypeInCompilation(LastContract, ns, name, true, declaringTypeName, includeInternal: false); + return FindTypeInCustomization(LastContract, ns, name, true, declaringTypeName, includeInternal: false); } - private TypeProvider? FindTypeInCompilation( - Compilation? compilation, - string ns, - string name, - bool includeReferencedAssemblies, - string? declaringTypeName, - bool includeInternal = true) + private IReadOnlyList PopulateCustomizationTypeProviders() { - if (compilation == null) + var providers = new List(); + if (Customization == null) { - return null; + return providers; } - string fullyQualifiedMetadataName = GetFullyQualifiedMetadataName(ns, name, declaringTypeName); - var type = FindNamedTypeSymbol(compilation, includeReferencedAssemblies, fullyQualifiedMetadataName); - if (!includeInternal && type != null && type.DeclaredAccessibility != Accessibility.Public) + foreach (IModuleSymbol module in Customization.Assembly.Modules) { - type = null; + foreach (var type in SourceInputHelper.GetSymbols(module.GlobalNamespace)) + { + if (type is INamedTypeSymbol namedTypeSymbol) + { + providers.Add(new NamedTypeSymbolProvider(namedTypeSymbol, Customization)); + } + } } - return type != null ? new NamedTypeSymbolProvider(type, compilation) : null; + return providers; } + internal IReadOnlyList CustomizationTypeProviders => _customizationTypeProviders.Value; + private static INamedTypeSymbol? FindNamedTypeSymbol(Compilation compilation, bool includeReferencedAssemblies, string fullyQualifiedMetadataName) => includeReferencedAssemblies ? compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) @@ -108,7 +111,8 @@ private static string GetFullyQualifiedMetadataName(string ns, string name, stri string ns, string name, bool includeReferencedAssemblies, - string? declaringTypeName = null) + string? declaringTypeName = null, + bool includeInternal = true) { if (compilation == null) { @@ -117,10 +121,24 @@ private static string GetFullyQualifiedMetadataName(string ns, string name, stri var fullyQualifiedMetadataName = GetFullyQualifiedMetadataName(ns, name, declaringTypeName); - // Either find by the CodeGenType attribute or by the actual type name. - if (!_nameMap.Value.TryGetValue(name, out var type)) + // Either find by the CodeGenType attribute in customization or by the actual type name. + INamedTypeSymbol? type = null; + if (ReferenceEquals(compilation, Customization) && + _nameMap.Value.TryGetValue(name, out var mappedType) && + IsContainingTypeMatch(mappedType, ns, declaringTypeName)) + { + type = mappedType; + } + + if (type == null) { type = FindNamedTypeSymbol(compilation, includeReferencedAssemblies, fullyQualifiedMetadataName); + type ??= FindNestedNamedTypeSymbol(compilation, ns, name, declaringTypeName); + } + + if (!includeInternal && type != null && type.DeclaredAccessibility != Accessibility.Public) + { + type = null; } return type != null ? new NamedTypeSymbolProvider(type, compilation) : null; @@ -150,5 +168,47 @@ private bool TryGetName(ISymbol symbol, [NotNullWhen(true)] out string? name) return name != null; } + + private static INamedTypeSymbol? FindNestedNamedTypeSymbol(Compilation compilation, string ns, string name, string? declaringTypeName) + { + if (declaringTypeName == null) + { + return null; + } + + foreach (var module in compilation.Assembly.Modules) + { + foreach (var type in SourceInputHelper.GetSymbols(module.GlobalNamespace)) + { + if (type is not INamedTypeSymbol namedTypeSymbol || + !string.Equals(namedTypeSymbol.Name, name, StringComparison.Ordinal) || + !string.Equals(GetContainingTypeName(namedTypeSymbol), declaringTypeName, StringComparison.Ordinal) || + !string.Equals(namedTypeSymbol.ContainingNamespace.ToDisplayString(), ns, StringComparison.Ordinal)) + { + continue; + } + + return namedTypeSymbol; + } + } + + return null; + } + + private static string? GetContainingTypeName(INamedTypeSymbol symbol) + { + if (symbol.ContainingType is null) + { + return null; + } + + var parentName = GetContainingTypeName(symbol.ContainingType); + return parentName is null + ? symbol.ContainingType.MetadataName + : $"{parentName}+{symbol.ContainingType.MetadataName}"; + } + + private static bool IsContainingTypeMatch(INamedTypeSymbol symbol, string ns, string? declaringTypeName) + => string.Equals(GetContainingTypeName(symbol), declaringTypeName, StringComparison.Ordinal); } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs index cfca3c2db7b..110f92af48e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs @@ -217,6 +217,8 @@ public static string EscapeLine(string s) "", "", "", + "", + "", "", "", " _optionalProvider ??= new(); + private Dictionary InputTypeToModelProvider { get; } = []; public IDictionary CSharpTypeMap { get; } = new Dictionary(CSharpType.IgnoreNullableComparer); @@ -38,8 +41,6 @@ public class TypeFactory private IReadOnlyList Visitors => CodeModelGenerator.Instance.Visitors; private Dictionary> SerializationsCache { get; } = []; - internal HashSet UnionVariantTypesToKeep { get; } = []; - protected internal TypeFactory() { } @@ -97,11 +98,6 @@ protected internal TypeFactory() if (unionInput != null) { unionInputs.Add(unionInput); - // we only keep the type if it is not framework type and not literal - if (!unionInput.IsFrameworkType && !unionInput.IsLiteral) - { - UnionVariantTypesToKeep.Add(unionInput.Name); - } } } type = CSharpType.FromUnion(unionInputs); @@ -299,15 +295,15 @@ protected virtual ModelFactoryProvider CreateModelFactoryCore(IEnumerable enumProvider, }; - if (enumType.Access == "public") - { - CodeModelGenerator.Instance.AddTypeToKeep(enumProvider); - } - EnumCache.Add(enumCacheKey, enumProvider); if (enumProvider != null) { + if (enumType.Access == "public") + { + CodeModelGenerator.Instance.AddTypeToKeep(enumProvider); + } + CSharpTypeMap[enumProvider.Type] = enumProvider; TypeProvidersByName[enumProvider.Type.Name] = enumProvider; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs index 8af371a063c..65924a3c308 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs @@ -43,6 +43,9 @@ public static bool IsSameType(this INamedTypeSymbol symbol, CSharpType type) } public static CSharpType GetCSharpType(this ITypeSymbol typeSymbol) + => GetCSharpType(typeSymbol, new HashSet(SymbolEqualityComparer.Default)); + + private static CSharpType GetCSharpType(this ITypeSymbol typeSymbol, HashSet visited) { var fullyQualifiedName = GetFullyQualifiedName(typeSymbol); var namedTypeSymbol = typeSymbol as INamedTypeSymbol; @@ -55,20 +58,20 @@ public static CSharpType GetCSharpType(this ITypeSymbol typeSymbol) if (namedTypeSymbol?.ConstructedFrom.SpecialType == SpecialType.System_Nullable_T && namedTypeSymbol.TypeArguments.Length == 1) { - var underlying = GetCSharpType(namedTypeSymbol.TypeArguments[0]); + var underlying = GetCSharpType(namedTypeSymbol.TypeArguments[0], visited); if (underlying.IsFrameworkType) { return underlying.WithNullable(true); } } - return ConstructCSharpTypeFromSymbol(typeSymbol, fullyQualifiedName, namedTypeSymbol); + return ConstructCSharpTypeFromSymbol(typeSymbol, fullyQualifiedName, namedTypeSymbol, visited); } CSharpType result = new CSharpType(type); if (namedTypeSymbol is not null && namedTypeSymbol.IsGenericType && !result.IsNullable) { - return result.MakeGenericType([.. namedTypeSymbol.TypeArguments.Select(GetCSharpType)]); + return result.MakeGenericType([.. namedTypeSymbol.TypeArguments.Select(t => GetCSharpType(t, visited))]); } return result; @@ -154,11 +157,16 @@ public static string GetFullyQualifiedName(this ITypeSymbol typeSymbol) return GetNonNullableGenericTypeName(namedTypeSymbol); } - var typeNameSpan = namedTypeSymbol.ConstructedFrom.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat).AsSpan(); - var start = typeNameSpan.IndexOf(':') + 2; - var end = typeNameSpan.IndexOf('<'); - typeNameSpan = typeNameSpan.Slice(start, end - start); - return $"{typeNameSpan}`{namedTypeSymbol.TypeArguments.Length}"; + var constructedFrom = namedTypeSymbol.ConstructedFrom; + var ns = constructedFrom.ContainingNamespace.GetFullyQualifiedNameFromDisplayString(); + var name = constructedFrom.MetadataName; + var tickIndex = name.IndexOf('`', StringComparison.Ordinal); + if (tickIndex >= 0) + { + name = name.Substring(0, tickIndex); + } + + return $"{(string.IsNullOrEmpty(ns) ? name : $"{ns}.{name}")}`{namedTypeSymbol.TypeArguments.Length}"; } } @@ -175,8 +183,14 @@ public static string GetFullyQualifiedNameFromDisplayString(this ISymbol typeSym private static CSharpType ConstructCSharpTypeFromSymbol( ITypeSymbol typeSymbol, string fullyQualifiedName, - INamedTypeSymbol? namedTypeSymbol) + INamedTypeSymbol? namedTypeSymbol, + HashSet visited) { + if (!visited.Add(typeSymbol)) + { + return ConstructShallowCSharpTypeFromSymbol(typeSymbol, fullyQualifiedName); + } + var typeArg = namedTypeSymbol?.TypeArguments.FirstOrDefault(); bool isValueType = typeSymbol.IsValueType; bool isNullable = fullyQualifiedName.StartsWith(NullableTypeName); @@ -193,7 +207,7 @@ private static CSharpType ConstructCSharpTypeFromSymbol( if (namedTypeSymbol?.IsGenericType == true && (!isNullable || (namedTypeArg?.IsGenericType == true))) { - arguments.AddRange(namedTypeSymbol.TypeArguments.Select(GetCSharpType)); + arguments.AddRange(namedTypeSymbol.TypeArguments.Select(t => GetCSharpType(t, visited))); } // handle nullables @@ -207,9 +221,9 @@ private static CSharpType ConstructCSharpTypeFromSymbol( string ns = string.Join('.', pieces.Take(pieces.Length - 1)); CSharpType? containingType = null; - if (typeSymbol.ContainingType != null) + if (typeSymbol.ContainingType != null && typeSymbol.TypeKind != TypeKind.TypeParameter) { - containingType = GetCSharpType(typeSymbol.ContainingType); + containingType = GetCSharpType(typeSymbol.ContainingType, visited); ns = string.Join('.', pieces.Take(pieces.Length - 2)); } @@ -219,10 +233,10 @@ private static CSharpType ConstructCSharpTypeFromSymbol( !isNullableUnknownType && !ContainsTypeAsArgument(typeSymbol.BaseType, typeSymbol)) { - baseType = GetCSharpType(typeSymbol.BaseType); + baseType = GetCSharpType(typeSymbol.BaseType, visited); } - return new CSharpType( + var result = new CSharpType( name, ns, isValueType, @@ -233,8 +247,25 @@ private static CSharpType ConstructCSharpTypeFromSymbol( isValueType && !isEnum, baseType: baseType, underlyingEnumType: enumUnderlyingType != null - ? GetCSharpType(enumUnderlyingType).FrameworkType + ? GetCSharpType(enumUnderlyingType, visited).FrameworkType : null); + visited.Remove(typeSymbol); + return result; + } + + private static CSharpType ConstructShallowCSharpTypeFromSymbol(ITypeSymbol typeSymbol, string fullyQualifiedName) + { + // Break recursive symbol graphs without recursively materializing arguments, bases, or containing types. + string[] pieces = fullyQualifiedName.Split('`')[0].Split('.'); + return new CSharpType( + typeSymbol.Name, + string.Join('.', pieces.Take(pieces.Length - 1)), + typeSymbol.IsValueType, + fullyQualifiedName.StartsWith(NullableTypeName), + null, + [], + typeSymbol.DeclaredAccessibility == Accessibility.Public, + typeSymbol.IsValueType && typeSymbol.TypeKind != TypeKind.Enum); } internal static bool ContainsTypeAsArgument(ITypeSymbol potentialGenericType, ITypeSymbol targetType) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs index f716aad5ab3..49b40624443 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs @@ -331,6 +331,40 @@ public async Task SerializationProviderConstructorIsFilteredWhenMatchingCustomCo Assert.AreEqual(0, serializationProvider.Constructors.Count, "Serialization provider constructor should be filtered when matching custom code"); } + [Test] + public async Task NestedProviderConstructorIsFilteredWhenMatchingCustomCode() + { + var typeProvider = new TestTypeProvider(ns: "Sample"); + var customNestedProvider = new TestConstructorTypeProvider("NestedType", "Sample"); + customNestedProvider.ConstructorProviders = + [ + new ConstructorProvider( + new ConstructorSignature(customNestedProvider.Type, $"", MethodSignatureModifiers.Public, [new ParameterProvider("param1", $"", typeof(string))]), + Snippet.Throw(Snippet.Null), customNestedProvider) + ]; + var nestedProvider = new TestConstructorTypeProvider("NestedType", "Sample", typeProvider, customNestedProvider); + var constructor = new ConstructorProvider( + new ConstructorSignature(nestedProvider.Type, $"", MethodSignatureModifiers.Public, [new ParameterProvider("param1", $"", typeof(string))]), + Snippet.Throw(Snippet.Null), nestedProvider); + nestedProvider.ConstructorProviders = [constructor]; + typeProvider.NestedTypesInternal = [nestedProvider]; + + var generator = await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(typeProvider)); + + foreach (var type in generator.Object.OutputLibrary.TypeProviders) + { + type.EnsureBuilt(); + } + + Assert.AreEqual(1, nestedProvider.Constructors.Count, "Nested provider should have 1 constructor before filtering"); + Assert.IsNotNull(nestedProvider.CustomCodeView, "Nested provider custom code view should be found"); + + CSharpGen.FilterAllCustomizedMembers(generator.Object.OutputLibrary); + + Assert.AreEqual(0, nestedProvider.Constructors.Count, "Nested provider constructor should be filtered when matching custom code"); + } + [Test] public async Task MatchingPropertyIsFilteredAfterVisitorMutation() { @@ -520,5 +554,34 @@ private class TestSerializationTypeProvider : TypeProvider protected override string BuildNamespace() => "Test"; protected internal override ConstructorProvider[] BuildConstructors() => ConstructorProviders; } + + private class TestConstructorTypeProvider : TypeProvider + { + private readonly string _name; + private readonly string _namespace; + private readonly TypeProvider? _declaringTypeProvider; + + public TestConstructorTypeProvider(string name, string @namespace, TypeProvider? declaringTypeProvider = null) + : this(name, @namespace, declaringTypeProvider, customCodeView: null) + { + } + + public TestConstructorTypeProvider(string name, string @namespace, TypeProvider? declaringTypeProvider, TypeProvider? customCodeView) + { + _name = name; + _namespace = @namespace; + _declaringTypeProvider = declaringTypeProvider; + _customCodeView = customCodeView; + } + + private readonly TypeProvider? _customCodeView; + public ConstructorProvider[] ConstructorProviders { get; set; } = []; + protected override string BuildRelativeFilePath() => $"{Name}.cs"; + protected override string BuildName() => _name; + protected override string BuildNamespace() => _namespace; + protected override TypeProvider? BuildDeclaringTypeProvider() => _declaringTypeProvider; + private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; + protected internal override ConstructorProvider[] BuildConstructors() => ConstructorProviders; + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs deleted file mode 100644 index 28981148a4d..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.TypeSpec.Generator.Tests.Common; -using NUnit.Framework; - -namespace Microsoft.TypeSpec.Generator.Tests.PostProcessing -{ - public class PostProcessorTests - { - [Test] - public async Task RemovesInvalidUsings() - { - MockHelpers.LoadMockGenerator(); - var workspace = new AdhocWorkspace(); - var projectInfo = ProjectInfo.Create( - ProjectId.CreateNewId(), - VersionStamp.Create(), - name: "TestProj", - assemblyName: "TestProj", - language: LanguageNames.CSharp) - .WithMetadataReferences(new[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location) - }); - - var project = workspace.AddProject(projectInfo); - var folder = Helpers.GetAssetFileOrDirectoryPath(false); - project = project.AddDocument( - "RemovesInvalidUsings.cs", - File.ReadAllText(Path.Join(folder, "RemovesInvalidUsings.cs"))).Project; - project = project.AddDocument( - "Model.cs", - File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; - var postProcessor = new TestPostProcessor("RemovesInvalidUsings.cs"); - - var resultProject = await postProcessor.RemoveAsync(project); - var doc= resultProject.Documents - .Single(d => d.Name == "RemovesInvalidUsings.cs"); - var root = await doc.GetSyntaxRootAsync(); - var compilation = (CompilationUnitSyntax)root!; - - var typeNames = compilation - .DescendantNodes() - .OfType() - .Select(t => t.Identifier.Text) - .ToList(); - CollectionAssert.Contains(typeNames, "KeepMe"); - - var usings = compilation.Usings.Select(u => u.Name!.ToString()).ToList(); - // The invalid using should be removed - CollectionAssert.DoesNotContain(usings, "Sample.Models"); - CollectionAssert.Contains(usings, "System"); - } - - - [Test] - public async Task DoesNotRemoveValidUsings() - { - MockHelpers.LoadMockGenerator(); - var workspace = new AdhocWorkspace(); - var projectInfo = ProjectInfo.Create( - ProjectId.CreateNewId(), - VersionStamp.Create(), - name: "TestProj", - assemblyName: "TestProj", - language: LanguageNames.CSharp) - .WithMetadataReferences(new[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location) - }); - - var project = workspace.AddProject(projectInfo); - var folder = Helpers.GetAssetFileOrDirectoryPath(false); - project = project.AddDocument( - "DoesNotRemoveValidUsings.cs", - File.ReadAllText(Path.Join(folder, "DoesNotRemoveValidUsings.cs"))).Project; - project = project.AddDocument( - "Model.cs", - File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; - var postProcessor = new TestPostProcessor("DoesNotRemoveValidUsings.cs"); - - var resultProject = await postProcessor.RemoveAsync(project); - var doc= resultProject.Documents - .Single(d => d.Name == "DoesNotRemoveValidUsings.cs"); - var root = await doc.GetSyntaxRootAsync(); - var compilation = (CompilationUnitSyntax)root!; - - var typeNames = compilation - .DescendantNodes() - .OfType() - .Select(t => t.Identifier.Text) - .ToList(); - CollectionAssert.Contains(typeNames, "KeepMe"); - - var usings = compilation.Usings.Select(u => u.Name!.ToString()).ToList(); - CollectionAssert.Contains(usings, "Sample.Models"); - CollectionAssert.Contains(usings, "System"); - } - - [Test] - public async Task RemovesInvalidAttributes() - { - MockHelpers.LoadMockGenerator(); - var workspace = new AdhocWorkspace(); - var projectInfo = ProjectInfo.Create( - ProjectId.CreateNewId(), - VersionStamp.Create(), - name: "TestProj", - assemblyName: "TestProj", - language: LanguageNames.CSharp) - .WithMetadataReferences(new[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) - }); - - var project = workspace.AddProject(projectInfo); - var folder = Helpers.GetAssetFileOrDirectoryPath(false); - const string removesInvalidAttributesFileName = "RemovesInvalidAttributes.cs"; - project = project.AddDocument( - removesInvalidAttributesFileName, - File.ReadAllText(Path.Join(folder, removesInvalidAttributesFileName))).Project; - project = project.AddDocument( - "Model.cs", - File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; - project = project.AddDocument( - "RootClass.cs", - File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; - var postProcessor = new TestPostProcessor("RootClass.cs", nonRootTypes: ["Sample.KeepMe"]); - - var resultProject = await postProcessor.RemoveAsync(project); - var doc= resultProject.Documents - .Single(d => d.Name == removesInvalidAttributesFileName); - var root = await doc.GetSyntaxRootAsync(); - var compilation = (CompilationUnitSyntax)root!; - - var namespaceDeclaration = compilation - .DescendantNodes() - .OfType() - .SingleOrDefault(t => t.Name.ToString() == "Sample"); - var output = namespaceDeclaration!.ToString(); - - Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); - } - - [Test] - public async Task RemovesInvalidAttributesAndKeepsValidAttributes() - { - MockHelpers.LoadMockGenerator(); - var workspace = new AdhocWorkspace(); - var projectInfo = ProjectInfo.Create( - ProjectId.CreateNewId(), - VersionStamp.Create(), - name: "TestProj", - assemblyName: "TestProj", - language: LanguageNames.CSharp) - .WithMetadataReferences(new[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) - }); - - var project = workspace.AddProject(projectInfo); - var folder = Helpers.GetAssetFileOrDirectoryPath(false); - const string removesInvalidAttributesFileName = "RemovesInvalidAttributesAndKeepsValidAttributes.cs"; - project = project.AddDocument( - removesInvalidAttributesFileName, - File.ReadAllText(Path.Join(folder, removesInvalidAttributesFileName))).Project; - project = project.AddDocument( - "Model.cs", - File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; - project = project.AddDocument( - "RootClass.cs", - File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; - var postProcessor = new TestPostProcessor("RootClass.cs", nonRootTypes: ["Sample.KeepMe"]); - - var resultProject = await postProcessor.RemoveAsync(project); - var doc= resultProject.Documents - .Single(d => d.Name == removesInvalidAttributesFileName); - var root = await doc.GetSyntaxRootAsync(); - var compilation = (CompilationUnitSyntax)root!; - - var namespaceDeclaration = compilation - .DescendantNodes() - .OfType() - .SingleOrDefault(t => t.Name.ToString() == "Sample"); - var output = namespaceDeclaration!.ToString(); - - Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); - } - - [Test] - public async Task RemovesInvalidAttributesAndKeepsValidAttributesNoDocs() - { - MockHelpers.LoadMockGenerator(); - var workspace = new AdhocWorkspace(); - var projectInfo = ProjectInfo.Create( - ProjectId.CreateNewId(), - VersionStamp.Create(), - name: "TestProj", - assemblyName: "TestProj", - language: LanguageNames.CSharp) - .WithMetadataReferences(new[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) - }); - - var project = workspace.AddProject(projectInfo); - var folder = Helpers.GetAssetFileOrDirectoryPath(false); - const string removesInvalidAttributesFileName = "RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs"; - project = project.AddDocument( - removesInvalidAttributesFileName, - File.ReadAllText(Path.Join(folder, removesInvalidAttributesFileName))).Project; - project = project.AddDocument( - "Model.cs", - File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; - project = project.AddDocument( - "RootClass.cs", - File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; - var postProcessor = new TestPostProcessor("RootClass.cs", nonRootTypes: ["Sample.KeepMe"]); - - var resultProject = await postProcessor.RemoveAsync(project); - var doc= resultProject.Documents - .Single(d => d.Name == removesInvalidAttributesFileName); - var root = await doc.GetSyntaxRootAsync(); - var compilation = (CompilationUnitSyntax)root!; - - var namespaceDeclaration = compilation - .DescendantNodes() - .OfType() - .SingleOrDefault(t => t.Name.ToString() == "Sample"); - var output = namespaceDeclaration!.ToString(); - - Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); - } - - [Test] - public async Task DoesNotRemoveValidAttributes() - { - MockHelpers.LoadMockGenerator(); - var workspace = new AdhocWorkspace(); - var projectInfo = ProjectInfo.Create( - ProjectId.CreateNewId(), - VersionStamp.Create(), - name: "TestProj", - assemblyName: "TestProj", - language: LanguageNames.CSharp) - .WithMetadataReferences(new[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) - }); - - var project = workspace.AddProject(projectInfo); - var folder = Helpers.GetAssetFileOrDirectoryPath(false); - const string doesNotRemoveValidAttributesFileName = "DoesNotRemoveValidAttributes.cs"; - project = project.AddDocument( - doesNotRemoveValidAttributesFileName, - File.ReadAllText(Path.Join(folder, doesNotRemoveValidAttributesFileName))).Project; - project = project.AddDocument( - "Model.cs", - File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; - project = project.AddDocument( - "RootClass.cs", - File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; - var postProcessor = new TestPostProcessor("RootClass.cs"); - - var resultProject = await postProcessor.RemoveAsync(project); - var doc= resultProject.Documents - .Single(d => d.Name == doesNotRemoveValidAttributesFileName); - var root = await doc.GetSyntaxRootAsync(); - var compilation = (CompilationUnitSyntax)root!; - - var namespaceDeclaration = compilation - .DescendantNodes() - .OfType() - .SingleOrDefault(t => t.Name.ToString() == "Sample"); - var output = namespaceDeclaration!.ToString(); - - Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); - } - - private class TestPostProcessor : PostProcessor - { - private readonly string _rootFile; - - public TestPostProcessor(string rootFile, IEnumerable? nonRootTypes = null) : base([], additionalNonRootTypeNames: nonRootTypes) - { - _rootFile = rootFile; - } - - protected override Task IsRootDocument(Document document) - { - return document.Name == _rootFile ? Task.FromResult(true) : Task.FromResult(false); - } - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs deleted file mode 100644 index 0ee90baa775..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Sample -{ - /// - /// Class docs that should be kept. - /// - [ModelReaderWriterBuildable(typeof(Model))] - public class KeepMe - { - public void Foo() => Console.WriteLine(""hello""); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs deleted file mode 100644 index e44051470ab..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ClientModel.Primitives; -using Sample.Models; - -namespace Sample -{ - /// - /// Class docs that should be kept. - /// - [ModelReaderWriterBuildable(typeof(Model))] - public class KeepMe - { - public void Foo() => Console.WriteLine(""hello""); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs deleted file mode 100644 index 20f76bb882a..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public class Model - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs deleted file mode 100644 index b799f680532..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Sample -{ - public class RootClass - { - public void Foo() => (new KeepMe()).Foo(); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs deleted file mode 100644 index ba2ed5a94b2..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using Sample.Models; - -namespace Sample -{ - public class KeepMe - { - public Model Foo() => new Model(); - } -} -"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs deleted file mode 100644 index 20f76bb882a..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public class Model - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs deleted file mode 100644 index 11498989c01..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Sample -{ - /// - /// Class docs that should be kept. - /// - public class KeepMe - { - public void Foo() => Console.WriteLine(""hello""); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs deleted file mode 100644 index 20f76bb882a..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public class Model - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs deleted file mode 100644 index e44051470ab..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ClientModel.Primitives; -using Sample.Models; - -namespace Sample -{ - /// - /// Class docs that should be kept. - /// - [ModelReaderWriterBuildable(typeof(Model))] - public class KeepMe - { - public void Foo() => Console.WriteLine(""hello""); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs deleted file mode 100644 index b799f680532..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Sample -{ - public class RootClass - { - public void Foo() => (new KeepMe()).Foo(); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs deleted file mode 100644 index a0eda596240..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Sample -{ - /// - /// Class docs that should be kept. - /// - [ModelReaderWriterBuildable(typeof(object))] - public class KeepMe - { - public void Foo() => Console.WriteLine("hello"); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs deleted file mode 100644 index 20f76bb882a..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public class Model - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs deleted file mode 100644 index afa5fb8d462..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.ClientModel.Primitives; -using Sample.Models; - -namespace Sample -{ - /// - /// Class docs that should be kept. - /// - [ModelReaderWriterBuildable(typeof(Model))] - [ModelReaderWriterBuildable(typeof(object))] - public class KeepMe - { - public void Foo() => Console.WriteLine("hello"); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs deleted file mode 100644 index b799f680532..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Sample -{ - public class RootClass - { - public void Foo() => (new KeepMe()).Foo(); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs deleted file mode 100644 index 4ffad5d191e..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Sample -{ - [ModelReaderWriterBuildable(typeof(object))] - public class KeepMe - { - public void Foo() => Console.WriteLine("hello"); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs deleted file mode 100644 index 20f76bb882a..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public class Model - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs deleted file mode 100644 index 1b99245b052..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.ClientModel.Primitives; -using Sample.Models; - -namespace Sample -{ - [ModelReaderWriterBuildable(typeof(Model))] - [ModelReaderWriterBuildable(typeof(object))] - public class KeepMe - { - public void Foo() => Console.WriteLine("hello"); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs deleted file mode 100644 index b799f680532..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Sample -{ - public class RootClass - { - public void Foo() => (new KeepMe()).Foo(); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs deleted file mode 100644 index 20f76bb882a..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public class Model - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs deleted file mode 100644 index c8e295f4ef6..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using Sample.Models; // initially valid - -namespace Sample -{ - public class KeepMe - { - public void Foo() => Console.WriteLine(""hello""); - } -} -"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs index fe18ff059a3..6f5eb048ce4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs @@ -333,7 +333,7 @@ public void ExtensibleFloatEnum_HasOnlyNonNullableImplicitOperator() } [Test] - public void PublicModelsAreIncludedInAdditionalRootTypes() + public void PublicEnumsAreIncludedInAdditionalRootTypes() { var inputEnum = InputFactory.StringEnum( "StringEnum", @@ -348,6 +348,11 @@ public void PublicModelsAreIncludedInAdditionalRootTypes() var rootTypes = CodeModelGenerator.Instance.AdditionalRootTypes; Assert.IsTrue(rootTypes.Contains("Sample.Models.StringEnum")); + + using var session = ProviderReferenceMapAnalyzer.PrepareForGeneration( + CodeModelGenerator.Instance.OutputLibrary.TypeProviders.ToList()); + Assert.IsTrue(enumProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(enumProvider)); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs index 1bdf4020167..c35f1968d76 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs @@ -177,6 +177,32 @@ public async Task OmitsModelFactoryMethodIfParamTypeInternal() Assert.IsNull(modelFactory); } + // This test validates that a derived model customized to be internal does not get a + // public model factory method just because its base model remains public. + [Test] + public async Task OmitsModelFactoryMethodIfDerivedModelTypeInternal() + { + var baseModel = InputFactory.Model( + "baseModel", + properties: [InputFactory.Property("BaseProp", InputPrimitiveType.String)]); + var derivedModel = InputFactory.Model( + "derivedModel", + properties: [InputFactory.Property("DerivedProp", InputPrimitiveType.String)], + baseModel: baseModel); + + var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( + inputModelTypes: [baseModel, derivedModel], + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + var csharpGen = new CSharpGen(); + + await csharpGen.ExecuteAsync(); + + var modelFactory = mockGenerator.Object.OutputLibrary.TypeProviders.SingleOrDefault(t => t is ModelFactoryProvider); + Assert.IsNotNull(modelFactory); + CollectionAssert.Contains(modelFactory!.Methods.Select(m => m.Signature.Name), "BaseModel"); + CollectionAssert.DoesNotContain(modelFactory.Methods.Select(m => m.Signature.Name), "DerivedModel"); + } + [TestCase(true)] [TestCase(false)] public async Task CanCustomizeModelFullConstructor(bool extraParameters) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs new file mode 100644 index 00000000000..bdb2034f5f0 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Sample.Models +{ + internal partial class DerivedModel + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs index 7f3ea5cd1ff..d96e98a9d8e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs @@ -405,7 +405,7 @@ private class ClientTypeProvider : TypeProvider public MethodProvider[] MethodProviders { get; set; } = []; public ConstructorProvider[] ConstructorProviders { get; set; } = []; - protected override string BuildRelativeFilePath() => "."; + protected override string BuildRelativeFilePath() => $"{Name}.cs"; protected override string BuildName() => "MockInputClient"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs index 9f9945a2360..336318f812a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs @@ -1538,6 +1538,11 @@ public void PublicModelsAreIncludedInAdditionalRootTypes() var rootTypes = CodeModelGenerator.Instance.AdditionalRootTypes; Assert.IsTrue(rootTypes.Contains("Sample.Models.MockInputModel")); + + using var session = ProviderReferenceMapAnalyzer.PrepareForGeneration( + CodeModelGenerator.Instance.OutputLibrary.TypeProviders.ToList()); + Assert.IsTrue(modelProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(modelProvider)); } [Test] @@ -1577,12 +1582,11 @@ public void KeepSetsReflectTypeProvidersAddedAfterFirstAccess() // Regression test for two complementary fixes: // - // 1. ModelProvider no longer registers itself with AddTypeToKeep from its constructor; - // registration is performed by TypeFactory.CreateModel after construction completes. - // This mirrors the EnumProvider lifecycle and prevents a virtual call chain - // (AddTypeToKeep -> TypeProvider.Type -> BaseType -> virtual BuildBaseType()) from - // being dispatched on a partially-constructed derived ModelProvider whose override - // reads derived-class fields that are still uninitialized. + // 1. ModelProvider no longer registers itself with AddTypeToKeep from its constructor, + // so construction does not dispatch a virtual call chain + // (AddTypeToKeep -> TypeProvider.Type -> BaseType -> virtual BuildBaseType()) on a + // partially-constructed derived ModelProvider whose override reads derived-class fields + // that are still uninitialized. // // 2. AddTypeToKeep(TypeProvider) defers FQN resolution until the keep set is consumed, // so even ctor-time callers cannot force premature TypeProvider.Type evaluation. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs index 9ceee883bd4..2310e2ea7b6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs @@ -6,9 +6,11 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.TypeSpec.Generator.Expressions; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.SourceInput; using Microsoft.TypeSpec.Generator.Tests.Common; using NUnit.Framework; using static Microsoft.TypeSpec.Generator.Snippets.Snippet; @@ -93,6 +95,31 @@ public async Task ValidateSelfReferentialGenericBaseType() Assert.IsNull(namedTypeSymbolProvider.Type.BaseType); } + [Test] + public void ValidateGenericTypeAndMethodArguments() + { + var compilation = CSharpCompilation.Create( + "Customization", + [CSharpSyntaxTree.ParseText(""" + namespace Sample + { + public class GenericType + { + public TMethod Convert(TType value, TMethod fallback) => fallback; + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var symbol = compilation.GetTypeByMetadataName("Sample.GenericType`1"); + Assert.IsNotNull(symbol); + + var provider = new NamedTypeSymbolProvider(symbol!, compilation); + var method = provider.Methods.Single(method => method.Signature.Name == "Convert"); + + Assert.AreEqual("TType", provider.Type.Arguments.Single().Name); + Assert.AreEqual("TMethod", method.Signature.GenericArguments!.Single().Name); + } + [Test] public void ValidateNamespaceNestedType() { @@ -370,6 +397,68 @@ public async Task ValidatePartialMethodWithBodyIsNotDetectedAsPartialDeclaration Assert.IsFalse(doIt.IsPartialMethod, "Partial methods with bodies should not be treated as customization signals."); } + [Test] + public async Task BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "CustomClient")!; + var provider = new NamedTypeSymbolProvider(symbol, compilation); + + Assert.IsTrue(provider.BodyDependencyTypes.Any(type => type.FullyQualifiedName == "Sample.Models.ReferencedModel")); + } + + [Test] + public async Task PublicInterfaceMemberSignatureDependenciesAreIncluded() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "ICustomApi")!; + var provider = new NamedTypeSymbolProvider(symbol, compilation); + + Assert.IsTrue(provider.SignatureDependencyTypes.Any(type => type.FullyQualifiedName == "Sample.Models.GeneratedModel")); + } + + [Test] + public async Task PublicNestedMemberSignatureDependenciesAreIncluded() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "CustomApi")!; + var provider = new NamedTypeSymbolProvider(symbol, compilation); + + Assert.IsTrue(provider.SignatureDependencyTypes.Any(type => type.FullyQualifiedName == "Sample.Models.GeneratedModel")); + } + + [Test] + public async Task SourceInputHelperYieldsNestedSymbols() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + + var symbols = Microsoft.TypeSpec.Generator.SourceInput.SourceInputHelper.GetSymbols(compilation.Assembly.Modules.First().GlobalNamespace); + + Assert.IsTrue(symbols.Any(symbol => symbol.MetadataName == "Nested")); + } + + [Test] + public async Task SourceInputLookupUsesFullNestedDeclaringTypeName() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + var sourceInputModel = new SourceInputModel(compilation, lastContract: null); + + var nestedType = sourceInputModel.FindForTypeInCustomization("Sample", "Target", "Outer+Middle"); + + Assert.IsNotNull(nestedType); + Assert.AreEqual("Sample.Outer+Middle+Target", ((NamedTypeSymbolProvider)nestedType!).MetadataName); + } + + [Test] + public async Task MetadataNamePreservesGenericArity() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "CustomModel`1")!; + var provider = new NamedTypeSymbolProvider(symbol, compilation); + + Assert.AreEqual("Sample.Models.CustomModel`1", provider.MetadataName); + } + // Operator signatures parsed from a customization partial must compare equal to the corresponding generated signatures. [Test] public async Task ValidateOperatorSignaturesMatchGenerated() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs new file mode 100644 index 00000000000..01ad16aa4ac --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs @@ -0,0 +1,12 @@ +using Sample.Models; + +namespace Sample +{ + public partial class CustomClient + { + public void Test(object response) + { + ReferencedModel result = (ReferencedModel)response; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs new file mode 100644 index 00000000000..0499f0d3f56 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public partial class CustomModel + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs new file mode 100644 index 00000000000..61c46fefacf --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs @@ -0,0 +1,9 @@ +using Sample.Models; + +namespace Sample +{ + public partial interface ICustomApi + { + GeneratedModel Item { get; } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs new file mode 100644 index 00000000000..bee92bb5c88 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs @@ -0,0 +1,12 @@ +using Sample.Models; + +namespace Sample +{ + public partial class CustomApi + { + public class Nested + { + public GeneratedModel Item { get; } + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs new file mode 100644 index 00000000000..7116cc92bfe --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs @@ -0,0 +1,9 @@ +namespace Sample +{ + public partial class CustomApi + { + public class Nested + { + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs new file mode 100644 index 00000000000..8e4353bc359 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs @@ -0,0 +1,19 @@ +namespace Sample +{ + public partial class Outer + { + public partial class Middle + { + public class Target + { + } + } + } + + public partial class Other + { + public class Target + { + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs index 34e119f008a..c55dc7aadab 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs @@ -900,7 +900,7 @@ public void TestCanUpdateAttributes() new MethodSignature("TestMethod", $"", MethodSignatureModifiers.Public, null, $"", []), Snippet.Throw(Snippet.Null), new TestTypeProvider())]); typeProvider.Update(attributes: [ - new(typeof(ObsoleteAttribute)) + new AttributeStatement(typeof(ObsoleteAttribute)) ]); Assert.IsNotNull(typeProvider.Attributes); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs new file mode 100644 index 00000000000..945f24e2d9f --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs @@ -0,0 +1,1464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.TypeSpec.Generator.Expressions; +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; +using Microsoft.TypeSpec.Generator.Providers; +using Microsoft.TypeSpec.Generator.Tests.Common; +using Microsoft.TypeSpec.Generator.Statements; +using Microsoft.TypeSpec.Generator.Tests.Providers.NamedTypeSymbolProviders; +using Microsoft.TypeSpec.Generator.Tests.TestHelpers; +using NUnit.Framework; +using static Microsoft.TypeSpec.Generator.Snippets.Snippet; + +namespace Microsoft.TypeSpec.Generator.Tests.ReferenceMap +{ + public class ProviderReferenceMapAnalyzerTests + { + [SetUp] + public void SetUp() + { + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + } + + [TearDown] + public void TearDown() + { + ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); + } + + [Test] + public void NonRootKeptTypesKeepTheirAccessibility() + { + var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(context)); + CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([context]); + + Assert.IsTrue(context.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(context.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public void NonRootKeptTypesAreWrittenWithoutRootingOtherTypes() + { + var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); + var unusedModel = new TestTypeProvider("UnusedModel", TypeSignatureModifiers.Public); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(context, unusedModel)); + CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.Analyze([context, unusedModel]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(context)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(unusedModel)); + } + + [Test] + public void ProviderNamedClientProviderIsNotTreatedAsClientWithoutCapability() + { + var sameNamedProvider = new ClientProvider(); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(sameNamedProvider)); + + ProviderReferenceMapAnalyzer.Analyze([sameNamedProvider]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(sameNamedProvider)); + } + + [Test] + public void RootedTypeWithInternalPartialDeclarationRemainsPublic() + { + var model = new ModelProvider(InputFactory.Model("PublicModel", "Sample.Models", access: "public")); + var internalPartial = new TestTypeProvider( + "PublicModel", + TypeSignatureModifiers.Internal | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class, + ns: "Sample.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(model, internalPartial)); + CodeModelGenerator.Instance.AddTypeToKeep(model); + + using var session = ProviderReferenceMapAnalyzer.PrepareForGeneration([model, internalPartial]); + + Assert.IsTrue(model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void AmbiguousNamespaceLessCustomCodeBodyDependencyDoesNotRootGeneratedTypeBySimpleName() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", CreateNamedType("Error", string.Empty)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var generatedError = new TestTypeProvider("Error", TypeSignatureModifiers.Public, ns: "Sample.Models"); + var otherGeneratedError = new TestTypeProvider("Error", TypeSignatureModifiers.Public, ns: "Other.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedError, otherGeneratedError)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, generatedError, otherGeneratedError]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedError)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(otherGeneratedError)); + } + + [Test] + public void NamespaceLessCustomCodeBodyDependencyRootsGeneratedTypeInCustomCodeNamespace() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("ReferencedModel", string.Empty)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var referencedModel = new TestTypeProvider("ReferencedModel", TypeSignatureModifiers.Public, ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, referencedModel)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, referencedModel]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(referencedModel)); + } + + [Test] + public void NamespaceLessCustomCodeBodyDependencyRootsGeneratedTypeInParentNamespace() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample.Child", CreateNamedType("ReferencedModel", string.Empty)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample.Child"); + var referencedModel = new TestTypeProvider("ReferencedModel", TypeSignatureModifiers.Public, ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, referencedModel)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, referencedModel]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(referencedModel)); + } + + [Test] + public void NamespaceLessCustomCodeGenericBodyDependencyRootsGeneratedTypeInCustomCodeNamespace() + { + var genericArgument = CreateNamedType("T", string.Empty); + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("ErrorResult", string.Empty, genericArgument)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var errorResult = new GenericTestTypeProvider("ErrorResult", TypeSignatureModifiers.Internal, "Sample", genericArgument); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, errorResult)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, errorResult]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(errorResult)); + } + + [Test] + public void NamespaceLessGeneratedGenericBodyDependencyRootsGeneratedTypeInProviderNamespace() + { + var genericArgument = CreateNamedType("T", string.Empty); + var provider = new BodyDependencyTestTypeProvider("ClientPipelineExtensions", "Sample", CreateNamedType("ErrorResult", "Microsoft.TypeSpec.Generator.ClientModel.Providers", genericArgument)); + var errorResult = new GenericTestTypeProvider("ErrorResult", TypeSignatureModifiers.Internal, "Sample", genericArgument); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(provider, errorResult)); + CodeModelGenerator.Instance.AddTypeToKeep(provider.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([provider, errorResult]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(provider)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(errorResult)); + } + + [Test] + public void UnionVariantPropertyReferenceOnlyMatchesFullyQualifiedModelName() + { + var keptVariant = new ModelProvider(InputFactory.Model("Variant", "Sample")); + var collidingVariant = new ModelProvider(InputFactory.Model("Variant", "Other")); + var client = new ClientTestTypeProvider("SampleClient", "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, keptVariant, collidingVariant)); + client.Update(properties: + [ + new PropertyProvider( + $"", + MethodSignatureModifiers.Public, + CSharpType.FromUnion([keptVariant.Type, typeof(string)]), + "Value", + new AutoPropertyBody(false), + client) + ]); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, keptVariant, collidingVariant]); + + Assert.IsTrue(keptVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(collidingVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void UnionVariantEnumRemainsPublicWhenReferencedByPublicProperty() + { + var inputEnum = InputFactory.StringEnum( + "Variant", + [("One", "one")], + access: null!, + clientNamespace: "Sample"); + MockHelpers.LoadMockGenerator(inputEnumTypes: [inputEnum]); + var variant = CodeModelGenerator.Instance.OutputLibrary.TypeProviders + .OfType() + .Single(provider => provider.Name == "Variant"); + var client = new ClientTestTypeProvider("SampleClient", "Sample"); + client.Update(properties: + [ + new PropertyProvider( + $"", + MethodSignatureModifiers.Public, + CSharpType.FromUnion([variant.Type, typeof(string)]), + "Value", + new AutoPropertyBody(false), + client) + ]); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, variant]); + + Assert.IsTrue(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public void DisconnectedUnionVariantIsNotPublicRoot() + { + var inputVariant = InputFactory.Model("Variant", "Sample", access: null!); + var variant = new ModelProvider(inputVariant); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(variant)); + CodeModelGenerator.Instance.TypeFactory.CreateCSharpType( + InputFactory.Union([inputVariant, InputPrimitiveType.String])); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([variant]); + + Assert.IsTrue(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void KnownDiscriminatorVariantRemainsPublicWhenBaseIsRooted() + { + var discriminator = InputFactory.Property( + "kind", + InputPrimitiveType.String, + isRequired: true, + isDiscriminator: true); + var derivedInput = InputFactory.Model( + "KnownVariant", + "Sample", + access: null!, + discriminatedKind: "known"); + var baseInput = InputFactory.Model( + "BaseModel", + "Sample", + access: null!, + properties: [discriminator], + derivedModels: [derivedInput], + discriminatorProperty: discriminator); + MockHelpers.LoadMockGenerator(inputModelTypes: [baseInput, derivedInput]); + var providers = CodeModelGenerator.Instance.OutputLibrary.TypeProviders; + var baseProvider = providers.OfType().Single(provider => provider.Name == "BaseModel"); + var derivedProvider = providers.OfType().Single(provider => provider.Name == "KnownVariant"); + CodeModelGenerator.Instance.AddTypeToKeep(baseProvider); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(providers); + + Assert.IsTrue(baseProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(derivedProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void DisconnectedKnownDiscriminatorVariantIsNotPublicRoot() + { + var discriminator = InputFactory.Property( + "kind", + InputPrimitiveType.String, + isRequired: true, + isDiscriminator: true); + var derivedInput = InputFactory.Model( + "KnownVariant", + "Sample", + access: null!, + discriminatedKind: "known"); + var baseInput = InputFactory.Model( + "BaseModel", + "Sample", + access: null!, + properties: [discriminator], + derivedModels: [derivedInput], + discriminatorProperty: discriminator); + MockHelpers.LoadMockGenerator(inputModelTypes: [baseInput, derivedInput]); + var providers = CodeModelGenerator.Instance.OutputLibrary.TypeProviders; + var baseProvider = providers.OfType().Single(provider => provider.Name == "BaseModel"); + var derivedProvider = providers.OfType().Single(provider => provider.Name == "KnownVariant"); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(providers); + + Assert.IsTrue(baseProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(derivedProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public void CollectionUnionVariantPropertyReferenceOnlyMatchesFullyQualifiedModelName() + { + var keptVariant = new ModelProvider(InputFactory.Model("Variant", "Sample")); + var collidingVariant = new ModelProvider(InputFactory.Model("Variant", "Other")); + var client = new ClientTestTypeProvider("SampleClient", "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, keptVariant, collidingVariant)); + client.Update(properties: + [ + new PropertyProvider( + $"", + MethodSignatureModifiers.Public, + new CSharpType(typeof(IList<>), CSharpType.FromUnion([keptVariant.Type, typeof(string)])), + "Values", + new AutoPropertyBody(false), + client) + ]); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, keptVariant, collidingVariant]); + + Assert.IsTrue(keptVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(collidingVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void QualifiedExternalBuildableTypeDoesNotMatchRemovedGeneratedTypeBySimpleName() + { + var generatedFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Sample"); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => new TestOutputLibrary(generatedFoo), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + + ProviderReferenceMapAnalyzer.Analyze([generatedFoo]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedFoo)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.IsResolvableBuildableType(CreateNamedType("Foo", "Contoso"))); + Assert.IsFalse(ProviderReferenceMapAnalyzer.IsResolvableBuildableType(CreateNamedType("Foo", string.Empty))); + } + + [Test] + public void AmbiguousUnqualifiedBuildableTypeDoesNotMatchRemovedProviderBySimpleName() + { + var keptFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Kept"); + var removedFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Removed"); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => new TestOutputLibrary(removedFoo, keptFoo), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + CodeModelGenerator.Instance.AddTypeToKeep(keptFoo.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([keptFoo, removedFoo]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(keptFoo)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedFoo)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.IsResolvableBuildableType(CreateNamedType("Foo", string.Empty))); + } + + [Test] + public void UnqualifiedGenericBuildableTypeUsesArityWhenMatchingRemovedProvider() + { + var genericArgument = CreateNamedType("T", string.Empty); + var keptFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Kept"); + var removedGenericFoo = new GenericTestTypeProvider( + "Foo`1", + TypeSignatureModifiers.Public, + "Removed", + genericArgument); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => new TestOutputLibrary(keptFoo, removedGenericFoo), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + CodeModelGenerator.Instance.AddTypeToKeep(keptFoo.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([keptFoo, removedGenericFoo]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedGenericFoo)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.IsResolvableBuildableType( + CreateNamedType("Foo", string.Empty, genericArgument))); + } + + [Test] + public void HelperRootBodyDependencyRootsGeneratedGenericDependency() + { + var genericArgument = CreateNamedType("T", string.Empty); + var client = new HelperDependencyTestTypeProvider("SampleClient", "Sample", CreateNamedType("ClientPipelineExtensions", "Microsoft.TypeSpec.Generator.ClientModel.Providers")); + var pipelineExtensions = new BodyDependencyTestTypeProvider("ClientPipelineExtensions", "Sample", CreateNamedType("ErrorResult", "Microsoft.TypeSpec.Generator.ClientModel.Providers", genericArgument)); + var errorResult = new GenericTestTypeProvider("ErrorResult", TypeSignatureModifiers.Internal, "Sample", genericArgument); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, pipelineExtensions, errorResult)); + CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([client, pipelineExtensions, errorResult]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(client)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pipelineExtensions)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(errorResult)); + } + + [Test] + public void UnreferencedHelperDependencyDoesNotKeepUnreferencedSiblingHelper() + { + var client = new HelperDependencyTestTypeProvider("SampleClient", "Sample", CreateNamedType("ClientPipelineExtensions", "Sample")); + var pipelineExtensions = new TestTypeProvider("ClientPipelineExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); + var cancellationTokenExtensions = new TestTypeProvider("CancellationTokenExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, pipelineExtensions, cancellationTokenExtensions)); + CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([client, pipelineExtensions, cancellationTokenExtensions]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(client)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pipelineExtensions)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(cancellationTokenExtensions)); + } + + [Test] + public async Task LastContractInternalHelperDoesNotRootAbsentGeneratedHelper() + { + var lastContractCompilation = CSharpCompilation.Create( + "LastContract", + [CSharpSyntaxTree.ParseText(""" + namespace Sample + { + internal static class ClientPipelineExtensions + { + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var client = new TestTypeProvider("SampleClient", TypeSignatureModifiers.Public, ns: "Sample"); + var pipelineExtensions = new TestTypeProvider("ClientPipelineExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(client, pipelineExtensions), + lastContractCompilation: () => Task.FromResult(lastContractCompilation)); + CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([client, pipelineExtensions]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(client)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pipelineExtensions)); + } + + [Test] + public void NamespaceLessCustomCodeBodyDependencyDoesNotRootGeneratedTypeInDifferentNamespace() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("ReferencedModel", string.Empty)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var referencedModel = new TestTypeProvider("ReferencedModel", TypeSignatureModifiers.Public, ns: "Other.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, referencedModel)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, referencedModel]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(referencedModel)); + } + + [Test] + public void NamespaceLessCustomCodeBodyDependencyDoesNotRootInternalModelWithSameNamespaceMemberName() + { + var customCodeView = new BodyDependencyTestTypeProvider( + "CustomSetting", + "Sample", + [CreateNamedType("Key", string.Empty)], + [new PropertyProvider($"", MethodSignatureModifiers.Public, typeof(string), "Key", new AutoPropertyBody(true), TestTypeProvider.Empty)]); + var customType = new CustomizableTestTypeProvider("CustomSetting", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var generatedKey = new TestTypeProvider("Key", TypeSignatureModifiers.Internal, ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedKey)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, generatedKey]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedKey)); + } + + [Test] + public void CustomCodeBodyDependencyOnExternalTypeDoesNotRootGeneratedTypeBySimpleName() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("OperationState", "Azure")); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var generatedOperationState = new TestTypeProvider("OperationState", TypeSignatureModifiers.Internal, ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedOperationState)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, generatedOperationState]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedOperationState)); + } + + [Test] + public void UnregisteredCustomCodeMethodDependencyDoesNotRootGeneratedExtensionProvider() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("SetValue", string.Empty)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var extensionProvider = new ExtensionMethodTestTypeProvider("GeneratedExtensions", "SetValue", ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, extensionProvider)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, extensionProvider]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(extensionProvider)); + } + + [Test] + public void AmbiguousCustomCodeExtensionMethodDependencyDoesNotRootGeneratedProvider() + { + var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("SetValue", string.Empty)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var firstExtensionProvider = new ExtensionMethodTestTypeProvider("FirstExtensions", "SetValue", ns: "Sample"); + var secondExtensionProvider = new ExtensionMethodTestTypeProvider("SecondExtensions", "SetValue", ns: "Sample"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, firstExtensionProvider, secondExtensionProvider)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([customType, firstExtensionProvider, secondExtensionProvider]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(firstExtensionProvider)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(secondExtensionProvider)); + } + + [Test] + public void GeneratedBodyExtensionCallRootsProviderByMethodAndReceiverType() + { + var requestContextType = CreateNamedType("RequestContext", "Azure"); + var otherContextType = CreateNamedType("OtherContext", "Azure"); + var client = new ClientTestTypeProvider("SampleClient", "Sample"); + client.Update(methods: + [ + new MethodProvider( + new MethodSignature("Process", $"", MethodSignatureModifiers.Public, typeof(void), $"", []), + new InvokeMethodExpression(new VariableExpression(requestContextType, "context"), "Parse", []), + client) + ]); + var requestContextExtensions = new ExtensionMethodTestTypeProvider("RequestContextExtensions", "Parse", "Sample", requestContextType); + var otherContextExtensions = new ExtensionMethodTestTypeProvider("OtherContextExtensions", "Parse", "Sample", otherContextType); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, requestContextExtensions, otherContextExtensions)); + CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([client, requestContextExtensions, otherContextExtensions]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(requestContextExtensions)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(otherContextExtensions)); + } + + [Test] + public async Task CustomCodeTypeDoesNotRootGeneratedExtensionsTypeByNamingConvention() + { + var customCompilation = CSharpCompilation.Create( + "Customization", + [CSharpSyntaxTree.ParseText(""" + namespace Sample + { + public partial class Widget + { + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var client = new ClientTestTypeProvider("SampleClient", "Sample"); + var widgetExtensions = new TestTypeProvider("WidgetExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(client, widgetExtensions), + compilation: () => Task.FromResult(customCompilation)); + CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([client, widgetExtensions]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(widgetExtensions)); + } + + [Test] + public void PublicCustomSignatureExternalTypeDoesNotPublicizeGeneratedTypeBySimpleName() + { + var customCodeView = new SignatureDependencyTestTypeProvider( + "CustomType", + TypeSignatureModifiers.Public, + CreateNamedType("Action", "System")); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); + var generatedAction = new TestTypeProvider("Action", TypeSignatureModifiers.Internal, ns: "Sample.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedAction)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + CodeModelGenerator.Instance.AddTypeToKeep(generatedAction.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([customType, generatedAction]); + + Assert.IsTrue(generatedAction.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(generatedAction.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void InternalizeModeDoesNotRemoveUnreferencedProviders() + { + var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); + var unusedModel = new TestTypeProvider("UnusedModel", TypeSignatureModifiers.Public); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => new TestOutputLibrary(context, unusedModel), + configuration: "{\"unreferenced-types-handling\":\"internalize\"}"); + CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.Analyze([context, unusedModel]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(context)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(unusedModel)); + Assert.IsEmpty(ProviderReferenceMapAnalyzer.LatestResult!.RemoveCandidates); + } + + [Test] + public void SerializationProviderInfrastructureRootsUseProviderBodyDependencies() + { + var optional = new TestTypeProvider("Optional", TypeSignatureModifiers.Public); + var modelSerializationExtensions = new TestTypeProvider("ModelSerializationExtensions", TypeSignatureModifiers.Public); + var serializationProvider = new BodyDependencyTestTypeProvider( + "SampleModelSerializer", + ns: null, + optional.Type, + modelSerializationExtensions.Type); + var model = new ClientTestTypeProvider("SampleModel", serializationProvider); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary( + model, + serializationProvider, + optional, + modelSerializationExtensions)); + + ProviderReferenceMapAnalyzer.Analyze([model, serializationProvider, optional, modelSerializationExtensions]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(serializationProvider)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(optional)); + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(modelSerializationExtensions)); + } + + [Test] + public async Task InternalCustomizationTypeDoesNotInternalizeGeneratedTypeWithSameSimpleName() + { + var customCompilation = CompilationHelper.LoadCompilation( + [new TestTypeProvider("Error", TypeSignatureModifiers.Internal, ns: "Custom.Models")]); + var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); + var generatedError = new TestTypeProvider("Error", TypeSignatureModifiers.Public, ns: "Generated.Models"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(context, generatedError), + compilation: () => Task.FromResult(customCompilation)); + CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName); + CodeModelGenerator.Instance.AddTypeToKeep(generatedError.Type.FullyQualifiedName); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([context, generatedError]); + + Assert.IsTrue(generatedError.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(generatedError.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public async Task PublicGenericCustomizationDoesNotPublicizeGeneratedNonGenericTypeWithSameSimpleName() + { + var customCompilation = CSharpCompilation.Create( + "TestAssembly", + [CSharpSyntaxTree.ParseText(""" + namespace Generated.Models + { + public partial class SearchResult + { + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); + var generatedSearchResult = new TestTypeProvider("SearchResult", TypeSignatureModifiers.Internal, ns: "Generated.Models"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(context, generatedSearchResult), + compilation: () => Task.FromResult(customCompilation)); + CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName); + CodeModelGenerator.Instance.AddTypeToKeep(generatedSearchResult.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([context, generatedSearchResult]); + + Assert.IsTrue(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void PublicGenericCustomSignatureDoesNotRootGeneratedNonGenericTypeBySimpleName() + { + var genericArgument = CreateNamedType("T", string.Empty); + var customCodeView = new SignatureDependencyTestTypeProvider( + "CustomType", + TypeSignatureModifiers.Public, + CreateNamedType("SearchResult", "Generated.Models", genericArgument)); + var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Generated.Models"); + var generatedSearchResult = new TestTypeProvider("SearchResult", TypeSignatureModifiers.Internal, ns: "Generated.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedSearchResult)); + CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); + CodeModelGenerator.Instance.AddTypeToKeep(generatedSearchResult.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([customType, generatedSearchResult]); + + Assert.IsTrue(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void PublicProviderSignatureDependencyKeepsNonRootTypePublic() + { + var client = new ClientTestTypeProvider( + "SampleClient", + "Sample", + signatureDependencyTypes: CreateNamedType("GeneratedModel", "Sample.Models")); + var generatedModel = new GeneratedModelTestTypeProvider("GeneratedModel", TypeSignatureModifiers.Public, ns: "Sample.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, generatedModel)); + CodeModelGenerator.Instance.AddTypeToKeep(generatedModel.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, generatedModel]); + + Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public void PublicProviderMethodWithNamespaceLessSignatureKeepsNonRootTypePublic() + { + var client = new ClientTestTypeProvider("SampleClient", "Sample"); + var generatedModel = new GeneratedModelTestTypeProvider("GeneratedModel", TypeSignatureModifiers.Public, ns: "Sample"); + client.Update(methods: + [ + new MethodProvider( + new MethodSignature( + "GetModel", + $"", + MethodSignatureModifiers.Public, + CreateNamedType("GeneratedModel", string.Empty), + $"", + []), + MethodBodyStatement.Empty, + client) + ]); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, generatedModel)); + CodeModelGenerator.Instance.AddTypeToKeep(generatedModel.Type.FullyQualifiedName, isRoot: false); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, generatedModel]); + + Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public async Task LastContractGenericDeclarationDoesNotRootGeneratedType() + { + var lastContractCompilation = CSharpCompilation.Create( + "LastContract", + [CSharpSyntaxTree.ParseText(""" + namespace Sample.Models + { + public partial class PageResult + { + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + + var genericArgument = CreateNamedType("T", string.Empty); + var genericPageResult = new GenericTestTypeProvider("PageResult", TypeSignatureModifiers.Public, "Sample.Models", genericArgument); + var nonGenericPageResult = new GeneratedModelTestTypeProvider("PageResult", TypeSignatureModifiers.Public, ns: "Sample.Models"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(genericPageResult, nonGenericPageResult), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", + lastContractCompilation: () => Task.FromResult(lastContractCompilation)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([genericPageResult, nonGenericPageResult]); + + Assert.IsTrue(genericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(genericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(nonGenericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(nonGenericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public async Task LastContractNestedPublicDeclarationDoesNotRootGeneratedType() + { + var lastContractCompilation = CSharpCompilation.Create( + "LastContract", + [CSharpSyntaxTree.ParseText(""" + namespace Sample.Models + { + public partial class OuterModel + { + public partial class InnerModel + { + } + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + + var outerModel = new TestTypeProvider("OuterModel", TypeSignatureModifiers.Public, ns: "Sample.Models"); + var innerModel = new NestedTestTypeProvider("InnerModel", TypeSignatureModifiers.Public, outerModel, ns: "Sample.Models"); + outerModel.NestedTypesInternal = [innerModel]; + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(outerModel), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", + lastContractCompilation: () => Task.FromResult(lastContractCompilation)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([outerModel]); + + Assert.IsTrue(outerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(outerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(innerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(innerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void DependenciesOfInternalizedClientAreNotPublicizedFromClientRootTraversal() + { + var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); + var client = new ClientTestTypeProvider( + "SampleClient", + "Sample", + new SignatureDependencyTestTypeProvider("SampleClient", TypeSignatureModifiers.Internal, ns: "Sample"), + signatureDependencyTypes: clientOptions.Type); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, clientOptions)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); + + Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void PublicConstructorOnInternalClientDoesNotPublicizeGeneratedOptions() + { + var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); + var customCodeView = new SignatureDependencyTestTypeProvider("SampleClient", TypeSignatureModifiers.Internal, ns: "Sample"); + var client = new ConstructorDependencyTestTypeProvider( + "SampleClient", + TypeSignatureModifiers.Public, + customCodeView, + ns: "Sample", + constructorParameterTypes: [CreateNamedType("SampleClientOptions", "Sample")]); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, clientOptions)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); + + Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public async Task LastContractInternalDeclarationsDoNotChangeProviderAccessibility() + { + var lastContractCompilation = CSharpCompilation.Create( + "LastContract", + [CSharpSyntaxTree.ParseText(""" + namespace Sample + { + internal partial class SampleClient + { + } + + internal partial class SampleClientOptions + { + internal enum ServiceVersion + { + V1 = 1 + } + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); + clientOptions.NestedTypesInternal = + [ + new NestedTestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, clientOptions, ns: "Sample") + ]; + var client = new ClientTestTypeProvider("SampleClient", "Sample", signatureDependencyTypes: CreateNamedType("SampleClientOptions", "Sample")); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(client, clientOptions), + lastContractCompilation: () => Task.FromResult(lastContractCompilation)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); + + Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public async Task LastContractInternalDeclarationDoesNotOverridePublicCustomPartial() + { + var lastContractCompilation = CSharpCompilation.Create( + "LastContract", + [CSharpSyntaxTree.ParseText(""" + namespace Sample + { + internal abstract partial class AbstractModel + { + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var customCodeView = new TestTypeProvider("AbstractModel", TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract, ns: "Sample"); + var model = new CustomizableTestTypeProvider("AbstractModel", TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract, customCodeView, ns: "Sample"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(model), + lastContractCompilation: () => Task.FromResult(lastContractCompilation)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([model]); + + Assert.IsTrue(model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public async Task TopLevelTypeWithSameNameAsNestedTypeDoesNotPublicizeDeclaringType() + { + var lastContractCompilation = CSharpCompilation.Create( + "LastContract", + [CSharpSyntaxTree.ParseText(""" + namespace Sample + { + public enum ServiceVersion + { + V1 = 1 + } + + internal partial class SampleClientOptions + { + internal enum ServiceVersion + { + V1 = 1 + } + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var publicServiceVersion = new TestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, ns: "Sample"); + var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); + clientOptions.NestedTypesInternal = + [ + new NestedTestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, clientOptions, ns: "Sample") + ]; + var customPublicApi = new SignatureDependencyTestTypeProvider( + "CustomPublicApi", + TypeSignatureModifiers.Public, + ns: "Sample", + CreateNamedType("ServiceVersion", "Sample")); + var generatedPublicApi = new CustomizableTestTypeProvider( + "CustomPublicApi", + TypeSignatureModifiers.Public, + customPublicApi, + ns: "Sample"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(publicServiceVersion, clientOptions, generatedPublicApi), + lastContractCompilation: () => Task.FromResult(lastContractCompilation)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([publicServiceVersion, clientOptions, generatedPublicApi]); + + Assert.IsTrue(publicServiceVersion.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(publicServiceVersion.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(generatedPublicApi.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(generatedPublicApi.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public async Task ExistingGeneratedSourceDoesNotChangeAccessibilityWithoutLastContract() + { + var outputPath = Path.Combine(TestContext.CurrentContext.WorkDirectory, "ReferenceMap", nameof(ExistingGeneratedSourceDoesNotChangeAccessibilityWithoutLastContract)); + var projectPath = Path.Combine(outputPath, "src"); + Directory.CreateDirectory(projectPath); + await File.WriteAllTextAsync(Path.Combine(projectPath, "SampleClient.cs"), """ + namespace Sample + { + internal partial class SampleClient + { + } + } + """); + await File.WriteAllTextAsync(Path.Combine(projectPath, "SampleClientOptions.cs"), """ + namespace Sample + { + internal partial class SampleClientOptions + { + internal enum ServiceVersion + { + V1 = 1 + } + } + } + """); + var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); + clientOptions.NestedTypesInternal = + [ + new NestedTestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, clientOptions, ns: "Sample") + ]; + var client = new ClientTestTypeProvider("SampleClient", "Sample", signatureDependencyTypes: CreateNamedType("SampleClientOptions", "Sample")); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(client, clientOptions), + configuration: "{}", + outputPath: outputPath); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); + + Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public async Task LastContractModelFactorySignaturesDoNotRootGeneratedModels() + { + MockHelpers.LoadMockGenerator(); + var lastContract = await Helpers.GetCompilationFromDirectoryAsync(); + var pagedModel = new TestTypeProvider("PagedWidget", TypeSignatureModifiers.Public, ns: "Sample"); + var requestModel = new TestTypeProvider("WidgetRequest", TypeSignatureModifiers.Public, ns: "Sample"); + await MockHelpers.LoadMockGeneratorAsync( + createOutputLibrary: () => new TestOutputLibrary(pagedModel, requestModel), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", + lastContractCompilation: () => Task.FromResult(lastContract)); + var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; + Assert.IsNotNull(modelFactory.LastContractView, modelFactory.Name); + + ProviderReferenceMapAnalyzer.Analyze([pagedModel, requestModel, modelFactory]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pagedModel)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(requestModel)); + } + + [Test] + public void ApiDirectoryDoesNotChangePublicClientRootsWithoutLastContract() + { + var outputPath = Path.Combine(TestContext.CurrentContext.WorkDirectory, "ReferenceMap", nameof(ApiDirectoryDoesNotChangePublicClientRootsWithoutLastContract)); + Directory.CreateDirectory(Path.Combine(outputPath, "api")); + MockHelpers.LoadMockGenerator( + configuration: "{}", + outputPath: Path.Combine(outputPath, "src")); + var options = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); + var client = new ClientTestTypeProvider("SampleClient", "Sample", signatureDependencyTypes: options.Type); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, options]); + + Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(options.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void PublicCustomCodeArraySignatureKeepsGeneratedTypePublic() + { + var customCodeView = new SignatureDependencyTestTypeProvider("PublicCustomApi", TypeSignatureModifiers.Public, CreateNamedType("GeneratedModel", string.Empty)); + var generatedModel = new CustomizableTestTypeProvider("GeneratedModel", TypeSignatureModifiers.Public, customCodeView, ns: "Generated.Models"); + MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(generatedModel)); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([generatedModel]); + + Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsFalse(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + } + + [Test] + public void InternalGeneratedPredecessorDoesNotPublicizeItsInternalDependency() + { + var dependency = new GeneratedModelTestTypeProvider("InternalDependency", TypeSignatureModifiers.Internal, ns: "Sample.Models"); + var internalModel = new GeneratedModelTestTypeProvider( + "InternalModel", + TypeSignatureModifiers.Internal, + ns: "Sample.Models"); + var publicRoot = new GeneratedModelTestTypeProvider( + "PublicRoot", + TypeSignatureModifiers.Public, + ns: "Sample.Models"); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => new TestOutputLibrary(publicRoot, internalModel, dependency), + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + CodeModelGenerator.Instance.AddTypeToKeep(publicRoot.Type.FullyQualifiedName); + CodeModelGenerator.Instance.AddTypeToKeep(internalModel.Type.FullyQualifiedName); + CodeModelGenerator.Instance.AddTypeToKeep(dependency.Type.FullyQualifiedName); + + publicRoot.Update(properties: [ + new PropertyProvider($"", MethodSignatureModifiers.Public, internalModel.Type, "InternalModel", new AutoPropertyBody(false), publicRoot) + ]); + internalModel.Update(properties: [ + new PropertyProvider($"", MethodSignatureModifiers.Public, dependency.Type, "Dependency", new AutoPropertyBody(false), internalModel) + ]); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([publicRoot, internalModel, dependency]); + + Assert.IsTrue(internalModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(internalModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsTrue(dependency.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(dependency.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + } + + [Test] + public void InternalizedGenericModelRemovesAritylessModelFactoryMethod() + { + var genericArgument = CreateNamedType("T", string.Empty); + var genericModel = new GenericTestTypeProvider( + "GenericModel`1", + TypeSignatureModifiers.Public, + "Sample.Models", + genericArgument); + var outputLibrary = new TestOutputLibrary(genericModel); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => outputLibrary, + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; + modelFactory.Update(methods: + [ + new MethodProvider( + new MethodSignature( + "GenericModel", + $"", + MethodSignatureModifiers.Static | MethodSignatureModifiers.Public, + genericModel.Type, + $"", + []), + MethodBodyStatement.Empty, + modelFactory) + ]); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([genericModel]); + + Assert.IsTrue(genericModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsFalse(genericModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); + Assert.IsEmpty(modelFactory.Methods.Select(m => m.Signature.Name)); + } + + [Test] + public void RemovedModelDoesNotRemoveFactoryMethodForSameNamedModel() + { + var keptModel = new GeneratedModelTestTypeProvider("Widget", TypeSignatureModifiers.Public, ns: "Kept"); + var removedModel = new GeneratedModelTestTypeProvider("Widget", TypeSignatureModifiers.Public, ns: "Removed"); + var outputLibrary = new TestOutputLibrary(keptModel, removedModel); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => outputLibrary, + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + CodeModelGenerator.Instance.AddTypeToKeep(keptModel.Type.FullyQualifiedName); + var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; + modelFactory.Update(methods: + [ + new MethodProvider( + new MethodSignature( + "Widget", + $"", + MethodSignatureModifiers.Static | MethodSignatureModifiers.Public, + keptModel.Type, + $"", + []), + MethodBodyStatement.Empty, + modelFactory) + ]); + + ProviderReferenceMapAnalyzer.Analyze([keptModel, removedModel, modelFactory]); + + Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(keptModel)); + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedModel)); + Assert.AreEqual(new[] { "Widget" }, modelFactory.Methods.Select(m => m.Signature.Name)); + } + + [Test] + public void GeneratedTypeDoesNotPreserveLastContractTypeAttributes() + { + var lastContractView = new AttributedTestTypeProvider( + "GeneratedModel", + TypeSignatureModifiers.Internal, + ns: "Sample", + new AttributeStatement(typeof(ExperimentalAttribute), Literal("TEST001"))); + var generatedModel = new ContractedTestTypeProvider( + "GeneratedModel", + TypeSignatureModifiers.Internal, + lastContractView, + ns: "Sample"); + var outputLibrary = new TestOutputLibrary(generatedModel); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => outputLibrary, + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + + ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([generatedModel]); + + Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + var codeFile = new TypeProviderWriter(generatedModel).Write(); + StringAssert.DoesNotContain("[global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute(\"TEST001\")]", codeFile.Content); + StringAssert.Contains("internal partial class GeneratedModel", codeFile.Content); + } + + [Test] + public void GeneratedTypeDoesNotPreserveLastContractAttributeReferencingRemovedGeneratedType() + { + var removedModel = new GeneratedModelTestTypeProvider("RemovedModel", TypeSignatureModifiers.Internal, ns: "Sample"); + var lastContractView = new AttributedTestTypeProvider( + "GeneratedModel", + TypeSignatureModifiers.Internal, + ns: "Sample", + new AttributeStatement(typeof(ExperimentalAttribute), TypeOf(CreateNamedType("RemovedModel", "Sample")))); + var generatedModel = new ContractedTestTypeProvider( + "GeneratedModel", + TypeSignatureModifiers.Internal, + lastContractView, + ns: "Sample"); + var outputLibrary = new TestOutputLibrary(generatedModel, removedModel); + MockHelpers.LoadMockGenerator( + createOutputLibrary: () => outputLibrary, + configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); + + ProviderReferenceMapAnalyzer.Analyze([generatedModel, removedModel]); + + Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedModel)); + var codeFile = new TypeProviderWriter(generatedModel).Write(); + StringAssert.DoesNotContain("RemovedModel", codeFile.Content); + StringAssert.Contains("internal partial class GeneratedModel", codeFile.Content); + } + + private sealed class BodyDependencyTestTypeProvider : TestTypeProvider + { + private readonly CSharpType[] _bodyDependencyTypes; + + public BodyDependencyTestTypeProvider(string name, params CSharpType[] bodyDependencyTypes) + : this(name, bodyDependencyTypes, ns: null) + { + } + + public BodyDependencyTestTypeProvider(string name, string? ns, params CSharpType[] bodyDependencyTypes) + : this(name, bodyDependencyTypes, ns) + { + } + + public BodyDependencyTestTypeProvider(string name, string? ns, CSharpType[] bodyDependencyTypes, PropertyProvider[] properties) + : base(name, TypeSignatureModifiers.Public, properties: properties, ns: ns) + { + _bodyDependencyTypes = bodyDependencyTypes; + } + + public BodyDependencyTestTypeProvider(string name, CSharpType[] bodyDependencyTypes, string? ns) + : base(name, TypeSignatureModifiers.Public, ns: ns) + { + _bodyDependencyTypes = bodyDependencyTypes; + } + + protected internal override IReadOnlyList BuildBodyDependencyTypes() => _bodyDependencyTypes; + } + + private sealed class HelperDependencyTestTypeProvider : TestTypeProvider + { + private readonly CSharpType[] _helperDependencyTypes; + + public HelperDependencyTestTypeProvider(string name, string? ns, params CSharpType[] helperDependencyTypes) + : base(name, TypeSignatureModifiers.Public, ns: ns) + { + _helperDependencyTypes = helperDependencyTypes; + } + + protected internal override IReadOnlyList BuildHelperDependencyTypes() => _helperDependencyTypes; + } + + private sealed class ExtensionMethodTestTypeProvider : TestTypeProvider + { + private readonly string _methodName; + private readonly CSharpType? _receiverType; + + public ExtensionMethodTestTypeProvider(string name, string methodName, string ns, CSharpType? receiverType = null) + : base(name, TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: ns) + { + _methodName = methodName; + _receiverType = receiverType; + } + + protected internal override MethodProvider[] BuildMethods() => + [ + new MethodProvider( + new MethodSignature( + _methodName, + $"", + MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static | MethodSignatureModifiers.Extension, + typeof(void), + $"", + _receiverType == null ? [] : [new ParameterProvider("value", $"", _receiverType)]), + MethodBodyStatement.Empty, + this) + ]; + } + + private sealed class SignatureDependencyTestTypeProvider : TestTypeProvider + { + private readonly CSharpType[] _signatureDependencyTypes; + + public SignatureDependencyTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, params CSharpType[] signatureDependencyTypes) + : this(name, declarationModifiers, ns: null, signatureDependencyTypes) + { + } + + public SignatureDependencyTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string? ns, params CSharpType[] signatureDependencyTypes) + : base(name, declarationModifiers, ns: ns) + { + _signatureDependencyTypes = signatureDependencyTypes; + } + + protected internal override IReadOnlyList BuildSignatureDependencyTypes() => _signatureDependencyTypes; + } + + private sealed class CustomizableTestTypeProvider : TestTypeProvider + { + private readonly TypeProvider _customCodeView; + + public CustomizableTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider customCodeView, string ns) + : base(name, declarationModifiers, ns: ns) + { + _customCodeView = customCodeView; + } + + private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; + } + + private sealed class AttributedTestTypeProvider : TestTypeProvider + { + private readonly AttributeStatement[] _attributes; + + public AttributedTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string ns, params AttributeStatement[] attributes) + : base(name, declarationModifiers, ns: ns) + { + _attributes = attributes; + } + + protected override IReadOnlyList BuildAttributes() => _attributes; + } + + private sealed class ContractedTestTypeProvider : TestTypeProvider + { + private readonly TypeProvider _lastContractView; + + public ContractedTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider lastContractView, string ns) + : base(name, declarationModifiers, ns: ns) + { + _lastContractView = lastContractView; + } + + private protected override TypeProvider? BuildLastContractView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _lastContractView; + } + + private sealed class ConstructorDependencyTestTypeProvider : TestTypeProvider + { + private readonly TypeProvider _customCodeView; + private readonly CSharpType[] _constructorParameterTypes; + + public ConstructorDependencyTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider customCodeView, string ns, params CSharpType[] constructorParameterTypes) + : base(name, declarationModifiers, ns: ns) + { + _customCodeView = customCodeView; + _constructorParameterTypes = constructorParameterTypes; + } + + protected internal override ConstructorProvider[] BuildConstructors() + { + var parameters = _constructorParameterTypes + .Select((type, index) => new ParameterProvider($"p{index}", $"", type)) + .ToArray(); + return + [ + new ConstructorProvider( + new ConstructorSignature(Type, $"", MethodSignatureModifiers.Public, parameters), + MethodBodyStatement.Empty, + this) + ]; + } + + private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; + } + + private sealed class NestedTestTypeProvider : TestTypeProvider + { + private readonly TypeProvider _declaringTypeProvider; + + public NestedTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider declaringTypeProvider, string ns) + : base(name, declarationModifiers, ns: ns) + { + _declaringTypeProvider = declaringTypeProvider; + } + + protected override TypeProvider? BuildDeclaringTypeProvider() => _declaringTypeProvider; + } + + private sealed class GeneratedModelTestTypeProvider : TypeProvider + { + private readonly string _name; + private readonly string _namespace; + private readonly TypeSignatureModifiers _declarationModifiers; + + public GeneratedModelTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string ns) + { + _name = name; + _namespace = ns; + _declarationModifiers = declarationModifiers; + } + + protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Models", $"{Name}.cs"); + protected override string BuildName() => _name; + protected override string BuildNamespace() => _namespace; + protected override TypeSignatureModifiers BuildDeclarationModifiers() => _declarationModifiers; + } + + private sealed class GenericTestTypeProvider : TestTypeProvider + { + private readonly CSharpType[] _typeArguments; + + public GenericTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string ns, params CSharpType[] typeArguments) + : base(name, declarationModifiers, ns: ns) + { + _typeArguments = typeArguments; + } + + protected override CSharpType[] GetTypeArguments() => _typeArguments; + } + + private sealed class ClientTestTypeProvider : TestTypeProvider + { + private readonly TypeProvider[] _serializationProviders; + private readonly TypeProvider? _customCodeView; + private readonly CSharpType[] _signatureDependencyTypes; + + public ClientTestTypeProvider(string name, params TypeProvider[] serializationProviders) + : this(name, ns: null, customCodeView: null, serializationProviders: serializationProviders) + { + } + + public ClientTestTypeProvider(string name, string? ns, TypeProvider? customCodeView = null, TypeProvider[]? serializationProviders = null, params CSharpType[] signatureDependencyTypes) + : base(name, TypeSignatureModifiers.Public, ns: ns) + { + _serializationProviders = serializationProviders ?? []; + _customCodeView = customCodeView; + _signatureDependencyTypes = signatureDependencyTypes; + } + + protected internal override bool IsClientProvider => true; + protected override TypeProvider[] BuildSerializationProviders() => _serializationProviders; + private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; + protected internal override IReadOnlyList BuildSignatureDependencyTypes() => _signatureDependencyTypes; + } + + private sealed class ClientProvider : TestTypeProvider + { + public ClientProvider() + : base("SameNamedProvider", TypeSignatureModifiers.Public, ns: "Sample") + { + } + } + + private static CSharpType CreateNamedType(string name, string ns, params CSharpType[] arguments) + { + var constructor = typeof(CSharpType).GetConstructor( + BindingFlags.Instance | BindingFlags.NonPublic, + binder: null, + [typeof(string), typeof(string), typeof(bool), typeof(bool), typeof(CSharpType), typeof(IReadOnlyList), typeof(bool), typeof(bool), typeof(CSharpType), typeof(Type)], + modifiers: null)!; + + return (CSharpType)constructor.Invoke([name, ns, false, false, null, arguments, true, false, null, null]); + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs new file mode 100644 index 00000000000..b91419eb56e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs @@ -0,0 +1,17 @@ +namespace Sample +{ + internal class PagedWidget + { + } + + internal class WidgetRequest + { + } + + public static class SampleModelFactory + { + public static PagedWidget PagedWidget() => throw null; + + public static WidgetRequest WidgetRequest() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs index 00119db05dd..7490c2f41e5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs @@ -14,6 +14,11 @@ public TestOutputLibrary(TypeProvider typeProvider) _types = [typeProvider]; } + public TestOutputLibrary(params TypeProvider[] typeProviders) + { + _types = typeProviders; + } + protected override TypeProvider[] BuildTypeProviders() => _types; } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs new file mode 100644 index 00000000000..27bd4cf11cd --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs @@ -0,0 +1,6 @@ +namespace Sample +{ + public class GenericContainer + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs index 3884f8d584e..e8fcf0bb0fb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Tests.Common; using Moq; @@ -83,6 +84,46 @@ public async Task NonNullableKnownFrameworkTypeResolvesUnchanged() Assert.IsFalse(csharpType.IsNullable); } + [Test] + public async Task TypeParameterDoesNotResolveContainingGenericType() + { + var compilation = await Helpers.GetCompilationFromDirectoryAsync(); + var typeSymbol = compilation.GetTypeByMetadataName("Sample.GenericContainer`1"); + Assert.IsNotNull(typeSymbol, "Failed to resolve generic type symbol from compiled source."); + + var csharpType = typeSymbol!.TypeParameters[0].GetCSharpType(); + + Assert.AreEqual("T", csharpType.Name); + Assert.IsNull(csharpType.DeclaringType); + } + + [Test] + public void CollectionGenericSymbolWithoutAngleBracketDisplayNameGetsFullyQualifiedMetadataName() + { + var compilation = CSharpCompilation.Create( + "TestAssembly", + [CSharpSyntaxTree.ParseText(""" + using System.Collections.Generic; + + namespace Sample + { + public class Container + { + public IReadOnlyList GetResult() => null; + } + } + """)], + [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); + var method = compilation.GetTypeByMetadataName("Sample.Container")! + .GetMembers("GetResult") + .OfType() + .Single(); + + var name = method.ReturnType.GetFullyQualifiedName(); + + Assert.AreEqual("System.Collections.Generic.IReadOnlyList`1", name); + } + private static IPropertySymbol GetPropertySymbol(Compilation compilation, string containerName, string propertyName) { var typeSymbol = compilation.GetTypeByMetadataName($"Sample.{containerName}"); diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs index d21f56d38b7..b594d3e6f15 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs @@ -4,7 +4,6 @@ using System.ClientModel.Primitives; using Parameters.Basic._ExplicitBody; -using Parameters.Basic._ImplicitBody; namespace Parameters.Basic { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs index 06d44d34bc1..c17dda5eaec 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs @@ -3,7 +3,6 @@ #nullable disable using Parameters.Basic._ExplicitBody; -using Parameters.Basic._ImplicitBody; namespace Parameters.Basic { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs index fca7b7b5ee9..334e0eb3cb1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs @@ -3,7 +3,6 @@ #nullable disable using System.ClientModel.Primitives; -using Parameters.Spread._Alias; using Parameters.Spread._Model; namespace Parameters.Spread diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs index 775c933bc6b..4e494c2f2ec 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs @@ -2,8 +2,6 @@ #nullable disable -using System.Collections.Generic; -using Parameters.Spread._Alias; using Parameters.Spread._Model; namespace Parameters.Spread diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs index 48490ff12b9..2e915db6195 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs @@ -3,7 +3,6 @@ #nullable disable using System.ClientModel.Primitives; -using Payload.MultiPart._FormData.File; namespace Payload.MultiPart { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs index 6d036b01c86..e5c87b994a6 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs @@ -2,7 +2,6 @@ #nullable disable -using System; using System.ClientModel; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs index 347e4c01fa3..9a53d9a8f3d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs @@ -3,10 +3,7 @@ #nullable disable using System.ClientModel.Primitives; -using Payload.Pageable._PageSize; -using Payload.Pageable._ServerDrivenPagination; using Payload.Pageable._ServerDrivenPagination.AlternateInitialVerb; -using Payload.Pageable._ServerDrivenPagination.ContinuationToken; namespace Payload.Pageable { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs index 0b66e798a05..9f8c3ce6d6d 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs @@ -2,12 +2,7 @@ #nullable disable -using System; -using System.Collections.Generic; -using Payload.Pageable._PageSize; -using Payload.Pageable._ServerDrivenPagination; using Payload.Pageable._ServerDrivenPagination.AlternateInitialVerb; -using Payload.Pageable._ServerDrivenPagination.ContinuationToken; namespace Payload.Pageable { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs index 42db04881c2..9469e8aa953 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs @@ -5,7 +5,6 @@ using System.ClientModel.Primitives; using SpecialWords._ModelProperties; using SpecialWords._Models; -using SpecialWords._ReservedOperationBodyParams; namespace SpecialWords { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs index 1abb2114c9a..43aca8db259 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs @@ -2,10 +2,8 @@ #nullable disable -using System.Collections.Generic; using SpecialWords._ModelProperties; using SpecialWords._Models; -using SpecialWords._ReservedOperationBodyParams; namespace SpecialWords { From 740d16710d696ff0cba4b28c35f3e57e7a6b0263 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Thu, 16 Jul 2026 10:06:37 -0700 Subject: [PATCH 013/249] fix(csharp): prevent plugin build output deadlock (#11270) ## Summary - drain plugin-build stdout and stderr concurrently to prevent redirected pipe deadlocks - add a deterministic regression that fills stderr before writing stdout ## Validation - `npm run build` - `npm run cop` - `dotnet test ./generator/Microsoft.TypeSpec.Generator/test/Microsoft.TypeSpec.Generator.Tests.csproj --filter FullyQualifiedName~GeneratorHandlerTests` No changelog entry is required for the C# emitter package. --- .../src/StartUp/GeneratorHandler.cs | 14 +++- .../test/StartUp/GeneratorHandlerTests.cs | 73 ++++++++++++++++++- 2 files changed, 83 insertions(+), 4 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/StartUp/GeneratorHandler.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/StartUp/GeneratorHandler.cs index 93891c4e500..5552002e20f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/StartUp/GeneratorHandler.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/StartUp/GeneratorHandler.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Reflection; using System.Text.Json; +using System.Threading.Tasks; using System.Xml.Linq; using Microsoft.TypeSpec.Generator.EmitterRpc; using Microsoft.TypeSpec.Generator.Utilities; @@ -308,9 +309,7 @@ internal static string GetPackageDirectory(string rootDirectory, string package) // Read both streams to avoid deadlocks. 'dotnet build' writes build/compiler // errors to standard output rather than standard error, so we include both when // reporting a failure. - var stdout = process.StandardOutput.ReadToEnd(); - var stderr = process.StandardError.ReadToEnd(); - process.WaitForExit(); + var (stdout, stderr) = ReadProcessOutput(process); if (process.ExitCode != 0) { @@ -338,6 +337,15 @@ internal static string GetPackageDirectory(string rootDirectory, string package) return null; } + internal static (string StandardOutput, string StandardError) ReadProcessOutput(Process process) + { + var stdoutTask = process.StandardOutput.ReadToEndAsync(); + var stderrTask = process.StandardError.ReadToEndAsync(); + process.WaitForExit(); + Task.WaitAll(stdoutTask, stderrTask); + return (stdoutTask.Result, stderrTask.Result); + } + /// /// Creates a unique, process-isolated directory to hold a plugin build's 'bin' and 'obj' /// output. The directory is keyed on the process id and a GUID so that concurrent diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/StartUp/GeneratorHandlerTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/StartUp/GeneratorHandlerTests.cs index 13ce5b2ef7f..3f21af6cd66 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/StartUp/GeneratorHandlerTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/StartUp/GeneratorHandlerTests.cs @@ -5,8 +5,10 @@ using System.Collections.Generic; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; +using System.Diagnostics; using System.IO; using System.Linq; +using System.Threading.Tasks; using Microsoft.TypeSpec.Generator.EmitterRpc; using Moq; using NUnit.Framework; @@ -226,6 +228,76 @@ public class Dummy { } } } + [Test] + public void ReadProcessOutput_DrainsStandardOutputAndErrorConcurrently() + { + var testDir = Path.Combine(Path.GetTempPath(), "typespec-test-process-output-" + Guid.NewGuid().ToString("N")[..8]); + try + { + Directory.CreateDirectory(testDir); + var projectPath = Path.Combine(testDir, "OutputFlood.csproj"); + File.WriteAllText(projectPath, """ + + + Exe + net10.0 + + + """); + File.WriteAllText(Path.Combine(testDir, "Program.cs"), """ + using System; + + Console.Error.Write(new string('e', 1_000_000)); + Console.Out.Write("stdout"); + """); + + using var buildProcess = Process.Start(new ProcessStartInfo("dotnet") + { + UseShellExecute = false, + ArgumentList = + { + "build", + projectPath, + "-c", + "Release", + "--nologo", + "--verbosity", + "quiet" + } + }); + Assert.IsNotNull(buildProcess); + buildProcess!.WaitForExit(); + Assert.AreEqual(0, buildProcess.ExitCode); + + using var process = Process.Start(new ProcessStartInfo("dotnet") + { + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + ArgumentList = + { + Path.Combine(testDir, "bin", "Release", "net10.0", "OutputFlood.dll") + } + }); + Assert.IsNotNull(process); + + var readTask = Task.Run(() => GeneratorHandler.ReadProcessOutput(process!)); + if (!readTask.Wait(TimeSpan.FromSeconds(10))) + { + process!.Kill(entireProcessTree: true); + Assert.Fail("Reading redirected output deadlocked when stderr filled its pipe before stdout closed."); + } + + var (stdout, stderr) = readTask.Result; + Assert.AreEqual("stdout", stdout); + Assert.AreEqual(1_000_000, stderr.Length); + } + finally + { + try { Directory.Delete(testDir, true); } catch { } + } + } + [Test] public void BuildPlugin_ReturnsNullOnInvalidProject() { @@ -888,4 +960,3 @@ public void Dispose() } } } - From 3097dc02929a72641bdba8b1ca754bf473aba68e Mon Sep 17 00:00:00 2001 From: Christian Vaagland Tellnes Date: Thu, 16 Jul 2026 19:34:12 +0200 Subject: [PATCH 014/249] feat(openapi3): extend annotated enum strategy to unions of literals (#11154) Extends `enum-strategy: annotated` (#10892, which fixed #5721) to unions of literals. That option previously stopped at `enum` declarations, so unions of literals still collapsed to a flat `enum`, dropping variant names, `@summary`, and docs. ```typespec /** Set of known error types. */ union ErrorType { /** Common error for a bad request. */ @summary("CommonBadRequest") commonBadRequest: "https://example.com/errors/bad-request", } ``` Before: `{ type: string, enum: ["https://example.com/errors/bad-request"] }` After (with `enum-strategy: annotated`): ```yaml ErrorType: description: Set of known error types. anyOf: - const: https://example.com/errors/bad-request title: CommonBadRequest description: Common error for a bad request. ``` ## Behavior - Opt-in via the existing option; `default` output unchanged. - 3.1.0/3.2.0 only; 3.0.0 falls back and reports the existing `enum-strategy-not-supported` warning. - `oneOf` when the union has `@oneOf`, else `anyOf`. - `title` from `@summary`, `description` from `@doc`, both omitted when absent, matching the enum handling. - Non-literal variants (models/scalars) stay as their own members; discriminated unions untouched. ## Open question The option is named `enum-strategy` but now also covers unions of literals (both are "enumerated types" in OpenAPI terms). I broadened its description rather than renaming it. Happy to add an alias if preferred. --- ...rategy-annotated-unions-2026-7-2-19-0-0.md | 38 ++++ packages/openapi3/README.md | 4 +- packages/openapi3/src/lib.ts | 4 +- packages/openapi3/src/schema-emitter-3-1.ts | 30 +++ packages/openapi3/test/union-schema.test.ts | 182 ++++++++++++++++++ .../emitters/openapi3/reference/emitter.md | 4 +- 6 files changed, 256 insertions(+), 6 deletions(-) create mode 100644 .chronus/changes/openapi3-enum-strategy-annotated-unions-2026-7-2-19-0-0.md diff --git a/.chronus/changes/openapi3-enum-strategy-annotated-unions-2026-7-2-19-0-0.md b/.chronus/changes/openapi3-enum-strategy-annotated-unions-2026-7-2-19-0-0.md new file mode 100644 index 00000000000..317e323062f --- /dev/null +++ b/.chronus/changes/openapi3-enum-strategy-annotated-unions-2026-7-2-19-0-0.md @@ -0,0 +1,38 @@ +--- +changeKind: feature +packages: + - "@typespec/openapi3" +--- + +Extend the `enum-strategy: annotated` emitter option to unions of literals. When set to `annotated`, a union whose variants are literals is emitted as a `oneOf`/`anyOf` of `const` subschemas with per-variant `title`/`description` taken from `@summary` and `@doc`, instead of collapsing to a single lossy `enum`. Supported for OpenAPI 3.1.0 and above; emitting with OpenAPI 3.0.0 falls back to the default form and reports a warning. + +For example, the following TypeSpec: + +```typespec +/** Set of known error types. */ +union ErrorType { + /** Common error for a bad request. */ + @summary("CommonBadRequest") + commonBadRequest: "https://example.com/errors/bad-request", + + /** The request body could not be parsed. */ + @summary("InvalidBody") + invalidBody: "https://example.com/errors/invalid-body", +} +``` + +emits: + +```yaml +ErrorType: + description: Set of known error types. + anyOf: + - const: https://example.com/errors/bad-request + title: CommonBadRequest + description: Common error for a bad request. + - const: https://example.com/errors/invalid-body + title: InvalidBody + description: The request body could not be parsed. +``` + +Use `@oneOf` on the union to emit `oneOf` instead of `anyOf`. diff --git a/packages/openapi3/README.md b/packages/openapi3/README.md index a9f822d64a7..91e60720cd5 100644 --- a/packages/openapi3/README.md +++ b/packages/openapi3/README.md @@ -178,11 +178,11 @@ See https://github.com/OAI/OpenAPI-Specification/discussions/4622 for discussion **Default:** `"default"` -How to emit TypeSpec enums. Options are: +How to emit TypeSpec enums and unions of literals. Options are: - `default`: Emit as a single schema using the `enum` keyword. - `annotated`: Emit as a `oneOf` of `const` subschemas annotated with `title` and `description` - from each member's `@summary` and `@doc`. Follows the OpenAPI 3.1.1 annotated enumerations pattern. + from each member's/variant's `@summary` and `@doc`. Follows the OpenAPI 3.1.1 annotated enumerations pattern. Only supported by OpenAPI 3.1.0 and above; on 3.0.0 the `default` style is used and a warning is reported. ## Decorators diff --git a/packages/openapi3/src/lib.ts b/packages/openapi3/src/lib.ts index 48e6ef75d12..9eb420c41d7 100644 --- a/packages/openapi3/src/lib.ts +++ b/packages/openapi3/src/lib.ts @@ -289,10 +289,10 @@ const EmitterOptionsSchema: JSONSchemaType = { nullable: true, default: "default", description: [ - "How to emit TypeSpec enums. Options are:", + "How to emit TypeSpec enums and unions of literals. Options are:", " - `default`: Emit as a single schema using the `enum` keyword.", " - `annotated`: Emit as a `oneOf` of `const` subschemas annotated with `title` and `description`", - " from each member's `@summary` and `@doc`. Follows the OpenAPI 3.1.1 annotated enumerations pattern.", + " from each member's/variant's `@summary` and `@doc`. Follows the OpenAPI 3.1.1 annotated enumerations pattern.", " Only supported by OpenAPI 3.1.0 and above; on 3.0.0 the `default` style is used and a warning is reported.", ].join("\n"), }, diff --git a/packages/openapi3/src/schema-emitter-3-1.ts b/packages/openapi3/src/schema-emitter-3-1.ts index ba587c9c25f..7b8c85b1ea5 100644 --- a/packages/openapi3/src/schema-emitter-3-1.ts +++ b/packages/openapi3/src/schema-emitter-3-1.ts @@ -26,6 +26,7 @@ import { Tuple, Type, Union, + UnionVariant, } from "@typespec/compiler"; import { MetadataInfo } from "@typespec/http"; import { getOneOf } from "./decorators.js"; @@ -245,6 +246,26 @@ export class OpenAPI31SchemaEmitter extends OpenAPI3SchemaEmitterBase { const program = this.emitter.getProgram(); const [discriminated] = getDiscriminatedUnion(program, union); @@ -271,6 +292,15 @@ export class OpenAPI31SchemaEmitter extends OpenAPI3SchemaEmitterBase { }); }); }); + +worksFor(["3.1.0", "3.2.0"], ({ oapiForModel }) => { + describe("enum-strategy: annotated (unions of literals)", () => { + it("emits annotated `const` subschemas for a documented literal union", async () => { + const res = await oapiForModel( + "ErrorType", + ` + /** Set of known error types. */ + union ErrorType { + /** Common error for a bad request. */ + @summary("CommonBadRequest") + commonBadRequest: "https://example.com/errors/bad-request", + + /** Body could not be parsed. */ + @summary("InvalidBody") + invalidBody: "https://example.com/errors/invalid-body", + } + `, + { "enum-strategy": "annotated" }, + ); + + deepStrictEqual(res.schemas.ErrorType, { + description: "Set of known error types.", + anyOf: [ + { + const: "https://example.com/errors/bad-request", + title: "CommonBadRequest", + description: "Common error for a bad request.", + }, + { + const: "https://example.com/errors/invalid-body", + title: "InvalidBody", + description: "Body could not be parsed.", + }, + ], + }); + }); + + it("uses `oneOf` when the union carries `@oneOf`", async () => { + const res = await oapiForModel( + "ErrorType", + ` + @oneOf + union ErrorType { + /** A. */ + a: "a", + /** B. */ + b: "b", + } + `, + { "enum-strategy": "annotated" }, + ); + + deepStrictEqual(res.schemas.ErrorType, { + oneOf: [ + { const: "a", description: "A." }, + { const: "b", description: "B." }, + ], + }); + }); + + it("omits title/description for variants without docs", async () => { + const res = await oapiForModel( + "Color", + ` + union Color { + red: "red", + green: "green", + /** Blue is the warmest color. */ + blue: "blue", + } + `, + { "enum-strategy": "annotated" }, + ); + + deepStrictEqual(res.schemas.Color, { + anyOf: [ + { const: "red" }, + { const: "green" }, + { const: "blue", description: "Blue is the warmest color." }, + ], + }); + }); + + it("emits annotated `const` subschemas for number-valued literal unions", async () => { + const res = await oapiForModel( + "Priority", + ` + union Priority { + /** Low priority. */ + low: 1, + /** High priority. */ + high: 10, + } + `, + { "enum-strategy": "annotated" }, + ); + + deepStrictEqual(res.schemas.Priority, { + anyOf: [ + { const: 1, description: "Low priority." }, + { const: 10, description: "High priority." }, + ], + }); + }); + + it("keeps model/scalar variants alongside annotated literal `const` members", async () => { + const res = await oapiForModel( + "Mixed", + ` + model Detailed { code: string; } + union Mixed { + /** Simple literal. */ + @summary("Simple") + simple: "simple", + detailed: Detailed, + } + `, + { "enum-strategy": "annotated" }, + ); + + deepStrictEqual(res.schemas.Mixed, { + anyOf: [ + { const: "simple", title: "Simple", description: "Simple literal." }, + { $ref: "#/components/schemas/Detailed" }, + ], + }); + }); + + it("does not change literal unions under the default strategy", async () => { + const res = await oapiForModel( + "ErrorType", + ` + union ErrorType { + /** Common error for a bad request. */ + @summary("CommonBadRequest") + commonBadRequest: "https://example.com/errors/bad-request", + + /** Body could not be parsed. */ + @summary("InvalidBody") + invalidBody: "https://example.com/errors/invalid-body", + } + `, + ); + + deepStrictEqual(res.schemas.ErrorType, { + type: "string", + enum: ["https://example.com/errors/bad-request", "https://example.com/errors/invalid-body"], + }); + }); + }); +}); + +worksFor(["3.0.0"], ({ emitOpenApiWithDiagnostics }) => { + it("falls back to the default enum form for literal unions on OpenAPI 3.0.0", async () => { + const [doc, diagnostics] = await emitOpenApiWithDiagnostics( + ` + @service + namespace Test; + + union ErrorType { + /** A. */ + a: "a", + /** B. */ + b: "b", + } + op read(): ErrorType; + `, + { "enum-strategy": "annotated" }, + ); + + expectDiagnostics(diagnostics, { + code: "@typespec/openapi3/enum-strategy-not-supported", + severity: "warning", + }); + + deepStrictEqual(doc.components!.schemas!.ErrorType, { + type: "string", + enum: ["a", "b"], + }); + }); +}); diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/emitter.md b/website/src/content/docs/docs/emitters/openapi3/reference/emitter.md index 39f7fc1e342..7d9f3b5dd5e 100644 --- a/website/src/content/docs/docs/emitters/openapi3/reference/emitter.md +++ b/website/src/content/docs/docs/emitters/openapi3/reference/emitter.md @@ -172,9 +172,9 @@ See https://github.com/OAI/OpenAPI-Specification/discussions/4622 for discussion **Default:** `"default"` -How to emit TypeSpec enums. Options are: +How to emit TypeSpec enums and unions of literals. Options are: - `default`: Emit as a single schema using the `enum` keyword. - `annotated`: Emit as a `oneOf` of `const` subschemas annotated with `title` and `description` - from each member's `@summary` and `@doc`. Follows the OpenAPI 3.1.1 annotated enumerations pattern. + from each member's/variant's `@summary` and `@doc`. Follows the OpenAPI 3.1.1 annotated enumerations pattern. Only supported by OpenAPI 3.1.0 and above; on 3.0.0 the `default` style is used and a warning is reported. From 887da67201afd10e75dc9a8776dbd117826263df Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Thu, 16 Jul 2026 10:54:52 -0700 Subject: [PATCH 015/249] [http-client-csharp] Preserve enum member underscores for backcompat (#11269) ## Summary - match fixed enum members against the last contract while ignoring underscores - preserve the published member name when the underscore-insensitive match is unique - avoid applying ambiguous underscore-insensitive matches ## Validation - npm run build - dotnet test packages/http-client-csharp/generator - npm run cop --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../SerializationCustomizationTests.cs | 26 ++++++ .../MockInputEnum.cs | 10 ++ .../PostProcessing/GeneratedCodeWorkspace.cs | 4 +- .../src/Providers/EnumProvider.cs | 32 +++++++ .../src/Providers/ExtensibleEnumProvider.cs | 6 +- .../src/Providers/FixedEnumProvider.cs | 59 ++++++++++-- .../test/GeneratedCodeWorkspaceTests.cs | 45 +++++++-- .../EnumProviders/EnumProviderTests.cs | 92 +++++++++++++++++++ .../MockInputEnum.cs | 10 ++ .../MockInputEnum.cs | 9 ++ .../MockInputEnum.cs | 12 +++ .../MockInputEnum.cs | 9 ++ .../MockInputEnum.cs | 10 ++ .../test/TestHelpers/MockHelpers.cs | 4 +- 14 files changed, 309 insertions(+), 19 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/TestData/SerializationCustomizationTests/BackCompat_FixedEnumSerializationUsesPreservedUnderscores/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumUnderscoresPreserved/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumAmbiguousUnderscoreMatchNotApplied/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumUnderscoresPreserved/MockInputEnum.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/SerializationCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/SerializationCustomizationTests.cs index 89ee081a6a3..6a9c628c2e3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/SerializationCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/SerializationCustomizationTests.cs @@ -69,5 +69,31 @@ public async Task CanReplaceMethod() Assert.AreEqual(1, customMethods.Count); Assert.AreEqual("ToSerialString", customMethods[0].Signature.Name); } + + [Test] + public async Task BackCompat_FixedEnumSerializationUsesPreservedUnderscores() + { + var inputEnum = InputFactory.Int32Enum( + "mockInputEnum", + [ + ("ExistingValue", 0), + ("Other", 1) + ]); + await MockHelpers.LoadMockGeneratorAsync( + inputEnums: () => [inputEnum], + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var enumProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateEnum(inputEnum); + Assert.IsNotNull(enumProvider); + + var serializationProvider = enumProvider!.SerializationProviders.Single(); + _ = serializationProvider.Methods; + enumProvider.EnsureBuilt(); + enumProvider.ProcessTypeForBackCompatibility(); + + var file = new TypeProviderWriter(serializationProvider).Write(); + StringAssert.Contains("MockInputEnum.Existing_Value", file.Content); + StringAssert.DoesNotContain("MockInputEnum.ExistingValue", file.Content); + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/TestData/SerializationCustomizationTests/BackCompat_FixedEnumSerializationUsesPreservedUnderscores/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/TestData/SerializationCustomizationTests/BackCompat_FixedEnumSerializationUsesPreservedUnderscores/MockInputEnum.cs new file mode 100644 index 00000000000..ba99f9670c2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/EnumProvider/TestData/SerializationCustomizationTests/BackCompat_FixedEnumSerializationUsesPreservedUnderscores/MockInputEnum.cs @@ -0,0 +1,10 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Existing_Value = 0, + Other = 1, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs index 48a6039d4dd..740e000451c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs @@ -348,7 +348,7 @@ internal static async Task AddPackageReferencesFromProject() /// internal static ApiCompatBaseline LoadApiCompatBaseline() { - var packageName = CodeModelGenerator.Instance.TypeFactory.PrimaryNamespace; + var packageName = CodeModelGenerator.Instance.Configuration.PackageName; var directory = new DirectoryInfo(CodeModelGenerator.Instance.Configuration.ProjectDirectory); while (directory != null) @@ -368,7 +368,7 @@ internal static ApiCompatBaseline LoadApiCompatBaseline() internal static async Task LoadBaselineContract() { - var packageName = CodeModelGenerator.Instance.TypeFactory.PrimaryNamespace; + var packageName = CodeModelGenerator.Instance.Configuration.PackageName; string projectFilePath = Path.GetFullPath(Path.Combine(CodeModelGenerator.Instance.Configuration.ProjectDirectory, $"{packageName}.csproj")); if (!File.Exists(projectFilePath)) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs index f15a2741167..e164342ed20 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs @@ -2,7 +2,9 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using Microsoft.TypeSpec.Generator.Input; using Microsoft.TypeSpec.Generator.Input.Extensions; using Microsoft.TypeSpec.Generator.Primitives; @@ -63,6 +65,36 @@ protected override string BuildNamespace() => string.IsNullOrEmpty(_inputType?.N CodeModelGenerator.Instance.TypeFactory.PrimaryNamespace : // we default to this model namespace when the namespace is empty CodeModelGenerator.Instance.TypeFactory.GetCleanNameSpace(_inputType.Namespace); + protected static string RemoveUnderscores(string name) => name.Replace("_", string.Empty); + + private protected static string GetBackCompatibleName( + string generatedName, + IReadOnlyList generatedNames, + IReadOnlyList lastContractNames) + { + if (lastContractNames.Any(n => n.Equals(generatedName, StringComparison.OrdinalIgnoreCase))) + { + return generatedName; + } + + var normalizedName = RemoveUnderscores(generatedName); + // A normalized match ignores underscores and casing. Preserve the last-contract name only + // when exactly one current member and one last-contract member have the same normalized name; + // multiple matches are ambiguous. Only two matches are needed to distinguish those cases. + var matchingCurrentNames = generatedNames + .Where(n => RemoveUnderscores(n).Equals(normalizedName, StringComparison.OrdinalIgnoreCase)) + .Take(2) + .ToArray(); + var matchingLastContractNames = lastContractNames + .Where(n => RemoveUnderscores(n).Equals(normalizedName, StringComparison.OrdinalIgnoreCase)) + .Take(2) + .ToArray(); + + return matchingCurrentNames.Length == 1 && matchingLastContractNames.Length == 1 + ? matchingLastContractNames[0] + : generatedName; + } + protected override bool GetIsEnum() => true; protected override CSharpType BuildEnumUnderlyingType() => CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(_inputType!.ValueType) ?? throw new InvalidOperationException($"Failed to create CSharpType for {_inputType.ValueType}"); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ExtensibleEnumProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ExtensibleEnumProvider.cs index a4ab1bf292d..c849dcf2a1b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ExtensibleEnumProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ExtensibleEnumProvider.cs @@ -48,6 +48,10 @@ internal ExtensibleEnumProvider(InputEnumType input, TypeProvider? declaringType protected override IReadOnlyList BuildEnumValues() { + var generatedNames = _allowedValues + .Select(v => v.IsExactName ? v.Name : v.Name.ToIdentifierName()) + .ToArray(); + var lastContractNames = LastContractView?.Properties.Select(p => p.Name).ToArray() ?? []; var values = new EnumTypeMember[_allowedValues.Count]; for (int i = 0; i < _allowedValues.Count; i++) @@ -56,7 +60,7 @@ protected override IReadOnlyList BuildEnumValues() // build the field var modifiers = FieldModifiers.Private | FieldModifiers.Const; // the fields for extensible enums are private and const, storing the underlying values, therefore we need to append the word `Value` to the name - var valueName = inputValue.IsExactName ? inputValue.Name : inputValue.Name.ToIdentifierName(); + var valueName = GetBackCompatibleName(generatedNames[i], generatedNames, lastContractNames); var name = $"{valueName}Value"; // for initializationValue, if the enum is extensible, we always need it var initializationValue = Literal(inputValue.Value); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs index 854ea4a6b6a..3cea4cc508f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/FixedEnumProvider.cs @@ -73,6 +73,11 @@ protected override TypeProvider[] BuildSerializationProviders() protected override IReadOnlyList BuildEnumValues() { var customMembers = new HashSet(CustomCodeView?.Fields ?? []); + var generatedNames = AllowedValues + .Select(v => v.IsExactName ? v.Name : v.Name.ToIdentifierName()) + .ToArray(); + var lastContractFields = LastContractView?.Fields ?? []; + var lastContractNames = lastContractFields.Select(f => f.Name).ToArray(); var values = new EnumTypeMember[AllowedValues.Count]; @@ -81,13 +86,13 @@ protected override IReadOnlyList BuildEnumValues() var inputValue = AllowedValues[i]; var modifiers = FieldModifiers.Public | FieldModifiers.Static; // the fields for fixed enums are just its members (we use fields to represent the values in a system `enum` type), we just use the name for this field - var name = inputValue.IsExactName ? inputValue.Name : inputValue.Name.ToIdentifierName(); + var name = GetBackCompatibleName(generatedNames[i], generatedNames, lastContractNames); // check if the enum member was renamed in custom code string? customMemberName = null; foreach (var customMember in customMembers) { - if (customMember.OriginalName == name) + if (customMember.OriginalName == generatedNames[i]) { customMemberName = customMember.Name; } @@ -124,10 +129,12 @@ protected override IReadOnlyList BuildEnumValues() var currentLookup = currentValues.ToDictionary(v => v.Name, StringComparer.OrdinalIgnoreCase); var allMembers = new List(currentValues.Count); + var processedNames = new HashSet(StringComparer.OrdinalIgnoreCase); + var customMemberLastContractNames = GetCustomMemberLastContractNames(lastContractFields); foreach (var field in lastContractFields) { - if (currentLookup.TryGetValue(field.Name, out var existingMember)) + if (currentLookup.TryGetValue(field.Name, out var existingMember) && processedNames.Add(existingMember.Name)) { // By default, preserve the last contract's explicit value for integer enums so // members keep their exact values. If the baseline accepts a value change for this @@ -151,6 +158,10 @@ protected override IReadOnlyList BuildEnumValues() initializationValue); allMembers.Add(new EnumTypeMember(existingMember.Name, updatedField, memberValue)); } + else if (customMemberLastContractNames.Contains(field.Name)) + { + continue; + } else if (CodeModelGenerator.Instance.SourceInputModel?.ApiCompatBaseline.IsMemberSuppressed(Type.FullyQualifiedName, field.Name, 0) == true) { CodeModelGenerator.Instance.Emitter.Debug( @@ -167,7 +178,13 @@ protected override IReadOnlyList BuildEnumValues() } // Then, add new members that weren't in the last contract (in their original input order). - AppendMembersNotInLastContract(currentValues, lastContractFields, allMembers); + foreach (var current in currentValues) + { + if (!processedNames.Contains(current.Name)) + { + allMembers.Add(current); + } + } // Report a reordering only when the relative order of members present in BOTH the // current values and the resulting set was actually altered. @@ -181,6 +198,31 @@ protected override IReadOnlyList BuildEnumValues() return allMembers; } + private HashSet GetCustomMemberLastContractNames(IReadOnlyList lastContractFields) + { + var customOriginalNames = new HashSet( + CustomCodeView?.Fields + .Where(f => f.OriginalName != null) + .Select(f => f.OriginalName!) ?? [], + StringComparer.Ordinal); + var generatedNames = AllowedValues + .Select(v => v.IsExactName ? v.Name : v.Name.ToIdentifierName()) + .ToArray(); + var lastContractNames = lastContractFields.Select(f => f.Name).ToArray(); + var customMemberLastContractNames = new HashSet(StringComparer.OrdinalIgnoreCase); + + for (int i = 0; i < generatedNames.Length; i++) + { + if (customOriginalNames.Contains(generatedNames[i])) + { + customMemberLastContractNames.Add( + GetBackCompatibleName(generatedNames[i], generatedNames, lastContractNames)); + } + } + + return customMemberLastContractNames; + } + private bool TryResurrectRemovedMember(FieldProvider lastContractField, [NotNullWhen(true)] out EnumTypeMember? member) { member = null; @@ -225,19 +267,22 @@ private static bool SharedMemberOrderChanged( var currentNames = new HashSet(currentValues.Count, StringComparer.Ordinal); foreach (var member in currentValues) { - currentNames.Add(member.Name); + currentNames.Add(RemoveUnderscores(member.Name)); } var index = 0; foreach (var member in result) { - if (!currentNames.Contains(member.Name)) + if (!currentNames.Contains(RemoveUnderscores(member.Name))) { continue; } if (index >= currentValues.Count - || !string.Equals(member.Name, currentValues[index].Name, StringComparison.Ordinal)) + || !string.Equals( + RemoveUnderscores(member.Name), + RemoveUnderscores(currentValues[index].Name), + StringComparison.OrdinalIgnoreCase)) { return true; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/GeneratedCodeWorkspaceTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/GeneratedCodeWorkspaceTests.cs index 480c052a0bc..66ac281be15 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/GeneratedCodeWorkspaceTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/GeneratedCodeWorkspaceTests.cs @@ -97,6 +97,30 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.NotNull(fooMethod, "Foo method should be found in the SimpleType"); } + [TestCase(Category = EvaluatedFrameworkTestCategory)] + public async Task TestLoadBaselineContractUsesPackageNameWhenNamespaceDiffers() + { + const string ns = "Service.Namespace"; + const string packageName = "Service.Package"; + var nugetCacheDir = Path.Combine(_tempDirectory!, "NuGetCache"); + CreateTestAssemblyAndProjectFile( + nugetCacheDir, + "TestNamespace.csproj", + packageName, + ns, + $"{packageName}.csproj"); + + await MockHelpers.LoadMockGeneratorAsync( + inputNamespaceName: ns, + outputPath: _projectDir, + configuration: $"{{\"package-name\": \"{packageName}\"}}"); + + var compilation = await GeneratedCodeWorkspace.LoadBaselineContract(); + + Assert.NotNull(compilation, "Compilation should not be null"); + Assert.NotNull(compilation!.GetTypeByMetadataName($"{ns}.SimpleType")); + } + [Test] public async Task AddPackageReferencesFromProject_AddsReferencesFromCsproj() { @@ -336,11 +360,18 @@ public class Placeholder {{ }} return dllPath; } - private void CreateTestAssemblyAndProjectFile(string nugetCacheDir, string csProjectFileName) + private void CreateTestAssemblyAndProjectFile( + string nugetCacheDir, + string csProjectFileName, + string? packageName = null, + string? namespaceName = null, + string? destinationProjectFileName = null) { - var ns = csProjectFileName.StartsWith("TestNamespaceUnevaluatedFrameworkValue") + var ns = namespaceName ?? (csProjectFileName.StartsWith("TestNamespaceUnevaluatedFrameworkValue") ? "TestNamespaceUnevaluatedFrameworkValue" - : "TestNamespace"; + : "TestNamespace"); + packageName ??= ns; + destinationProjectFileName ??= csProjectFileName; var syntaxTree = CSharpSyntaxTree.ParseText($@" namespace {ns} @@ -377,19 +408,19 @@ public void Foo(string p1) {{ }} Assert.Fail("Failed to open test project file."); } - var csProjDestination = Path.Combine(_projectDir!, "src", csProjectFileName); + var csProjDestination = Path.Combine(_projectDir!, "src", destinationProjectFileName); projectRoot!.Save(csProjDestination); var compilation = CSharpCompilation.Create( - ns, + packageName, [syntaxTree], references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); - var nugetPackageDir = Path.Combine(nugetCacheDir, ns.ToLowerInvariant(), version, "lib", "netstandard2.0"); + var nugetPackageDir = Path.Combine(nugetCacheDir, packageName.ToLowerInvariant(), version, "lib", "netstandard2.0"); Directory.CreateDirectory(nugetPackageDir); - var dllPath = Path.Combine(nugetPackageDir, $"{ns}.dll"); + var dllPath = Path.Combine(nugetPackageDir, $"{packageName}.dll"); var emitResult = compilation.Emit(dllPath); Assert.IsTrue(emitResult.Success, $"Failed to emit test assembly: ${string.Join(", ", emitResult.Diagnostics)}"); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs index 6f5eb048ce4..4a9a35dea67 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs @@ -4,6 +4,7 @@ // cspell:ignore readded using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.TypeSpec.Generator.Expressions; @@ -756,6 +757,97 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.AreEqual("Default", fields[1].Name); } + [Test] + public async Task BackCompat_FixedEnumUnderscoresPreserved() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var input = InputFactory.Int32Enum("mockInputEnum", [ + ("ExistingValue", 0), + ("Other", 1), + ]); + + var enumType = EnumProvider.Create(input); + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + Assert.AreEqual(2, fields.Count); + Assert.AreEqual("Existing_Value", fields[0].Name); + Assert.AreEqual("Other", fields[1].Name); + } + + [Test] + public async Task BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync(parameters: "Custom"), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(parameters: "Last")); + + var input = InputFactory.Int32Enum("mockInputEnum", [("ExistingValue", 0)]); + + var enumType = EnumProvider.Create(input); + Assert.IsNotNull(enumType.CustomCodeView); + Assert.AreEqual("ExistingValue", enumType.CustomCodeView!.Fields.Single().OriginalName); + Assert.AreEqual("Customized", enumType.CustomCodeView.Fields.Single().Name); + enumType.EnsureBuilt(); + enumType.Update( + enumType.Methods, + enumType.Constructors, + enumType.Properties, + enumType.Fields); + enumType.ProcessTypeForBackCompatibility(); + + Assert.AreEqual(0, enumType.Fields.Count); + } + + [Test] + public async Task BackCompat_FixedEnumAmbiguousUnderscoreMatchNotApplied() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(int), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var enumValues = new List(); + var input = InputFactory.Enum("mockInputEnum", InputPrimitiveType.Int32, enumValues); + enumValues.Add(InputFactory.EnumMember.Int32("ExistingValue", 0, input)); + enumValues.Add(InputFactory.EnumMember.Int32("Existing_Value", 1, input, isExactName: true)); + + var enumType = EnumProvider.Create(input); + enumType.EnsureBuilt(); + enumType.ProcessTypeForBackCompatibility(); + + var fields = enumType.Fields; + Assert.AreEqual(3, fields.Count); + Assert.AreEqual("Existing__Value", fields[0].Name); + Assert.AreEqual("ExistingValue", fields[1].Name); + Assert.AreEqual("Existing_Value", fields[2].Name); + } + + [Test] + public async Task BackCompat_ExtensibleEnumUnderscoresPreserved() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(string), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); + + var input = InputFactory.StringEnum("mockInputEnum", [ + ("ExistingValue", "existing"), + ("Other", "other"), + ], isExtensible: true); + + var enumType = EnumProvider.Create(input); + + Assert.AreEqual("_value", enumType.Fields[0].Name); + Assert.AreEqual("Existing_ValueValue", enumType.Fields[1].Name); + Assert.AreEqual("OtherValue", enumType.Fields[2].Name); + Assert.AreEqual("Existing_Value", enumType.Properties[0].Name); + Assert.AreEqual("Other", enumType.Properties[1].Name); + } + // Verifies that back-compat does NOT re-introduce enum values that have been suppressed // via [CodeGenSuppress] or that already exist in user-provided custom code. Without // filtering in ProcessTypeForBackCompatibility, the back-compat code would rebuild the diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumUnderscoresPreserved/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumUnderscoresPreserved/MockInputEnum.cs new file mode 100644 index 00000000000..5df3fb5b33a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumUnderscoresPreserved/MockInputEnum.cs @@ -0,0 +1,10 @@ +#nullable disable + +namespace Sample.Models +{ + public readonly partial struct MockInputEnum + { + public static MockInputEnum Existing_Value { get; } + public static MockInputEnum Other { get; } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumAmbiguousUnderscoreMatchNotApplied/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumAmbiguousUnderscoreMatchNotApplied/MockInputEnum.cs new file mode 100644 index 00000000000..d4ea71be54b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumAmbiguousUnderscoreMatchNotApplied/MockInputEnum.cs @@ -0,0 +1,9 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Existing__Value = 0, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs new file mode 100644 index 00000000000..10fecf72e12 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs @@ -0,0 +1,12 @@ +#nullable disable + +using Microsoft.TypeSpec.Generator.Customizations; + +namespace Sample.Models +{ + public enum MockInputEnum + { + [CodeGenMember("ExistingValue")] + Customized + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs new file mode 100644 index 00000000000..ae1454faa2b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumCustomizationTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs @@ -0,0 +1,9 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Existing_Value = 0 + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumUnderscoresPreserved/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumUnderscoresPreserved/MockInputEnum.cs new file mode 100644 index 00000000000..ba99f9670c2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_FixedEnumUnderscoresPreserved/MockInputEnum.cs @@ -0,0 +1,10 @@ +#nullable disable + +namespace Sample.Models +{ + public enum MockInputEnum + { + Existing_Value = 0, + Other = 1, + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/MockHelpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/MockHelpers.cs index 924b643ee08..df4e9ab513f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/MockHelpers.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/MockHelpers.cs @@ -90,9 +90,9 @@ public static Mock LoadMockGenerator( ResetCache(); outputPath = outputPath ?? Path.Combine(AppContext.BaseDirectory, TestHelpersFolder); - if (includeXmlDocs) + if (includeXmlDocs && configuration == null) { - configuration = "{\"disable-xml-docs\": false, \"package-name\": \"Sample.Namespace\"}"; + configuration = $"{{\"disable-xml-docs\": false, \"package-name\": \"{inputNamespaceName ?? "Sample.Namespace"}\"}}"; } // initialize the singleton instance of the generator var mockGenerator = new Mock(new GeneratorContext(Configuration.Load(outputPath, configuration))) { CallBase = true }; From 135189feb1e4dc5cc8424c6ed282e77e16e9c202 Mon Sep 17 00:00:00 2001 From: jenny <63012604+JennyPng@users.noreply.github.com> Date: Thu, 16 Jul 2026 13:01:00 -0700 Subject: [PATCH 016/249] [Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, pylint-guidelines-checker 0.5.9 (#11197) bumping check versions https://github.com/Azure/azure-sdk-for-python/pull/47920 also bump pylint guideline checker version from 0.5.2 to the latest 0.5.9 updates emitter for new rules - disable `no-cross-package-private-import` because it has false positives - suppress `docstring-keyword-should-match-keyword-only` for now, because we have some params like `api_version` that are in the docstring but not explicit parameters and only in kwargs - build keyword param lines for docstring - suppress `docstring-missing-param` check which flags undocumented args in signatures like `init(self, *args, **kwargs)` --- ...ring-guideline-checks-2026-7-14-11-30-0.md | 8 ++++++ .../changes/vnext-bump-2026-6-7-22-13-32.md | 8 ++++++ .../eng/scripts/ci/config/pylintrc | 6 ++++- .../eng/scripts/ci/dev_requirements.txt | 6 ++--- .../generator/pygen/codegen/models/client.py | 15 +++++++++++ .../pygen/codegen/models/operation_group.py | 2 ++ .../codegen/serializers/model_serializer.py | 25 ++++++++++++++++--- .../codegen/templates/model_base.py.jinja2 | 10 +++++++- .../codegen/templates/model_dpg.py.jinja2 | 5 ++++ .../codegen/templates/serialization.py.jinja2 | 6 ++++- packages/http-client-python/tests/tox.ini | 2 +- 11 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 .chronus/changes/python-docstring-guideline-checks-2026-7-14-11-30-0.md create mode 100644 .chronus/changes/vnext-bump-2026-6-7-22-13-32.md diff --git a/.chronus/changes/python-docstring-guideline-checks-2026-7-14-11-30-0.md b/.chronus/changes/python-docstring-guideline-checks-2026-7-14-11-30-0.md new file mode 100644 index 00000000000..a2ca29b89fc --- /dev/null +++ b/.chronus/changes/python-docstring-guideline-checks-2026-7-14-11-30-0.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@typespec/http-client-python" +--- + +[Python] Generate model/client/config docstrings and targeted pylint suppressions that satisfy the updated `azure-pylint-guidelines-checker` docstring checks (`docstring-keyword-should-match-keyword-only`, `docstring-missing-param`) diff --git a/.chronus/changes/vnext-bump-2026-6-7-22-13-32.md b/.chronus/changes/vnext-bump-2026-6-7-22-13-32.md new file mode 100644 index 00000000000..de10b60169f --- /dev/null +++ b/.chronus/changes/vnext-bump-2026-6-7-22-13-32.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: dependencies +packages: + - "@typespec/http-client-python" +--- + +[Python] Bump tool version targets: pylint 4.0.6, mypy 2.1.0, pyright 1.1.411, azure-pylint-guidelines-checker 0.5.9 diff --git a/packages/http-client-python/eng/scripts/ci/config/pylintrc b/packages/http-client-python/eng/scripts/ci/config/pylintrc index 387021335fc..b6d3d4604cc 100644 --- a/packages/http-client-python/eng/scripts/ci/config/pylintrc +++ b/packages/http-client-python/eng/scripts/ci/config/pylintrc @@ -16,8 +16,12 @@ enable=useless-suppression # cyclic-import: because of https://github.com/PyCQA/pylint/issues/850 # 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. +# no-cross-package-private-import: The guideline checker does not resolve relative +# imports (it ignores the import level), so legitimate same-package relative imports +# like `from ...operations._operations import ...` in generated async code are +# misreported as cross-package private imports. # Let's black deal with bad-continuation -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,unknown-option-value,file-needs-copyright-header,too-many-positional-arguments +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,unknown-option-value,file-needs-copyright-header,too-many-positional-arguments,no-cross-package-private-import [FORMAT] max-line-length=120 diff --git a/packages/http-client-python/eng/scripts/ci/dev_requirements.txt b/packages/http-client-python/eng/scripts/ci/dev_requirements.txt index adfd8faac20..a52b260b058 100644 --- a/packages/http-client-python/eng/scripts/ci/dev_requirements.txt +++ b/packages/http-client-python/eng/scripts/ci/dev_requirements.txt @@ -1,8 +1,8 @@ -pyright==1.1.407 -pylint==4.0.4 +pyright==1.1.411 +pylint==4.0.6 tox==4.16.0 tox-uv -mypy==1.19.1 +mypy==2.1.0 colorama==0.4.6 debugpy==1.8.2 pytest==9.0.3 diff --git a/packages/http-client-python/generator/pygen/codegen/models/client.py b/packages/http-client-python/generator/pygen/codegen/models/client.py index abb4d83c49d..82bdcdf1508 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/client.py +++ b/packages/http-client-python/generator/pygen/codegen/models/client.py @@ -53,6 +53,17 @@ def description(self) -> str: def name(self) -> str: return self.yaml_data["name"] + @property + def has_docstring_only_keyword(self) -> bool: + """Whether the constructor docstring documents a ``:keyword:`` that is not a real + keyword-only argument (it is popped from ``kwargs`` instead). + + This happens for params routed to ``**kwargs`` (e.g. ``api_version``): they are + still rendered as ``:keyword:`` in the docstring, so we must silence the + ``docstring-keyword-should-match-keyword-only`` guideline check. + """ + return any(p for p in self.parameters.method if p.method_location == ParameterMethodLocation.KWARG) + class Client(_ClientConfigBase[ClientGlobalParameterList]): """Model representing our service client""" @@ -187,6 +198,8 @@ def pylint_disable(self) -> str: retval = add_to_pylint_disable(retval, "too-many-instance-attributes") if len(self.name) > NAME_LENGTH_LIMIT: retval = add_to_pylint_disable(retval, "name-too-long") + if self.has_docstring_only_keyword or self.has_public_lro_operations: + retval = add_to_pylint_disable(retval, "docstring-keyword-should-match-keyword-only") return retval @property @@ -375,6 +388,8 @@ def pylint_disable(self) -> str: retval = add_to_pylint_disable("", "too-many-instance-attributes") if self.code_model.is_azure_flavor else "" if len(self.name) > NAME_LENGTH_LIMIT: retval = add_to_pylint_disable(retval, "name-too-long") + if self.has_docstring_only_keyword: + retval = add_to_pylint_disable(retval, "docstring-keyword-should-match-keyword-only") return retval @property diff --git a/packages/http-client-python/generator/pygen/codegen/models/operation_group.py b/packages/http-client-python/generator/pygen/codegen/models/operation_group.py index 5c0f467806c..798c7ae5b96 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/operation_group.py +++ b/packages/http-client-python/generator/pygen/codegen/models/operation_group.py @@ -82,6 +82,8 @@ def pylint_disable(self) -> str: retval: str = "" if self.has_abstract_operations: retval = add_to_pylint_disable(retval, "abstract-class-instantiated") + if not self.is_mixin: + retval = add_to_pylint_disable(retval, "docstring-missing-param") if len(self.operations) > 20: retval = add_to_pylint_disable(retval, "too-many-public-methods") if len(self.class_name) > NAME_LENGTH_LIMIT and self.class_name[0] != "_": diff --git a/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py b/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py index 87a0b2cc4aa..15e82108a89 100644 --- a/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py +++ b/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py @@ -23,7 +23,7 @@ ) from .import_serializer import FileImportSerializer from .base_serializer import BaseSerializer -from ..models.utils import NamespaceType +from ..models.utils import NamespaceType, add_to_pylint_disable def _get_xml_deserializer_name(prop: Property) -> Optional[str]: # pylint: disable=too-many-return-statements @@ -122,6 +122,15 @@ def input_documentation_string(prop: Property) -> list[str]: # building the param line of the property doc return _documentation_string(prop, "keyword", "paramtype") + def keyword_documentation_string(self, model: ModelType) -> list[str]: + # building the ``:keyword:``/``:paramtype:`` lines for the keyword-only + # arguments of the generated ``__init__`` overload so that the docstring + # keeps a 1:1 correlation with the keyword-only arguments in the signature. + retval: list[str] = [] + for prop in sorted(self._init_line_parameters(model), key=lambda x: x.optional): + retval.extend(self.input_documentation_string(prop)) + return retval + @staticmethod def variable_documentation_string(prop: Property) -> list[str]: return _documentation_string(prop, "ivar", "vartype") @@ -199,6 +208,16 @@ def pylint_disable_items(self, model: ModelType) -> list[str]: def pylint_disable(self, model: ModelType) -> str: return " # pylint: disable=" + ", ".join(self.pylint_disable_items(model)) + def class_pylint_disable(self, model: ModelType) -> str: + """Class-level pylint disables for the model declaration line.""" + retval = model.pylint_disable() + # When the model's only constructor is ``def __init__(self, *args, **kwargs)`` (i.e. no + # typed overload is generated), the guideline checker reports the ``*args`` vararg as an + # undocumented param. There is no meaningful param to document, so silence the check. + if not self.need_init(model) and self.initialize_properties(model): + retval = add_to_pylint_disable(retval, "docstring-missing-param") + return retval + def global_pylint_disables(self) -> str: return "" @@ -244,7 +263,7 @@ def declare_model(self, model: ModelType) -> str: ) if model.parents: basename = ", ".join([m.name for m in model.parents]) - return f"class {model.name}({basename}):{model.pylint_disable()}" + return f"class {model.name}({basename}):{self.class_pylint_disable(model)}" @staticmethod def get_properties_to_initialize(model: ModelType) -> list[Property]: @@ -407,7 +426,7 @@ def declare_model(self, model: ModelType) -> str: basename = ", ".join([m.name for m in model.parents]) if model.discriminator_value: basename += f", discriminator='{model.discriminator_value}'" - return f"class {model.name}({basename}):{model.pylint_disable()}" + return f"class {model.name}({basename}):{self.class_pylint_disable(model)}" @staticmethod def get_properties_to_declare(model: ModelType) -> list[Property]: 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 d6bb659a2ea..d34b069aed4 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 @@ -161,7 +161,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) diff --git a/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 b/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 index 8bcbbf4af41..6a2b533ae55 100644 --- a/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 +++ b/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 @@ -16,6 +16,11 @@ {% endfor %} {% endfor %} {% endif %} + {% if serializer.need_init(model) %} + {% for line in serializer.keyword_documentation_string(model) %} + {{ macros.wrap_model_string(line, '\n ') -}} + {% endfor %} + {% endif %} """ {% if model.is_polymorphic %} 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 65a9c1f8f9e..8194e5c1566 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 @@ -476,7 +476,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} diff --git a/packages/http-client-python/tests/tox.ini b/packages/http-client-python/tests/tox.ini index a94a60603e4..b661dd5afcd 100644 --- a/packages/http-client-python/tests/tox.ini +++ b/packages/http-client-python/tests/tox.ini @@ -69,7 +69,7 @@ deps = -r {tox_root}/requirements/azure.txt -e {tox_root}/../generator commands = - uv pip install azure-pylint-guidelines-checker==0.5.2 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" + uv pip install azure-pylint-guidelines-checker==0.5.9 --index-url="https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" python {tox_root}/install_packages.py azure {tox_root} python {tox_root}/../eng/scripts/ci/run_pylint.py -t azure -s generated {posargs} From 057a61fb05f23148604e71592c82bfbd150fa4bd Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Jul 2026 22:17:45 +0000 Subject: [PATCH 017/249] Fail http-client-csharp publish pipeline on step errors in manual runs (#11277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In `packages/http-client-csharp/eng/pipeline/publish.yml`, manual runs currently downgrade step failures to warnings (`SucceededWithIssues`) and still open a PR in `azure-sdk-for-net`, giving reviewers a false positive. Manual runs should instead fail the pipeline. ### Changes - **`Submit-AzureSdkForNetPr.ps1`** - Added `-BuildReason` parameter; sets `$FailOnError` when it equals `'Manual'`. - Added `Register-StepFailure` helper that records each downgraded failure and preserves the existing `##vso[task.complete result=SucceededWithIssues;]` signal. - Routed all previously swallowed failures through it — npm install/build, `Generate.ps1`, sparse-checkout expansion, Azure/mgmt generator builds, and per-service code generation (including their `catch` counterparts). - Before commit/PR creation, throws a summary of failures when `$FailOnError` is set; the existing outer `catch` converts this to `exit 1`, so **no PR is opened**. - **`publish.yml`**: passes `-BuildReason '$(Build.Reason)'`. Automated (scheduled/CI/main) runs are unchanged — they continue reporting `SucceededWithIssues` and proceed. ```powershell $FailOnError = $BuildReason -eq 'Manual' # ...steps use Register-StepFailure instead of Write-Warning + SucceededWithIssues... if ($FailOnError -and $script:StepFailures.Count -gt 0) { $failureSummary = ($script:StepFailures | ForEach-Object { "- $_" }) -join [Environment]::NewLine throw "One or more steps failed during a manual run; not creating a pull request:$([Environment]::NewLine)$failureSummary" } ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../eng/pipeline/publish.yml | 1 + .../eng/scripts/Submit-AzureSdkForNetPr.ps1 | 66 +++++++++++++------ 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/packages/http-client-csharp/eng/pipeline/publish.yml b/packages/http-client-csharp/eng/pipeline/publish.yml index e37e84583fb..8e480d9943f 100644 --- a/packages/http-client-csharp/eng/pipeline/publish.yml +++ b/packages/http-client-csharp/eng/pipeline/publish.yml @@ -250,6 +250,7 @@ extends: ${{ replace(replace('True', eq(parameters.RegenerateMgmtLibraries, false), ''), 'True', '-RegenerateMgmtLibraries') }} -BuildArtifactsPath '$(Pipeline.Workspace)/build_artifacts_csharp/packages' -UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }} + -BuildReason '$(Build.Reason)' - pwsh: | $npmrcPath = "$(Build.SourcesDirectory)/packages/http-client-csharp/.npmrc" diff --git a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 index 0ed2f4152e4..eb374f564c7 100755 --- a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 +++ b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 @@ -21,6 +21,8 @@ When specified, builds the management plane emitter locally and regenerates mgmt Path to the build artifacts directory containing the published .tgz and .nupkg files. Required when RegenerateAzureLibraries or RegenerateMgmtLibraries is specified. .PARAMETER PipelineRunUrl The URL of the pipeline run that triggered this PR. When provided, it is included in the PR description for traceability. +.PARAMETER BuildReason +The reason the pipeline was triggered (for example, 'Manual', 'Schedule', or 'IndividualCI'). When set to 'Manual', step failures fail the pipeline instead of being downgraded to warnings and opening a PR. #> [CmdletBinding(SupportsShouldProcess = $true)] param( @@ -55,9 +57,33 @@ param( [string]$PipelineRunUrl, [Parameter(Mandatory = $false)] - [switch]$UseTypeSpecNext + [switch]$UseTypeSpecNext, + + [Parameter(Mandatory = $false)] + [string]$BuildReason ) +# When the pipeline is triggered manually, failures should fail the pipeline with an +# error instead of being downgraded to warnings and still opening a PR, which gives a +# false positive to reviewers. For automated (scheduled/CI) runs, keep the existing +# behavior of reporting SucceededWithIssues and continuing. +$FailOnError = $BuildReason -eq 'Manual' + +# Tracks non-fatal step failures that were downgraded to warnings so a manual run can +# fail before creating a pull request. +$script:StepFailures = [System.Collections.Generic.List[string]]::new() + +function Register-StepFailure { + param( + [Parameter(Mandatory = $true)] + [string]$Message + ) + + $script:StepFailures.Add($Message) + Write-Warning $Message + Write-Host "##vso[task.complete result=SucceededWithIssues;]" +} + # Import the Generation module to use the Invoke helper function Import-Module (Join-Path $PSScriptRoot "Generation.psm1") -DisableNameChecking -Force # Import RegenPreview module for Update-AzureGenerator and Update-MgmtGenerator @@ -307,14 +333,13 @@ try { Write-Host "Running: npm install --verbose" Invoke "npm install --verbose" $httpClientDir if ($LASTEXITCODE -ne 0) { - Write-Warning "npm install failed with exit code $LASTEXITCODE, skipping generation." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "npm install failed with exit code $LASTEXITCODE, skipping generation." $installSucceeded = $false } else { Write-Host "##[section]npm install completed successfully" } } catch { - Write-Warning "npm install failed: $($_.Exception.Message), skipping generation." + Register-StepFailure "npm install failed: $($_.Exception.Message), skipping generation." $installSucceeded = $false } finally { @@ -333,12 +358,11 @@ try { try { Invoke "npm run build" $httpClientDir if ($LASTEXITCODE -ne 0) { - Write-Warning "npm run build failed with exit code $LASTEXITCODE, skipping Generate.ps1" - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "npm run build failed with exit code $LASTEXITCODE, skipping Generate.ps1" $shouldRunGenerate = $false } } catch { - Write-Warning "npm run build failed: $($_.Exception.Message), skipping Generate.ps1" + Register-StepFailure "npm run build failed: $($_.Exception.Message), skipping Generate.ps1" $shouldRunGenerate = $false } finally { $ErrorActionPreference = $previousErrorAction @@ -354,12 +378,10 @@ try { $generationScriptPath = Join-Path $tempDir "eng/packages/http-client-csharp/eng/scripts/Generate.ps1" Invoke "pwsh $generationScriptPath" if ($LASTEXITCODE -ne 0) { - Write-Warning "Generate.ps1 failed with exit code $LASTEXITCODE. Continuing with emitter artifact updates." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Generate.ps1 failed with exit code $LASTEXITCODE. Continuing with emitter artifact updates." } } catch { - Write-Warning "Generate.ps1 failed: $($_.Exception.Message). Continuing with emitter artifact updates." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Generate.ps1 failed: $($_.Exception.Message). Continuing with emitter artifact updates." } finally { $ErrorActionPreference = $previousErrorAction } @@ -435,8 +457,7 @@ try { Write-Host "Expanding sparse checkout to include sdk directory for SDK regeneration..." git sparse-checkout add sdk if ($LASTEXITCODE -ne 0) { - Write-Warning "Failed to expand sparse checkout. Skipping SDK regeneration." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Failed to expand sparse checkout. Skipping SDK regeneration." } else { # Build the emitter patterns to match in tsp-location.yaml $emitterPatterns = @("eng/http-client-csharp-emitter-package.json") @@ -525,8 +546,7 @@ try { Add-LocalNuGetSource -NuGetConfigPath $nugetConfigPath -SourcePath $debugFolder } } catch { - Write-Warning "Failed to build Azure generator: $($_.Exception.Message). Continuing without Azure library regeneration." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Failed to build Azure generator: $($_.Exception.Message). Continuing without Azure library regeneration." } finally { $ErrorActionPreference = $previousErrorAction } @@ -548,8 +568,7 @@ try { $emitterPatterns += "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json" } catch { - Write-Warning "Failed to build management plane generator: $($_.Exception.Message). Continuing without mgmt library regeneration." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Failed to build management plane generator: $($_.Exception.Message). Continuing without mgmt library regeneration." } finally { $ErrorActionPreference = $previousErrorAction } @@ -601,12 +620,10 @@ try { } Invoke $generateCommand $tempDir if ($LASTEXITCODE -ne 0) { - Write-Warning "Code generation failed for $serviceDirectory with exit code $LASTEXITCODE. Continuing with next service directory." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Code generation failed for $serviceDirectory with exit code $LASTEXITCODE. Continuing with next service directory." } } catch { - Write-Warning "Code generation failed for $serviceDirectory`: $($_.Exception.Message). Continuing with next service directory." - Write-Host "##vso[task.complete result=SucceededWithIssues;]" + Register-StepFailure "Code generation failed for $serviceDirectory`: $($_.Exception.Message). Continuing with next service directory." } finally { $ErrorActionPreference = $previousErrorAction } @@ -620,6 +637,13 @@ try { $dashboardScript = Join-Path $tempDir "doc/GeneratorVersions/Emitter_Version_Dashboard.ps1" & $dashboardScript -RepoRoot $tempDir + # For manual runs, fail the pipeline if any step reported a failure instead of + # opening a pull request that could give reviewers a false positive. + if ($FailOnError -and $script:StepFailures.Count -gt 0) { + $failureSummary = ($script:StepFailures | ForEach-Object { "- $_" }) -join [Environment]::NewLine + throw "One or more steps failed during a manual run; not creating a pull request:$([Environment]::NewLine)$failureSummary" + } + # Check if there are changes to commit $gitStatus = git status --porcelain if (-not $gitStatus) { From d31aefee2c7368831e93763f690fafb7c65b39b9 Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Fri, 17 Jul 2026 15:51:27 +0800 Subject: [PATCH 018/249] Fix per-client ServiceVersion regression in http-client-java (#11286) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Fixes per-client `ServiceVersion` regression ### Problem For a package containing multiple TypeSpec clients, the emitter is supposed to generate a **single shared `ServiceVersion` enum** (named after the package/service) when all clients use the same api-versions, and only fall back to a **per-client `ServiceVersion`** when the clients genuinely have different api-versions. Recently, multi-client packages started generating a separate `ServiceVersion` enum per client even when all clients share the same api-versions, e.g.: - `azure-search-documents`: `SearchServiceVersion` → `SearchIndexServiceVersion`, `SearchIndexerServiceVersion`, `KnowledgeBaseRetrievalServiceVersion` - `azure-developer-devcenter`: `DevCenterServiceVersion` → `DevCenterServiceVersion`, `DevBoxesServiceVersion`, `DeploymentEnvironmentsServiceVersion` - `azure-communication-messages`, `eventgrid-namespaces`, etc. ### Root cause In `code-model-builder.ts`, the "same api-versions for all clients" check was changed in #11134 (replacing `lodash.isEqual` with a built-in comparison): ```ts // before apiVersionSameForAllClients = isEqual(sharedApiVersions, apiVersions); // after apiVersionSameForAllClients = sharedApiVersions.length === apiVersions.length && sharedApiVersions.every((it, index) => it === apiVersions[index]); ``` `apiVersions` is `ApiVersion[]` (objects), not `string[]`. Each client builds its **own** `ApiVersion` instances: ```ts const apiVersion = new ApiVersion(); apiVersion.version = version.value; codeModelClient.apiVersions.push(apiVersion); ``` `lodash.isEqual` did a deep value comparison (equal versions → treated as equal), but `===` compares object references, which is always `false` for distinct instances. As a result `apiVersionSameForAllClients` became `false` for every multi-client package, triggering the per-client `ServiceVersion` branch. ### Fix Compare the api-version **strings** instead of the `ApiVersion` object references: ```ts apiVersionSameForAllClients = sharedApiVersions.length === apiVersions.length && sharedApiVersions.every((it, index) => it.version === apiVersions[index].version); ``` This restores a single shared `ServiceVersion` for multi-client packages whose clients use the same api-versions, while still producing per-client `ServiceVersion` enums when the api-versions actually differ. ### Notes - Draft: end-to-end generation/regression tests still to be run. - Related downstream regeneration: Azure/azure-sdk-for-java#49842. --- ...client-serviceversion-2026-7-17-11-10-0.md | 7 + .../emitter/src/code-model-builder.ts | 6 +- .../AlphaAsyncClient.java | 88 +++++ .../AlphaClient.java | 85 +++++ .../AlphaClientBuilder.java | 308 ++++++++++++++++++ .../BetaAsyncClient.java | 88 +++++ .../BetaClient.java | 85 +++++ .../BetaClientBuilder.java | 308 ++++++++++++++++++ ...tipleClientsSameVersionServiceVersion.java | 45 +++ .../implementation/AlphaClientImpl.java | 220 +++++++++++++ .../implementation/BetaClientImpl.java | 220 +++++++++++++ .../implementation/package-info.java | 10 + .../models/Resource.java | 105 ++++++ .../models/package-info.java | 10 + .../package-info.java | 10 + ...t-multipleclientssameversion_metadata.json | 1 + ...test-multipleclientssameversion.properties | 2 + .../generated/AlphaClientTestBase.java | 47 +++ .../tsp/multiple-clients-same-version.tsp | 53 +++ 19 files changed, 1697 insertions(+), 1 deletion(-) create mode 100644 .chronus/changes/fix-per-client-serviceversion-2026-7-17-11-10-0.md create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/Resource.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/tsptest-multipleclientssameversion.properties create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/multipleclientssameversion/generated/AlphaClientTestBase.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/tsp/multiple-clients-same-version.tsp diff --git a/.chronus/changes/fix-per-client-serviceversion-2026-7-17-11-10-0.md b/.chronus/changes/fix-per-client-serviceversion-2026-7-17-11-10-0.md new file mode 100644 index 00000000000..cc513156429 --- /dev/null +++ b/.chronus/changes/fix-per-client-serviceversion-2026-7-17-11-10-0.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-client-java" +--- + +Fix multi-client packages generating a separate `ServiceVersion` enum per client when all clients share the same api-versions. The api-version comparison now compares version strings instead of `ApiVersion` object references, restoring a single shared `ServiceVersion` for such packages. 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 0cfbd588a8d..a5672b10976 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -842,9 +842,13 @@ export class CodeModelBuilder { // first client, set it to sharedApiVersions sharedApiVersions = apiVersions; } else { + // Compare the api-version strings, not the ApiVersion object references. Each client + // builds its own ApiVersion instances (see `new ApiVersion()` above), so reference + // equality ("===") would always be false for clients that in fact share the same + // api-versions, incorrectly producing a separate ServiceVersion enum per client. apiVersionSameForAllClients = sharedApiVersions.length === apiVersions.length && - sharedApiVersions.every((it, index) => it === apiVersions[index]); + sharedApiVersions.every((it, index) => it.version === apiVersions[index].version); } if (!apiVersionSameForAllClients) { break; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java new file mode 100644 index 00000000000..8226df498a8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.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 tsptest.multipleclientssameversion; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; +import tsptest.multipleclientssameversion.implementation.AlphaClientImpl; +import tsptest.multipleclientssameversion.models.Resource; + +/** + * Initializes a new instance of the asynchronous AlphaClient type. + */ +@ServiceClient(builder = AlphaClientBuilder.class, isAsync = true) +public final class AlphaAsyncClient { + @Generated + private final AlphaClientImpl serviceClient; + + /** + * Initializes an instance of AlphaAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AlphaAsyncClient(AlphaClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The getAlpha operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAlphaWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getAlphaWithResponseAsync(id, requestOptions); + } + + /** + * The getAlpha operation. + * + * @param id The id parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAlpha(String id) { + // Generated convenience method for getAlphaWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAlphaWithResponse(id, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Resource.class)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClient.java new file mode 100644 index 00000000000..c8e309abce2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClient.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import tsptest.multipleclientssameversion.implementation.AlphaClientImpl; +import tsptest.multipleclientssameversion.models.Resource; + +/** + * Initializes a new instance of the synchronous AlphaClient type. + */ +@ServiceClient(builder = AlphaClientBuilder.class) +public final class AlphaClient { + @Generated + private final AlphaClientImpl serviceClient; + + /** + * Initializes an instance of AlphaClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + AlphaClient(AlphaClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The getAlpha operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAlphaWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getAlphaWithResponse(id, requestOptions); + } + + /** + * The getAlpha operation. + * + * @param id The id parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Resource getAlpha(String id) { + // Generated convenience method for getAlphaWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAlphaWithResponse(id, requestOptions).getValue().toObject(Resource.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java new file mode 100644 index 00000000000..80cf44e77d0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion; + +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; +import tsptest.multipleclientssameversion.implementation.AlphaClientImpl; + +/** + * A builder for creating a new instance of the AlphaClient type. + */ +@ServiceClientBuilder(serviceClients = { AlphaClient.class, AlphaAsyncClient.class }) +public final class AlphaClientBuilder 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("tsptest-multipleclientssameversion.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the AlphaClientBuilder. + */ + @Generated + public AlphaClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AlphaClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AlphaClientBuilder 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 logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AlphaClientBuilder 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 AlphaClientBuilder 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 AlphaClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AlphaClientBuilder 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 AlphaClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public AlphaClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private MultipleClientsSameVersionServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the AlphaClientBuilder. + */ + @Generated + public AlphaClientBuilder serviceVersion(MultipleClientsSameVersionServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + 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 AlphaClientBuilder. + */ + @Generated + public AlphaClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of AlphaClientImpl with the provided parameters. + * + * @return an instance of AlphaClientImpl. + */ + @Generated + private AlphaClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + MultipleClientsSameVersionServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : MultipleClientsSameVersionServiceVersion.getLatest(); + AlphaClientImpl client = new AlphaClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); + 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. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @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 AlphaAsyncClient class. + * + * @return an instance of AlphaAsyncClient. + */ + @Generated + public AlphaAsyncClient buildAsyncClient() { + return new AlphaAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of AlphaClient class. + * + * @return an instance of AlphaClient. + */ + @Generated + public AlphaClient buildClient() { + return new AlphaClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(AlphaClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java new file mode 100644 index 00000000000..690fc2052de --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.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 tsptest.multipleclientssameversion; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; +import tsptest.multipleclientssameversion.implementation.BetaClientImpl; +import tsptest.multipleclientssameversion.models.Resource; + +/** + * Initializes a new instance of the asynchronous BetaClient type. + */ +@ServiceClient(builder = BetaClientBuilder.class, isAsync = true) +public final class BetaAsyncClient { + @Generated + private final BetaClientImpl serviceClient; + + /** + * Initializes an instance of BetaAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + BetaAsyncClient(BetaClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The getBeta operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBetaWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getBetaWithResponseAsync(id, requestOptions); + } + + /** + * The getBeta operation. + * + * @param id The id parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBeta(String id) { + // Generated convenience method for getBetaWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getBetaWithResponse(id, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Resource.class)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClient.java new file mode 100644 index 00000000000..7e039a02d2c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClient.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import tsptest.multipleclientssameversion.implementation.BetaClientImpl; +import tsptest.multipleclientssameversion.models.Resource; + +/** + * Initializes a new instance of the synchronous BetaClient type. + */ +@ServiceClient(builder = BetaClientBuilder.class) +public final class BetaClient { + @Generated + private final BetaClientImpl serviceClient; + + /** + * Initializes an instance of BetaClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + BetaClient(BetaClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The getBeta operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBetaWithResponse(String id, RequestOptions requestOptions) { + return this.serviceClient.getBetaWithResponse(id, requestOptions); + } + + /** + * The getBeta operation. + * + * @param id The id parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Resource getBeta(String id) { + // Generated convenience method for getBetaWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getBetaWithResponse(id, requestOptions).getValue().toObject(Resource.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java new file mode 100644 index 00000000000..cc7a314c7c2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion; + +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; +import tsptest.multipleclientssameversion.implementation.BetaClientImpl; + +/** + * A builder for creating a new instance of the BetaClient type. + */ +@ServiceClientBuilder(serviceClients = { BetaClient.class, BetaAsyncClient.class }) +public final class BetaClientBuilder + 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("tsptest-multipleclientssameversion.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the BetaClientBuilder. + */ + @Generated + public BetaClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BetaClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BetaClientBuilder 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 logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BetaClientBuilder 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 BetaClientBuilder 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 BetaClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BetaClientBuilder 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 BetaClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public BetaClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private MultipleClientsSameVersionServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the BetaClientBuilder. + */ + @Generated + public BetaClientBuilder serviceVersion(MultipleClientsSameVersionServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + 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 BetaClientBuilder. + */ + @Generated + public BetaClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of BetaClientImpl with the provided parameters. + * + * @return an instance of BetaClientImpl. + */ + @Generated + private BetaClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + MultipleClientsSameVersionServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : MultipleClientsSameVersionServiceVersion.getLatest(); + BetaClientImpl client = new BetaClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); + 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. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @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 BetaAsyncClient class. + * + * @return an instance of BetaAsyncClient. + */ + @Generated + public BetaAsyncClient buildAsyncClient() { + return new BetaAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of BetaClient class. + * + * @return an instance of BetaClient. + */ + @Generated + public BetaClient buildClient() { + return new BetaClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(BetaClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java new file mode 100644 index 00000000000..095134cf068 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of MultipleClientsSameVersionClient. + */ +public enum MultipleClientsSameVersionServiceVersion implements ServiceVersion { + /** + * Enum value 2023-01-01. + */ + V2023_01_01("2023-01-01"), + + /** + * Enum value 2023-06-01. + */ + V2023_06_01("2023-06-01"); + + private final String version; + + MultipleClientsSameVersionServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link MultipleClientsSameVersionServiceVersion}. + */ + public static MultipleClientsSameVersionServiceVersion getLatest() { + return V2023_06_01; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java new file mode 100644 index 00000000000..bde42377dfa --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion.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.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.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; +import tsptest.multipleclientssameversion.MultipleClientsSameVersionServiceVersion; + +/** + * Initializes a new instance of the AlphaClient type. + */ +public final class AlphaClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final AlphaClientService service; + + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final MultipleClientsSameVersionServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public MultipleClientsSameVersionServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * 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 AlphaClient client. + * + * @param endpoint Service host. + * @param serviceVersion Service version. + */ + public AlphaClientImpl(String endpoint, MultipleClientsSameVersionServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of AlphaClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + * @param serviceVersion Service version. + */ + public AlphaClientImpl(HttpPipeline httpPipeline, String endpoint, + MultipleClientsSameVersionServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of AlphaClient 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. + * @param serviceVersion Service version. + */ + public AlphaClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + MultipleClientsSameVersionServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(AlphaClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for AlphaClient to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AlphaClient") + public interface AlphaClientService { + @Get("/alpha/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAlpha(@HostParam("endpoint") String endpoint, @PathParam("id") String id, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/alpha/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getAlphaSync(@HostParam("endpoint") String endpoint, @PathParam("id") String id, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * The getAlpha operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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> getAlphaWithResponseAsync(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAlpha(this.getEndpoint(), id, accept, requestOptions, context)); + } + + /** + * The getAlpha operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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 getAlphaWithResponse(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAlphaSync(this.getEndpoint(), id, accept, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java new file mode 100644 index 00000000000..95c3e234d70 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion.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.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.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; +import tsptest.multipleclientssameversion.MultipleClientsSameVersionServiceVersion; + +/** + * Initializes a new instance of the BetaClient type. + */ +public final class BetaClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final BetaClientService service; + + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final MultipleClientsSameVersionServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public MultipleClientsSameVersionServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * 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 BetaClient client. + * + * @param endpoint Service host. + * @param serviceVersion Service version. + */ + public BetaClientImpl(String endpoint, MultipleClientsSameVersionServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of BetaClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + * @param serviceVersion Service version. + */ + public BetaClientImpl(HttpPipeline httpPipeline, String endpoint, + MultipleClientsSameVersionServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of BetaClient 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. + * @param serviceVersion Service version. + */ + public BetaClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + MultipleClientsSameVersionServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(BetaClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for BetaClient to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "BetaClient") + public interface BetaClientService { + @Get("/beta/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getBeta(@HostParam("endpoint") String endpoint, @PathParam("id") String id, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/beta/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getBetaSync(@HostParam("endpoint") String endpoint, @PathParam("id") String id, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * The getBeta operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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> getBetaWithResponseAsync(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBeta(this.getEndpoint(), id, accept, requestOptions, context)); + } + + /** + * The getBeta operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param id The id parameter. + * @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 getBetaWithResponse(String id, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getBetaSync(this.getEndpoint(), id, accept, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java new file mode 100644 index 00000000000..a961a6627af --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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 MultipleClientsSameVersion. + * + */ +package tsptest.multipleclientssameversion.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/Resource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/Resource.java new file mode 100644 index 00000000000..f3ba1ffde74 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/Resource.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 tsptest.multipleclientssameversion.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 Resource model. + */ +@Immutable +public final class Resource implements JsonSerializable { + /* + * The id property. + */ + @Generated + private String id; + + /* + * The name property. + */ + @Generated + private final String name; + + /** + * Creates an instance of Resource class. + * + * @param name the name value to set. + */ + @Generated + private Resource(String name) { + 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("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Resource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Resource 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 Resource. + */ + @Generated + public static Resource 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(); + } + } + Resource deserializedResource = new Resource(name); + deserializedResource.id = id; + + return deserializedResource; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/package-info.java new file mode 100644 index 00000000000..17a1b65ad63 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/models/package-info.java @@ -0,0 +1,10 @@ +// 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 MultipleClientsSameVersion. + * + */ +package tsptest.multipleclientssameversion.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/package-info.java new file mode 100644 index 00000000000..b6fb73c3e32 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/multipleclientssameversion/package-info.java @@ -0,0 +1,10 @@ +// 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 MultipleClientsSameVersion. + * + */ +package tsptest.multipleclientssameversion; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json new file mode 100644 index 00000000000..5617f0fdbaa --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json @@ -0,0 +1 @@ +{"flavor":"Azure","apiVersions":{"TspTest.MultipleClientsSameVersion":"2023-06-01"},"crossLanguagePackageId":"TspTest.MultipleClientsSameVersion","crossLanguageVersion":"310aa2ab63d8","crossLanguageDefinitions":{"tsptest.multipleclientssameversion.AlphaAsyncClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClientBuilder":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.BetaAsyncClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaAsyncClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaAsyncClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClientBuilder":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.models.Resource":"TspTest.MultipleClientsSameVersion.Resource"},"generatedFiles":["src/main/java/module-info.java","src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java","src/main/java/tsptest/multipleclientssameversion/models/Resource.java","src/main/java/tsptest/multipleclientssameversion/models/package-info.java","src/main/java/tsptest/multipleclientssameversion/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/tsptest-multipleclientssameversion.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/tsptest-multipleclientssameversion.properties new file mode 100644 index 00000000000..ca812989b4f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/tsptest-multipleclientssameversion.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/multipleclientssameversion/generated/AlphaClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/multipleclientssameversion/generated/AlphaClientTestBase.java new file mode 100644 index 00000000000..8db368bb7f4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/multipleclientssameversion/generated/AlphaClientTestBase.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.multipleclientssameversion.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 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 tsptest.multipleclientssameversion.AlphaClient; +import tsptest.multipleclientssameversion.AlphaClientBuilder; +import tsptest.multipleclientssameversion.BetaClient; +import tsptest.multipleclientssameversion.BetaClientBuilder; + +class AlphaClientTestBase extends TestProxyTestBase { + protected AlphaClient alphaClient; + + protected BetaClient betaClient; + + @Override + protected void beforeTest() { + AlphaClientBuilder alphaClientbuilder + = new AlphaClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + alphaClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + alphaClient = alphaClientbuilder.buildClient(); + + BetaClientBuilder betaClientbuilder + = new BetaClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + betaClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + betaClient = betaClientbuilder.buildClient(); + + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/multiple-clients-same-version.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/multiple-clients-same-version.tsp new file mode 100644 index 00000000000..eafb6480733 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/tsp/multiple-clients-same-version.tsp @@ -0,0 +1,53 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@typespec/versioning"; +import "@azure-tools/typespec-client-generator-core"; + +using TypeSpec.Http; +using TypeSpec.Versioning; +using Azure.ClientGenerator.Core; + +// A single versioned service that is split into two clients (AlphaClient, BetaClient). Both +// clients therefore share the same set of api-versions. In this case the emitter must generate a +// SINGLE shared `MultipleClientsSameVersionServiceVersion` enum (named after the service), NOT a +// separate `ServiceVersion` per client. +// +// Regression test for the api-version comparison in code-model-builder.ts (getServiceVersion +// postprocess): comparing ApiVersion object references (with `===`) instead of the version +// strings incorrectly produced one ServiceVersion enum per client here, because each client +// builds its own ApiVersion instances. +@service(#{ title: "MultipleClientsSameVersion" }) +@versioned(ServiceApiVersions) +namespace TspTest.MultipleClientsSameVersion; + +enum ServiceApiVersions { + v2023_01_01: "2023-01-01", + v2023_06_01: "2023-06-01", +} + +model Resource { + @visibility(Lifecycle.Read) + id: string; + + name: string; +} + +@client({ + service: TspTest.MultipleClientsSameVersion, + name: "AlphaClient", +}) +@route("/alpha") +interface AlphaClient { + @get + getAlpha(@path id: string): Resource; +} + +@client({ + service: TspTest.MultipleClientsSameVersion, + name: "BetaClient", +}) +@route("/beta") +interface BetaClient { + @get + getBeta(@path id: string): Resource; +} From 8cef6d928a2ac3237d5eacb69b4ac671a54bcf92 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 17 Jul 2026 16:32:55 +0800 Subject: [PATCH 019/249] http-client-java, support clientApiVersions (#11290) fix https://github.com/Azure/typespec-azure/issues/4911 use local test, will add azure-http-specs next week also switched to devfeed to lock, dev may need to run `npx artifacts-npm-credprovider -c .npmrc` --- ...pi-version-init-kind-2026-6-17-14-21-20.md | 7 + .../http-client-java.instructions.md | 15 +- packages/http-client-java/.npmrc | 1 + packages/http-client-java/Setup.ps1 | 2 +- .../emitter/src/code-model-builder.ts | 26 + .../eng/scripts/Initialize-Repository.ps1 | 4 +- .../Setup.ps1 | 2 +- .../http-client-generator-test/Setup.ps1 | 2 +- packages/http-client-java/package-lock.json | 1960 +++++++++-------- 9 files changed, 1040 insertions(+), 979 deletions(-) create mode 100644 .chronus/changes/feat-client-api-version-init-kind-2026-6-17-14-21-20.md diff --git a/.chronus/changes/feat-client-api-version-init-kind-2026-6-17-14-21-20.md b/.chronus/changes/feat-client-api-version-init-kind-2026-6-17-14-21-20.md new file mode 100644 index 00000000000..41748039f53 --- /dev/null +++ b/.chronus/changes/feat-client-api-version-init-kind-2026-6-17-14-21-20.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/http-client-java" +--- + +Support clientApiVersions \ No newline at end of file diff --git a/.github/instructions/http-client-java.instructions.md b/.github/instructions/http-client-java.instructions.md index 2362bc4a8ec..1a99d2ff6a7 100644 --- a/.github/instructions/http-client-java.instructions.md +++ b/.github/instructions/http-client-java.instructions.md @@ -4,6 +4,7 @@ applyTo: "packages/http-client-java/**/*" - The directories mentioned in this instruction are relative to `/packages/http-client-java`. For example, the root is the folder `/packages/http-client-java`; the directory `generator/http-client-generator-test` refers to `/packages/http-client-java/generator/http-client-generator-test`. - Always use absolute paths when changing directories or running scripts. +- Whenever calling `npm`, use `--registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/`. # Update Node.js packages for latest dependencies @@ -11,7 +12,7 @@ Steps: 1. Run `ncu -u` on `package.json` in the root and on the two `package.json` files in `generator/http-client-generator-clientcore-test` and `generator/http-client-generator-test`. 2. Update package versions in `peerDependencies` (keep the semver ranges) in the root `package.json` to match the corresponding package versions listed in `devDependencies`. -3. Update package versions in `override` (keep the semver ranges) in the other two `package.json` files to match the corresponding package versions in the root `package.json`. +3. Update package versions in `overrides` (keep the semver ranges) in the other two `package.json` files to match the corresponding package versions in the root `package.json`. 4. Save the files and run `npm install` in the root so that `package-lock.json` is updated. 5. Commit the changes to `package.json` and `package-lock.json`. 6. If there is an update to the `http-specs` or `azure-http-specs` libraries, run `Generate.ps1` in `generator/http-client-generator-test` and commit the generated changes in that folder. @@ -34,9 +35,9 @@ The publish workflow (to NPM) will be automatically triggered after the PR is me Typical task: `add e2e test case for , scenario is `. -- The execution of `mvn` and `npm` command should be done in the test directory `/packages/http-client-java/generator/http-client-generator-test`. +- The execution of `mvn` and `npm` commands should be done in the test directory `/packages/http-client-java/generator/http-client-generator-test`. - Only commit Java files written by you. Do not commit any generated files. -- If no scenario URL provided, search the related files in either https://github.com/microsoft/typespec/tree/main/packages/http-specs/specs or https://github.com/Azure/typespec-azure/tree/main/packages/azure-http-specs/specs +- If no scenario URL is provided, search the related files in either https://github.com/microsoft/typespec/tree/main/packages/http-specs/specs or https://github.com/Azure/typespec-azure/tree/main/packages/azure-http-specs/specs 0. Run `pwsh Setup.ps1` in `generator/http-client-generator-test` to set up the environment if not done before. 1. The source files for the generated client under test are located in `generator/http-client-generator-test/src/main/java/`. @@ -44,9 +45,9 @@ Typical task: `add e2e test case for , scenario is `. 3. Read the Java model classes under `generator/http-client-generator-test/src/main/java//models` to understand the data types used by the APIs. 4. Read the TypeSpec file at the given `` to understand the scenario. The TypeSpec file contains the expected HTTP request and response in the `@scenarioDoc` decorator. 5. Optionally, check for a `client.tsp` in the same folder (replace `main.tsp` with `client.tsp` in the URL). Use it if present. -6. Review a few existing test cases in `generator/http-client-generator-test/src/test/java/` to learn the test structure and patterns used. Do not read file under `**/generated` folder. -7. Add a new test class in `generator/http-client-generator-test/src/test/java//` named `Tests.java`, following existing conventions. The test class should not extend other class. -8. Make sure compile pass (`mvn clean compile`). +6. Review a few existing test cases in `generator/http-client-generator-test/src/test/java/` to learn the test structure and patterns used. Do not read files under the `**/generated` folder. +7. Add a new test class in `generator/http-client-generator-test/src/test/java//` named `Tests.java`, following existing conventions. The test class should not extend any other class. +8. Make sure compilation passes (`mvn clean compile`). 9. Start Spector server by `npm run spector-start`. 10. Run the tests (`mvn test`). Make sure all tests pass. 11. Stop Spector server by `npm run spector-stop`. @@ -54,4 +55,4 @@ Typical task: `add e2e test case for , scenario is `. # Add feature or fix bug -- Run `npm run format` and commit the formatted code, before finalizing. Do not include any other changes in the commit. +- Run `npm run format` and commit the formatted code before finalizing. Do not include any other changes in the commit. diff --git a/packages/http-client-java/.npmrc b/packages/http-client-java/.npmrc index b6f27f13595..7b6b9c286b9 100644 --- a/packages/http-client-java/.npmrc +++ b/packages/http-client-java/.npmrc @@ -1 +1,2 @@ +registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ engine-strict=true diff --git a/packages/http-client-java/Setup.ps1 b/packages/http-client-java/Setup.ps1 index 9d9e3c0ae70..0b8113c6078 100644 --- a/packages/http-client-java/Setup.ps1 +++ b/packages/http-client-java/Setup.ps1 @@ -1,4 +1,4 @@ # re-build http-client-java -npm ci +npm ci --registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ npm run clean && npm run build npm pack 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 a5672b10976..45c7f96c285 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -71,6 +71,7 @@ import { SdkServiceMethod, SdkType, SdkUnionType, + UsageFlags, createSdkContext, getAllModels, getClientNameOverride, @@ -251,6 +252,9 @@ export class CodeModelBuilder { // the client), and as the constant value of the "api-version" parameter for ARM private apiVersion: string | undefined; + // enum types with UsageFlags.ApiVersionEnum, collected in processVersionEnum() + private apiVersionEnums: SdkEnumType[] = []; + public constructor(program1: Program, context: EmitContext) { this.options = context.options as EmitterOptionsDev; this.program = program1; @@ -362,6 +366,8 @@ export class CodeModelBuilder { this.options["group-etag-headers"] = false; } + this.processVersionEnum(); + this.processClients(); this.processModels(); @@ -641,6 +647,15 @@ export class CodeModelBuilder { } } + private processVersionEnum() { + this.apiVersionEnums = []; + for (const model of getAllModels(this.sdkContext)) { + if (model.kind === "enum" && model.usage & UsageFlags.ApiVersionEnum) { + this.apiVersionEnums.push(model); + } + } + } + private processClients() { // preprocess group-etag-headers @@ -724,6 +739,17 @@ export class CodeModelBuilder { apiVersion.version = version.value; codeModelClient.apiVersions.push(apiVersion); } + + // if there is exactly 1 api-version enum, use its values to override codeModelClient.apiVersions + // this is due to this issue in TCGC https://github.com/Azure/typespec-azure/issues/4914 + if (codeModelClient.apiVersions.length > 0 && this.apiVersionEnums.length === 1) { + codeModelClient.apiVersions = []; + for (const enumValue of this.apiVersionEnums[0].values) { + const apiVersion = new ApiVersion(); + apiVersion.version = String(enumValue.value ?? enumValue.name); + codeModelClient.apiVersions.push(apiVersion); + } + } } // client initialization diff --git a/packages/http-client-java/eng/scripts/Initialize-Repository.ps1 b/packages/http-client-java/eng/scripts/Initialize-Repository.ps1 index 7d110a040fe..41464881b10 100644 --- a/packages/http-client-java/eng/scripts/Initialize-Repository.ps1 +++ b/packages/http-client-java/eng/scripts/Initialize-Repository.ps1 @@ -77,13 +77,13 @@ try { Copy-Item "$lockFilesPath/emitter/package.json" './package.json' -Force Copy-Item "$lockFilesPath/emitter/package-lock.json" './package-lock.json' -Force - Invoke-LoggedCommand "npm ci" + Invoke-LoggedCommand "npm ci --registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" } elseif ($UseTypeSpecNext) { # TODO: add use typespec next to template later } else { - Invoke-LoggedCommand "npm ci" + Invoke-LoggedCommand "npm ci --registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/" } Invoke-LoggedCommand "npm ls -a" -GroupOutput diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/Setup.ps1 b/packages/http-client-java/generator/http-client-generator-clientcore-test/Setup.ps1 index 0505d057b07..2e8ec469282 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/Setup.ps1 +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/Setup.ps1 @@ -8,7 +8,7 @@ try { Push-Location $PSScriptRoot try { - npm run clean && npm install + npm run clean && npm install --registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ } finally { Pop-Location } diff --git a/packages/http-client-java/generator/http-client-generator-test/Setup.ps1 b/packages/http-client-java/generator/http-client-generator-test/Setup.ps1 index 97b4f96f39c..eb5eeb69d98 100644 --- a/packages/http-client-java/generator/http-client-generator-test/Setup.ps1 +++ b/packages/http-client-java/generator/http-client-generator-test/Setup.ps1 @@ -17,7 +17,7 @@ try { Push-Location $PSScriptRoot try { - npm run clean && npm install + npm run clean && npm install --registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ } finally { Pop-Location } diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json index 52a4b5d9f11..f735859f168 100644 --- a/packages/http-client-java/package-lock.json +++ b/packages/http-client-java/package-lock.json @@ -59,8 +59,8 @@ }, "node_modules/@autorest/codemodel": { "version": "4.20.1", - "resolved": "https://registry.npmjs.org/@autorest/codemodel/-/codemodel-4.20.1.tgz", - "integrity": "sha512-MdI4G0EdQ8yOxGzgT1rCOXxXkCrUQLjVykOvdAyByIgHbnpRop1UzUQuuKmXO8gQPSy7xwYhnfVSgETbHIJZgg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@autorest/codemodel/-/codemodel-4.20.1.tgz", + "integrity": "sha1-dEziYirn0vNQrVs4RwvGm3Q/ETg=", "license": "MIT", "dependencies": { "@azure-tools/codegen": "~2.10.1", @@ -70,28 +70,10 @@ "node": ">=12.0.0" } }, - "node_modules/@autorest/codemodel/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==", - "license": "Python-2.0" - }, - "node_modules/@autorest/codemodel/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@azure-tools/async-io": { "version": "3.0.254", - "resolved": "https://registry.npmjs.org/@azure-tools/async-io/-/async-io-3.0.254.tgz", - "integrity": "sha512-X1C7XdyCuo50ch9FzKtTvmK18FgDxxf1Bbt3cSoknQqeDaRegHSSCO+zByq2YA4NvUzKXeZ1engh29IDxZXgpQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/async-io/-/async-io-3.0.254.tgz", + "integrity": "sha1-PPgY3taol5fucBsul1v5pLlVrqA=", "license": "MIT", "dependencies": { "@azure-tools/tasks": "~3.0.255", @@ -103,8 +85,8 @@ }, "node_modules/@azure-tools/codegen": { "version": "2.10.1", - "resolved": "https://registry.npmjs.org/@azure-tools/codegen/-/codegen-2.10.1.tgz", - "integrity": "sha512-fZfREKjQnBTscjObgK4LuyZNFaofoCNQDNz0jl1i8fYNwCM5EOF9BXwtEtobuEyCpPUNDxQ/KKO65eWzirqk4w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/codegen/-/codegen-2.10.1.tgz", + "integrity": "sha1-mQSnZrDRWex2Hm298hT13VHbJhI=", "license": "MIT", "dependencies": { "@azure-tools/async-io": "~3.0.0", @@ -115,28 +97,10 @@ "node": ">=12.0.0" } }, - "node_modules/@azure-tools/codegen/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==", - "license": "Python-2.0" - }, - "node_modules/@azure-tools/codegen/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@azure-tools/tasks": { "version": "3.0.255", - "resolved": "https://registry.npmjs.org/@azure-tools/tasks/-/tasks-3.0.255.tgz", - "integrity": "sha512-GjALNLz7kWMEdRVbaN5g0cJHNAr3XVTbP0611Mv2UzMgGL6FOhNZJK+oPHJKLDR8EEDZNnkwPlyi7B+INXUSQA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/tasks/-/tasks-3.0.255.tgz", + "integrity": "sha1-0Uwdh2AmxCy74admEZ22cZO5Fj8=", "license": "MIT", "engines": { "node": ">=10.12.0" @@ -144,8 +108,8 @@ }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.70.0.tgz", - "integrity": "sha512-OaxLkgMcuOXAbaqTNpezmFF24jtkiIH1+2PBwAeRo3ZG7C1r7Hf8xZwCK6KVtBEgMbqnrd5eCqxsPl1zy3y9/Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-autorest/-/typespec-autorest-0.70.0.tgz", + "integrity": "sha1-hxXdmTz6UUqpPXEGLwyRUHHNt38=", "dev": true, "license": "MIT", "dependencies": { @@ -173,8 +137,8 @@ }, "node_modules/@azure-tools/typespec-azure-core": { "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", - "integrity": "sha512-8MojHWRtTLKycJJ98IMoXX/5b9tTo3F0d3Iu20OKoCsORnSDG2NfjOWHJVW63oxA2t8VTlqC6J8BDcnRihygQQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", + "integrity": "sha1-k3VYRkt7yNAA1kiBElz71YbZH7A=", "dev": true, "license": "MIT", "engines": { @@ -188,8 +152,8 @@ }, "node_modules/@azure-tools/typespec-azure-resource-manager": { "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.70.0.tgz", - "integrity": "sha512-hVrbbsOhU3EQ2yQTppCqsGQwY/HcVZPOINtFkoUo+PUVBmCFXyqLkTO4jvUbsp/LvJEwoQ8aEA8Y35f7VWT5uw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.70.0.tgz", + "integrity": "sha1-+Skz0cnW1LADE60g/JnqYk0nixg=", "dev": true, "license": "MIT", "dependencies": { @@ -210,8 +174,8 @@ }, "node_modules/@azure-tools/typespec-azure-rulesets": { "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.70.0.tgz", - "integrity": "sha512-Uxxl/18oryDwk2S+aYx6cIqiyjmoMeFDGmjuQ72a+aw6u8mZjgahMxNsY0ShvGLSchjsDqsVGaUlazXGXakVrw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.70.0.tgz", + "integrity": "sha1-/iCKSwMs+gWfYYd9UTZFo/AXjrQ=", "dev": true, "license": "MIT", "engines": { @@ -226,8 +190,8 @@ }, "node_modules/@azure-tools/typespec-client-generator-core": { "version": "0.70.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", - "integrity": "sha512-8yxOYJfID3wp3FLQYNIa3kbmR5YLWjYtpB+i4u66quHTTQWWANHV1/o9f8xymAf+8fO9jbLo5tw1JerumxISWg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", + "integrity": "sha1-k7nEgErM8Vd5PRVdaR8rfSPFpic=", "dev": true, "license": "MIT", "dependencies": { @@ -252,22 +216,22 @@ } }, "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==", + "version": "2.2.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/abort-controller/-/abort-controller-2.2.0.tgz", + "integrity": "sha1-k+DoKwGGLn6jtbaZWHGdPz/SyKw=", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-auth": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.10.1.tgz", - "integrity": "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg==", + "version": "1.11.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-auth/-/core-auth-1.11.0.tgz", + "integrity": "sha1-Ha7/32LRqHHSK4ZfnzFkpj6h9XU=", "dev": true, "license": "MIT", "dependencies": { @@ -276,13 +240,13 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-client": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.10.2.tgz", - "integrity": "sha512-1D2LpsU7y9xrqKjdIbsB7PlrRePw0xsVV8p+AKTlzITrWmscajryfJCdDJB/oGwvDI5HmRo04eMMADB67uwAwQ==", + "version": "1.11.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-client/-/core-client-1.11.0.tgz", + "integrity": "sha1-5z0JrHl33l17QVaWt+1F0/3rZ7A=", "dev": true, "license": "MIT", "dependencies": { @@ -295,20 +259,20 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-http-compat": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.4.0.tgz", - "integrity": "sha512-f1P96IB399YiN2ARYHP7EpZi3Bf3wH4SN2lGzrw7JVwm7bbsVYtf2iKSBwTywD2P62NOPZGHFSZi+6jjb75JuA==", + "version": "2.5.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-http-compat/-/core-http-compat-2.5.0.tgz", + "integrity": "sha1-14BmGln4pDL+yyt8b6LVgi3KHeo=", "dev": true, "license": "MIT", "dependencies": { "@azure/abort-controller": "^2.1.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" }, "peerDependencies": { "@azure/core-client": "^1.10.0", @@ -317,8 +281,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-lro/-/core-lro-2.7.2.tgz", + "integrity": "sha1-eHEFAnog5Fx3ZRqYsBpNOwG3Wgg=", "dev": true, "license": "MIT", "dependencies": { @@ -332,22 +296,22 @@ } }, "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==", + "version": "1.7.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-paging/-/core-paging-1.7.0.tgz", + "integrity": "sha1-WVl6L1Q4ujxsh4n8hw9p4OeFMag=", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.24.0.tgz", - "integrity": "sha512-PpLsoDQ3AMmKZ0VU+0GrmqMxgp/sExjlVm4R+nLWngeoEGAzOIPVifaxKGU5gMv+nWELUoHfvrolWD+ZS/nFJg==", + "version": "1.25.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", + "integrity": "sha1-kupJEu27H3OV9IKaMAYxF0qoLwg=", "dev": true, "license": "MIT", "dependencies": { @@ -360,26 +324,26 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-tracing": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.3.1.tgz", - "integrity": "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ==", + "version": "1.4.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-tracing/-/core-tracing-1.4.0.tgz", + "integrity": "sha1-1lenAOJNJW0ZXmKKeV22qMxHXqs=", "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-util": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.13.1.tgz", - "integrity": "sha512-XPArKLzsvl0Hf0CaGyKHUyVgF7oDnhKoP85Xv6M4StF/1AhfORhZudHtOyf2s+FcbuQ9dPRAjB8J2KvRRMUK2A==", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-util/-/core-util-1.14.0.tgz", + "integrity": "sha1-fOn+V5WPEy3UIlc4VuWkXHIyuwQ=", "dev": true, "license": "MIT", "dependencies": { @@ -388,13 +352,13 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/core-xml": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.5.1.tgz", - "integrity": "sha512-xcNRHqCoSp4AunOALEae6A8f3qATb83gSrm31Iqb01OzblvC3/W/bfXozcq78EzIdzZzuH1bZ2NvRR0TdX709w==", + "version": "1.6.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/core-xml/-/core-xml-1.6.0.tgz", + "integrity": "sha1-EI8JIOG834owuffoh5ibOhIIK9k=", "dev": true, "license": "MIT", "dependencies": { @@ -402,13 +366,13 @@ "tslib": "^2.8.1" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/identity": { "version": "4.13.1", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.13.1.tgz", - "integrity": "sha512-5C/2WD5Vb1lHnZS16dNQRPMjN6oV/Upba+C9nBIs15PmOi6A3ZGs4Lr2u60zw4S04gi+u3cEXiqTVP7M4Pz3kw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/identity/-/identity-4.13.1.tgz", + "integrity": "sha1-vcCRZYuqWaR+6furSHpLsBhym8M=", "dev": true, "license": "MIT", "dependencies": { @@ -429,9 +393,9 @@ } }, "node_modules/@azure/logger": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.3.0.tgz", - "integrity": "sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA==", + "version": "1.4.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/logger/-/logger-1.4.0.tgz", + "integrity": "sha1-PVpif+WaJ27OdIenndkq1cUIwzk=", "dev": true, "license": "MIT", "dependencies": { @@ -439,26 +403,26 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@azure/msal-browser": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-5.15.0.tgz", - "integrity": "sha512-2NYT6v+eeQn8kmNddr9LnbXSvXbVELpmFMmfFvtRxD7I/5+5GlkMlncApeuRFj+mY6C9syOwQip1a0Y+TIbyiA==", + "version": "5.17.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/msal-browser/-/msal-browser-5.17.1.tgz", + "integrity": "sha1-EozjSq27IGyUDpnKXgzxldEsbfw=", "dev": true, "license": "MIT", "dependencies": { - "@azure/msal-common": "16.10.0" + "@azure/msal-common": "16.11.2" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "16.10.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-16.10.0.tgz", - "integrity": "sha512-iYtjpanlv6963Jprs0MvzIap07V+QhultjQctfbEDQCflsDAEeO3R7XnVA5gk30fhoBFLdgJT7VqO0TGsEsN9w==", + "version": "16.11.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/msal-common/-/msal-common-16.11.2.tgz", + "integrity": "sha1-bLo7L5utC9sH7o37+nLv9Lo2nDA=", "dev": true, "license": "MIT", "engines": { @@ -466,13 +430,13 @@ } }, "node_modules/@azure/msal-node": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-5.3.0.tgz", - "integrity": "sha512-fXtJX811pX8y8QlrQqBSH6+plvWyKZDI0IxkheAcyAw9OtcpXyFivmTC7eGUqutLWaDlKXuQ3yOESD4zAmkjHg==", + "version": "5.4.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/msal-node/-/msal-node-5.4.1.tgz", + "integrity": "sha1-PWogGDnMfAogM9lqLW7pEXYcrMs=", "dev": true, "license": "MIT", "dependencies": { - "@azure/msal-common": "16.10.0", + "@azure/msal-common": "16.11.2", "jsonwebtoken": "^9.0.0" }, "engines": { @@ -481,8 +445,8 @@ }, "node_modules/@azure/storage-blob": { "version": "12.31.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.31.0.tgz", - "integrity": "sha512-DBgNv10aCSxopt92DkTDD0o9xScXeBqPKGmR50FPZQaEcH4JLQ+GEOGEDv19V5BMkB7kxr+m4h6il/cCDPvmHg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/storage-blob/-/storage-blob-12.31.0.tgz", + "integrity": "sha1-l7Cb4r9qtZc5uGLt2BJHmDYs5yA=", "dev": true, "license": "MIT", "dependencies": { @@ -507,8 +471,8 @@ }, "node_modules/@azure/storage-common": { "version": "12.4.1", - "resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.4.1.tgz", - "integrity": "sha512-t14unw/WofGDUi7TKJrsyXyPsN+NLgRm7hMaq0llxNmTIzt7f257+6LE6FKIJPh88zLj6M7LPvzve0fEYg/L3A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure/storage-common/-/storage-common-12.4.1.tgz", + "integrity": "sha1-eMI6si3QTOJ7E9/omRtFtv3ts0U=", "dev": true, "license": "MIT", "dependencies": { @@ -528,8 +492,8 @@ }, "node_modules/@babel/code-frame": { "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha1-8vu/6ofESiFZDsUVt3iywm2IZuc=", "dev": true, "license": "MIT", "dependencies": { @@ -543,8 +507,8 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", - "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha1-fwhx2Zgk0jE31g+G/PYTD9WhtR8=", "dev": true, "license": "MIT", "engines": { @@ -553,8 +517,8 @@ }, "node_modules/@babel/helper-validator-identifier": { "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", - "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha1-vYcITO0MeW7Ea9pJLeboPSnon8I=", "dev": true, "license": "MIT", "engines": { @@ -563,8 +527,8 @@ }, "node_modules/@babel/parser": { "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha1-g3uHOHy/XsVTDLY0s8Yi9o7bkzQ=", "dev": true, "license": "MIT", "dependencies": { @@ -579,8 +543,8 @@ }, "node_modules/@babel/types": { "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha1-gAXjHYJxLuetrvbiPGO3GmJ3CpI=", "dev": true, "license": "MIT", "dependencies": { @@ -593,8 +557,8 @@ }, "node_modules/@bcoe/v8-coverage": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", - "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", + "integrity": "sha1-u+EtyltO+YOg0K9LB7m8kOoKuro=", "dev": true, "license": "MIT", "engines": { @@ -603,8 +567,8 @@ }, "node_modules/@emnapi/core": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", - "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha1-ueEGTzprFjHiQeY460jXNr/TcqY=", "dev": true, "license": "MIT", "optional": true, @@ -615,8 +579,8 @@ }, "node_modules/@emnapi/runtime": { "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", - "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha1-WPHz1dgamxL3k6tojJY3GQECfCQ=", "dev": true, "license": "MIT", "optional": true, @@ -626,8 +590,8 @@ }, "node_modules/@emnapi/wasi-threads": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", - "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha1-TJO+z1v6OxPRu9zAau44MhrYE5o=", "dev": true, "license": "MIT", "optional": true, @@ -637,8 +601,8 @@ }, "node_modules/@inquirer/ansi": { "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-2.0.7.tgz", - "integrity": "sha512-3eTuUO1vH2cZm2ZKHeQxnOqlTi9EfZDGgIe3BL3I4u+rJHocr9Fz86M4fjYABPvFnQG/gGK551HqDiIcETwU6Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/ansi/-/ansi-2.0.7.tgz", + "integrity": "sha1-ht4igQysPtQG7BD41mAWgVuCJrQ=", "dev": true, "license": "MIT", "engines": { @@ -647,8 +611,8 @@ }, "node_modules/@inquirer/checkbox": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.2.1.tgz", - "integrity": "sha512-b6xmA/VlTe0ZgDQHDui+Nav470u7u49nRd8/iuhOcQPO9Ch7lGuogydhi2VOmNlZ+zXcM8IcPuNSwQcdJaF/kw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/checkbox/-/checkbox-5.2.1.tgz", + "integrity": "sha1-fxSLMVOnds7iAgFbEPmphQaNGI0=", "dev": true, "license": "MIT", "dependencies": { @@ -671,8 +635,8 @@ }, "node_modules/@inquirer/confirm": { "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.1.1.tgz", - "integrity": "sha512-eb8DBZcz/2qHWQda4rk2JiQk5h9QV/cVHi1yjt0f69WFZMRFn0sJTye3EAP8icut8UDMjQPsaH5KbcOogefrFQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/confirm/-/confirm-6.1.1.tgz", + "integrity": "sha1-nGp9ecYTKyr1f9t1dH8FYgTlU1Y=", "dev": true, "license": "MIT", "dependencies": { @@ -693,8 +657,8 @@ }, "node_modules/@inquirer/core": { "version": "11.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.2.1.tgz", - "integrity": "sha512-Qd6GJT1yVyrZZCfN8W2qKF5ApmqryXRhRKCuip8h01x2w/esJQ2XIYc6f9abMIHgKQdBfFTSOdbHRLAhuM09UA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/core/-/core-11.2.1.tgz", + "integrity": "sha1-VMzY99R4UhQLYGbL131jssKxaP0=", "dev": true, "license": "MIT", "dependencies": { @@ -720,8 +684,8 @@ }, "node_modules/@inquirer/editor": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.2.2.tgz", - "integrity": "sha512-ZRVd/oD+sYsUd5zVm0NflqEzlqfYCyHNsqkHl2oWXEUHs12tCbcSFi+wVFEvD8+LGRaMUsVrE7qeo6lSG/S1Vg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/editor/-/editor-5.2.2.tgz", + "integrity": "sha1-fHPi/A571MQM/TihgK5bvSTTK5A=", "dev": true, "license": "MIT", "dependencies": { @@ -743,8 +707,8 @@ }, "node_modules/@inquirer/expand": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.1.1.tgz", - "integrity": "sha512-YmQpenjbFSHAK3sOd44puHh3V1KXXr+JiNpUztoSQ4drLh2rTVzTap/YtlAVu/5xavifIlBfNEzJ/neZJ1a/1g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/expand/-/expand-5.1.1.tgz", + "integrity": "sha1-4q/qwkfZfdZO4YqoHpAr3R/g6nA=", "dev": true, "license": "MIT", "dependencies": { @@ -765,8 +729,8 @@ }, "node_modules/@inquirer/external-editor": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-6thf5I8q7lZwzGLAxPaaGEREEkZ3nyePPDQ1oyobblxmEE8mqTLguScP7pDjUTAibiyb4hfXl+qjUEJ+di/aNA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha1-1553JULPjTQGQunavToep/WjAQQ=", "dev": true, "license": "MIT", "dependencies": { @@ -787,8 +751,8 @@ }, "node_modules/@inquirer/figures": { "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-2.0.7.tgz", - "integrity": "sha512-aJ8TBPOGB6f/2qziPfElISTCEd5XOYTFckA2SGjhNmiKzfK/u4ot3v0DUzGVdUnKjN10EqnnEPck36BkyfLnJw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/figures/-/figures-2.0.7.tgz", + "integrity": "sha1-9cxYQ3MqgTBNBqDbS1PMfb2hVUE=", "dev": true, "license": "MIT", "engines": { @@ -797,8 +761,8 @@ }, "node_modules/@inquirer/input": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.1.2.tgz", - "integrity": "sha512-9K/DDBSQpOyZSkt6sOVP9Vo0TR7atX2kuILsUu0x3wVcVbe97lJwIJKMLdMw25tDYuXl/qp6erT0Xs1rfmcfZg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/input/-/input-5.1.2.tgz", + "integrity": "sha1-kwXLFw38OlMj5erIhalF583dXEs=", "dev": true, "license": "MIT", "dependencies": { @@ -819,8 +783,8 @@ }, "node_modules/@inquirer/number": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.1.1.tgz", - "integrity": "sha512-XF4IXAbPnGPgw0wsbC/i2tPcyfdZgDpUlhsqU0SfT4IRIGWha6Xm9VRgN5yYxJq+jnyXlfXI/nQ3ulfk0iEICA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/number/-/number-4.1.1.tgz", + "integrity": "sha1-sTNmjY4OCZtBM6u5FSIVAeD/ddc=", "dev": true, "license": "MIT", "dependencies": { @@ -841,8 +805,8 @@ }, "node_modules/@inquirer/password": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.1.1.tgz", - "integrity": "sha512-3XBfF7DAsp5qeDsvN5Rd1HmbNokVvEQoUM0QLrRcybC9nX96w3Pbmu7qUsb3IT3J3jBvs2+mTXaKHOUsgHMLzg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/password/-/password-5.1.1.tgz", + "integrity": "sha1-8h77YU2pyQUJUmL1F4H9KnIfzqw=", "dev": true, "license": "MIT", "dependencies": { @@ -864,8 +828,8 @@ }, "node_modules/@inquirer/prompts": { "version": "8.5.2", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.5.2.tgz", - "integrity": "sha512-IYR/3C/paEVVQYQvdDlFZVjRCJVYHHON0XXMH91KO9GSxs0TdKYWlUdvfQl2EfAHDxUaN3IBffkE/BDTh5nJ6g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/prompts/-/prompts-8.5.2.tgz", + "integrity": "sha1-CcATKtoru6lMkdNBEV4eQcs/FSU=", "dev": true, "license": "MIT", "dependencies": { @@ -894,8 +858,8 @@ }, "node_modules/@inquirer/rawlist": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.3.1.tgz", - "integrity": "sha512-QqdTqQddL3qPX/PPrjobpsO25NZ4dWXgTLenrR445L2ptLEYE6Z+PD5c5CNDJNx4ugRgELAIpSIJxZaO2jJ2Og==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/rawlist/-/rawlist-5.3.1.tgz", + "integrity": "sha1-Zva45qqC1HOZxDO4JiEo58Gk+c4=", "dev": true, "license": "MIT", "dependencies": { @@ -916,8 +880,8 @@ }, "node_modules/@inquirer/search": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.2.1.tgz", - "integrity": "sha512-xJj8QWKRSrfKoBIITLZK61dD3zwo0Rz11fgDImku30/Oe81zMdIdGgrLY2h6RkJ+KZ/GhNYIRMKnH/62qBTA5g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/search/-/search-4.2.1.tgz", + "integrity": "sha1-yPS3irP4Zv3wUD+sDNCMSmZhwR4=", "dev": true, "license": "MIT", "dependencies": { @@ -939,8 +903,8 @@ }, "node_modules/@inquirer/select": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.2.1.tgz", - "integrity": "sha512-FlDndEUww8m7BfukO2nJa25vhD+H5jxxCv4oGioKqzyWz3nPHhhw4LKdYRSlXuAx7DsdWia7iyaBPKKS95Evfw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/select/-/select-5.2.1.tgz", + "integrity": "sha1-OgXnbljZ4bsJXpEsPnCTqgTNRgQ=", "dev": true, "license": "MIT", "dependencies": { @@ -963,8 +927,8 @@ }, "node_modules/@inquirer/type": { "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-4.0.7.tgz", - "integrity": "sha512-t28inv14nMQ1PhKpsJPY+kEs/c00qzeCOS2gTNRyTjG5d6qsVA2fItxW4hkvGZ5lvanGLdtCzVIx5dwdRpN1+g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@inquirer/type/-/type-4.0.7.tgz", + "integrity": "sha1-nG8NhX/mrVSaOpMjQ7ZOdqyzSxA=", "dev": true, "license": "MIT", "engines": { @@ -981,8 +945,8 @@ }, "node_modules/@isaacs/fs-minipass": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", - "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha1-LVmuOrSzj7QnC/oj0w+OLobH/jI=", "dev": true, "license": "ISC", "dependencies": { @@ -994,8 +958,8 @@ }, "node_modules/@istanbuljs/schema": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", - "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha1-jcmvoqwVBssaWPiZQPHBJERsjfM=", "dev": true, "license": "MIT", "engines": { @@ -1004,8 +968,8 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha1-eg7mAfYPmaIMfHxf8MgDiMEYm9Y=", "dev": true, "license": "MIT", "engines": { @@ -1014,15 +978,15 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha1-aRKwDSxjHA0Vzhp6tXzWV/Ko+Lo=", "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha1-2xXWeByTHzolGj2sOVAcmKYIL9A=", "dev": true, "license": "MIT", "dependencies": { @@ -1031,19 +995,19 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.58.9", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.58.9.tgz", - "integrity": "sha512-S2UF4yza5GoxCmf7hJQNxJNZN9ltOVuOQv8Dy+Z21aol5ERoBNMdWcQHm4MJMPPItW4H/4rZD906iaf4mUojJA==", + "version": "7.58.10", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@microsoft/api-extractor/-/api-extractor-7.58.10.tgz", + "integrity": "sha1-Q5DD6kxOxfKRZpk2FmBG7ajPvVM=", "dev": true, "license": "MIT", "dependencies": { - "@microsoft/api-extractor-model": "7.33.8", + "@microsoft/api-extractor-model": "7.33.9", "@microsoft/tsdoc": "~0.16.0", "@microsoft/tsdoc-config": "~0.18.1", - "@rushstack/node-core-library": "5.23.1", + "@rushstack/node-core-library": "5.23.2", "@rushstack/rig-package": "0.7.3", - "@rushstack/terminal": "0.24.0", - "@rushstack/ts-command-line": "5.3.10", + "@rushstack/terminal": "0.24.1", + "@rushstack/ts-command-line": "5.3.11", "diff": "~8.0.2", "minimatch": "10.2.3", "resolve": "~1.22.1", @@ -1056,21 +1020,21 @@ } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.33.8", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.33.8.tgz", - "integrity": "sha512-aIcoQggPyer3B6Ze3usz0YWC/oBwUHfRH5ETUsr+oT2BRA6SfTJl7IKPcPZkX4UR+PohowzW4uMxsvjrn8vm+w==", + "version": "7.33.9", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@microsoft/api-extractor-model/-/api-extractor-model-7.33.9.tgz", + "integrity": "sha1-wQBN5h/hv2s/52MgDeG5YJtFwc8=", "dev": true, "license": "MIT", "dependencies": { "@microsoft/tsdoc": "~0.16.0", "@microsoft/tsdoc-config": "~0.18.1", - "@rushstack/node-core-library": "5.23.1" + "@rushstack/node-core-library": "5.23.2" } }, "node_modules/@microsoft/api-extractor/node_modules/semver": { "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/semver/-/semver-7.7.4.tgz", + "integrity": "sha1-KEZONgYOmR+noR0CedLT87V6foo=", "dev": true, "license": "ISC", "bin": { @@ -1082,8 +1046,8 @@ }, "node_modules/@microsoft/api-extractor/node_modules/typescript": { "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha1-W09Z4VMQqxeiFvXWz1PuR27eZw8=", "dev": true, "license": "Apache-2.0", "bin": { @@ -1096,15 +1060,15 @@ }, "node_modules/@microsoft/tsdoc": { "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.16.0.tgz", - "integrity": "sha512-xgAyonlVVS+q7Vc7qLW0UrJU7rSFcETRWsqdXZtjzRU8dF+6CkozTK4V4y1LwOX7j8r/vHphjDeMeGI4tNGeGA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@microsoft/tsdoc/-/tsdoc-0.16.0.tgz", + "integrity": "sha1-IkkJBjPgQGMXaGOgUMjwgI0rbSs=", "dev": true, "license": "MIT" }, "node_modules/@microsoft/tsdoc-config": { "version": "0.18.1", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.18.1.tgz", - "integrity": "sha512-9brPoVdfN9k9g0dcWkFeA7IH9bbcttzDJlXvkf8b2OBzd5MueR1V2wkKBL0abn0otvmkHJC6aapBOTJDDeMCZg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@microsoft/tsdoc-config/-/tsdoc-config-0.18.1.tgz", + "integrity": "sha1-fFYLzmKrtfloHk0jG5rDVVO36Gs=", "dev": true, "license": "MIT", "dependencies": { @@ -1116,8 +1080,8 @@ }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", - "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha1-7TOAbQ+b6Y3HbQw9T9hy/acBtdU=", "dev": true, "license": "MIT", "optional": true, @@ -1134,9 +1098,9 @@ } }, "node_modules/@nodable/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-9uGyhaQavEUMC8AIddIjau4NsnsXhou+j5sBAGojCM1oxmQpVKTWR/9JxABD6UAv12vpIms55fPZKFQEhG6uBg==", + "version": "3.0.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@nodable/entities/-/entities-3.0.0.tgz", + "integrity": "sha1-aUcDvIZNMOrtVcLj3vANvWFJNnA=", "dev": true, "funding": [ { @@ -1148,8 +1112,8 @@ }, "node_modules/@oxc-project/types": { "version": "0.139.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", - "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@oxc-project/types/-/types-0.139.0.tgz", + "integrity": "sha1-ONdrnb+TTCoCvhdPsyzuvxgv50I=", "dev": true, "license": "MIT", "funding": { @@ -1158,15 +1122,15 @@ }, "node_modules/@polka/url": { "version": "1.0.0-next.29", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", - "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha1-WkAQmhq1+E1v2PySixnzZ8vn57E=", "dev": true, "license": "MIT" }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", - "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz", + "integrity": "sha1-9Yy5oKgSjtBYIoJyBShUf8XANfM=", "cpu": [ "arm64" ], @@ -1182,8 +1146,8 @@ }, "node_modules/@rolldown/binding-darwin-arm64": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", - "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz", + "integrity": "sha1-RBFEwFpKgxqnUmmrw6SjJDdOpwc=", "cpu": [ "arm64" ], @@ -1199,8 +1163,8 @@ }, "node_modules/@rolldown/binding-darwin-x64": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", - "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz", + "integrity": "sha1-yC4wZSzvUsSvkl1cZsiVWkAxmBY=", "cpu": [ "x64" ], @@ -1216,8 +1180,8 @@ }, "node_modules/@rolldown/binding-freebsd-x64": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", - "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz", + "integrity": "sha1-wy6c5/ocD7K4CROio6BcPpB9BrA=", "cpu": [ "x64" ], @@ -1233,8 +1197,8 @@ }, "node_modules/@rolldown/binding-linux-arm-gnueabihf": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", - "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz", + "integrity": "sha1-zpC14iMWretQLqAQWC9JjNBgTyc=", "cpu": [ "arm" ], @@ -1250,12 +1214,15 @@ }, "node_modules/@rolldown/binding-linux-arm64-gnu": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", - "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz", + "integrity": "sha1-kZRxEMTdqk7vsATlJogHCXcIUgE=", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1267,12 +1234,15 @@ }, "node_modules/@rolldown/binding-linux-arm64-musl": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", - "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz", + "integrity": "sha1-6zKy1BCMHHArkejN6KBD6uXKqU0=", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1284,12 +1254,15 @@ }, "node_modules/@rolldown/binding-linux-ppc64-gnu": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", - "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz", + "integrity": "sha1-zLlDwR5acmVcuwL8EWNUHOtkB4I=", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1301,12 +1274,15 @@ }, "node_modules/@rolldown/binding-linux-s390x-gnu": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", - "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz", + "integrity": "sha1-ozcx7lZ+kLdfrG5eVTB+iiswOPA=", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1318,12 +1294,15 @@ }, "node_modules/@rolldown/binding-linux-x64-gnu": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", - "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz", + "integrity": "sha1-p0wBqqzt/BHDm2/rozpfoMZUlJ8=", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1335,12 +1314,15 @@ }, "node_modules/@rolldown/binding-linux-x64-musl": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", - "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz", + "integrity": "sha1-KM0XhJT6HmXbpBIim1zlXE3Vy9E=", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1352,8 +1334,8 @@ }, "node_modules/@rolldown/binding-openharmony-arm64": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", - "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz", + "integrity": "sha1-98dfqRP8IIhNJqfUiNT1xZfNccA=", "cpu": [ "arm64" ], @@ -1369,8 +1351,8 @@ }, "node_modules/@rolldown/binding-wasm32-wasi": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", - "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz", + "integrity": "sha1-w3lYGUd4cIHfNj6hBhQPzV/sJS0=", "cpu": [ "wasm32" ], @@ -1388,8 +1370,8 @@ }, "node_modules/@rolldown/binding-win32-arm64-msvc": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", - "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz", + "integrity": "sha1-8jyIaU96cpoS85UCSu4434Cha6M=", "cpu": [ "arm64" ], @@ -1405,8 +1387,8 @@ }, "node_modules/@rolldown/binding-win32-x64-msvc": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", - "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz", + "integrity": "sha1-M3fI3g5WqIV/ESF1YRRwkOh0y0Y=", "cpu": [ "x64" ], @@ -1422,19 +1404,19 @@ }, "node_modules/@rolldown/pluginutils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", - "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha1-4/zuCT+7XOdl4a0Ij/TeKIn2+b4=", "dev": true, "license": "MIT" }, "node_modules/@rushstack/node-core-library": { - "version": "5.23.1", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.23.1.tgz", - "integrity": "sha512-wlKmIKIYCKuCASbITvOxLZXepPbwXvrv7S6ig6XNWFchSyhL/E2txmVXspHY49Wu2dzf7nI27a2k/yV5BA3EiA==", + "version": "5.23.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rushstack/node-core-library/-/node-core-library-5.23.2.tgz", + "integrity": "sha1-oidv0dGnAuSxRrAYvgpOPxBMcYs=", "dev": true, "license": "MIT", "dependencies": { - "ajv": "~8.18.0", + "ajv": "~8.20.0", "ajv-draft-04": "~1.0.0", "ajv-formats": "~3.0.1", "fs-extra": "~11.3.0", @@ -1452,10 +1434,27 @@ } } }, + "node_modules/@rushstack/node-core-library/node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha1-MEs2Nq3Yi6fZNnYN1Q7OAG3qlfk=", + "dev": true, + "license": "MIT", + "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/@rushstack/node-core-library/node_modules/semver": { "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/semver/-/semver-7.7.4.tgz", + "integrity": "sha1-KEZONgYOmR+noR0CedLT87V6foo=", "dev": true, "license": "ISC", "bin": { @@ -1467,8 +1466,8 @@ }, "node_modules/@rushstack/problem-matcher": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@rushstack/problem-matcher/-/problem-matcher-0.2.1.tgz", - "integrity": "sha512-gulfhBs6n+I5b7DvjKRfhMGyUejtSgOHTclF/eONr8hcgF1APEDjhxIsfdUYYMzC3rvLwGluqLjbwCFZ8nxrog==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rushstack/problem-matcher/-/problem-matcher-0.2.1.tgz", + "integrity": "sha1-6fbKwt1qiC1g52qNRGK30ktPF+U=", "dev": true, "license": "MIT", "peerDependencies": { @@ -1482,8 +1481,8 @@ }, "node_modules/@rushstack/rig-package": { "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.7.3.tgz", - "integrity": "sha512-aAA518n6wxxjCfnTAOjQnm7ngNE0FVHxHAw2pxKlIhxrMn0XQjGcXKF0oKWpjBgJOmsaJpVob/v+zr3zxgPWuA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rushstack/rig-package/-/rig-package-0.7.3.tgz", + "integrity": "sha1-0opUQLHp9DBGcnunAJ0Y2ZMU8lE=", "dev": true, "license": "MIT", "dependencies": { @@ -1492,13 +1491,13 @@ } }, "node_modules/@rushstack/terminal": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.24.0.tgz", - "integrity": "sha512-8ZQS4MMaGsv27EXCBiH7WMPkRZrffeDoIevs6z9TM5dzqiY6+Hn4evfK/G+gvgBTjfvfkHIZPQQmalmI2sM4TQ==", + "version": "0.24.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rushstack/terminal/-/terminal-0.24.1.tgz", + "integrity": "sha1-DUDqlBKZ0khsgZcl4wPJib2sVGo=", "dev": true, "license": "MIT", "dependencies": { - "@rushstack/node-core-library": "5.23.1", + "@rushstack/node-core-library": "5.23.2", "@rushstack/problem-matcher": "0.2.1", "supports-color": "~8.1.1" }, @@ -1512,13 +1511,13 @@ } }, "node_modules/@rushstack/ts-command-line": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.3.10.tgz", - "integrity": "sha512-fwI076HYknC0IrMXdY6UmjDv+PH7NHhNJX3/pY2UblSE5XrXgndXZPiOe/6ZtuFpn6DvVDVNhtkIzQ+Qu/MhVQ==", + "version": "5.3.11", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@rushstack/ts-command-line/-/ts-command-line-5.3.11.tgz", + "integrity": "sha1-O+SrWNEET+rPP8k8vKbGKbzwNYI=", "dev": true, "license": "MIT", "dependencies": { - "@rushstack/terminal": "0.24.0", + "@rushstack/terminal": "0.24.1", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" @@ -1526,15 +1525,15 @@ }, "node_modules/@standard-schema/spec": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha1-p5tV26+GBIEvUtFAssmrQbwVC7g=", "dev": true, "license": "MIT" }, "node_modules/@tybys/wasm-util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha1-AVy6np3UfOFNA9KoxdVHv7FpZl0=", "dev": true, "license": "MIT", "optional": true, @@ -1544,15 +1543,15 @@ }, "node_modules/@types/argparse": { "version": "1.0.38", - "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", - "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha1-qB/YYG1IH4c6OADG665PHXaKVqk=", "dev": true, "license": "MIT" }, "node_modules/@types/chai": { "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", - "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha1-jpzZ4cNYH6azQaWu1ViOsoW+C0o=", "dev": true, "license": "MIT", "dependencies": { @@ -1562,29 +1561,29 @@ }, "node_modules/@types/deep-eql": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha1-M0MRlx06BxIefrkbaEpgXn7qnL0=", "dev": true, "license": "MIT" }, "node_modules/@types/estree": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha1-zz8Oh2177hWpOrkluCv1cKOQSiQ=", "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha1-dznCMqH+6bTTzomF8xTAxtM1Sdc=", "dev": true, "license": "MIT" }, "node_modules/@types/node": { "version": "26.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", - "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/node/-/node-26.1.1.tgz", + "integrity": "sha1-utdY1gHpfWz0V9IE7najX8570Rk=", "dev": true, "license": "MIT", "dependencies": { @@ -1593,15 +1592,15 @@ }, "node_modules/@types/semver": { "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha1-POOvGlUk7zJ9Lank/YttlcjXBSg=", "dev": true, "license": "MIT" }, "node_modules/@typescript/typescript-aix-ppc64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", - "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha1-zcfOgdYPHgkDSWDd+x+4gNendrY=", "cpu": [ "ppc64" ], @@ -1617,8 +1616,8 @@ }, "node_modules/@typescript/typescript-darwin-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", - "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha1-pV/fz6WN9Y0n2yI3zealweNacjU=", "cpu": [ "arm64" ], @@ -1634,8 +1633,8 @@ }, "node_modules/@typescript/typescript-darwin-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", - "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha1-ONHJFygAqR1we+xk0qNwoBZjTbQ=", "cpu": [ "x64" ], @@ -1651,8 +1650,8 @@ }, "node_modules/@typescript/typescript-freebsd-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", - "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha1-8f+IEAMLNdK1vg22otxlBGDqlPo=", "cpu": [ "arm64" ], @@ -1668,8 +1667,8 @@ }, "node_modules/@typescript/typescript-freebsd-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", - "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha1-PYawPzU8WxupUWLrbONVM7/ClL0=", "cpu": [ "x64" ], @@ -1685,8 +1684,8 @@ }, "node_modules/@typescript/typescript-linux-arm": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", - "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha1-rZS0HhruKk3MaimMe2fEM0X94y4=", "cpu": [ "arm" ], @@ -1702,8 +1701,8 @@ }, "node_modules/@typescript/typescript-linux-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", - "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha1-2TNNltbaxv+F2pyGVYiUjek56R8=", "cpu": [ "arm64" ], @@ -1719,8 +1718,8 @@ }, "node_modules/@typescript/typescript-linux-loong64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", - "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha1-KWWu5PyHM2ATnYk9qv5jl6KROK0=", "cpu": [ "loong64" ], @@ -1736,8 +1735,8 @@ }, "node_modules/@typescript/typescript-linux-mips64el": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", - "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha1-Goh6MRvtOoM/gL/Uqe03wnGTbPA=", "cpu": [ "mips64el" ], @@ -1753,8 +1752,8 @@ }, "node_modules/@typescript/typescript-linux-ppc64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", - "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha1-i2PJsvRFs5PrTkPsIdoiXa3jV30=", "cpu": [ "ppc64" ], @@ -1770,8 +1769,8 @@ }, "node_modules/@typescript/typescript-linux-riscv64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", - "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha1-tuijXCibPql6kqQdRhqu7Q07NuE=", "cpu": [ "riscv64" ], @@ -1787,8 +1786,8 @@ }, "node_modules/@typescript/typescript-linux-s390x": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", - "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha1-Lvlmk75IYfbReWVCflsAnLvtGj4=", "cpu": [ "s390x" ], @@ -1804,8 +1803,8 @@ }, "node_modules/@typescript/typescript-linux-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", - "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha1-cyacsLq6UK6gygYERaa4jlg/HOI=", "cpu": [ "x64" ], @@ -1821,8 +1820,8 @@ }, "node_modules/@typescript/typescript-netbsd-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", - "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha1-OjZJ+X+vohC05uN5jBXgZgXIqQE=", "cpu": [ "arm64" ], @@ -1838,8 +1837,8 @@ }, "node_modules/@typescript/typescript-netbsd-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", - "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha1-R+xZSRpAxHDSgH3E0rglUo/Zeas=", "cpu": [ "x64" ], @@ -1855,8 +1854,8 @@ }, "node_modules/@typescript/typescript-openbsd-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", - "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha1-eWvo2gvZidij+5bygB44qDZbS68=", "cpu": [ "arm64" ], @@ -1872,8 +1871,8 @@ }, "node_modules/@typescript/typescript-openbsd-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", - "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha1-03/ipynrlCwHbEVO5/GBX699Vg8=", "cpu": [ "x64" ], @@ -1889,8 +1888,8 @@ }, "node_modules/@typescript/typescript-sunos-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", - "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha1-q6jTRkw1ZacER4m6upaRa9SrLIg=", "cpu": [ "x64" ], @@ -1906,8 +1905,8 @@ }, "node_modules/@typescript/typescript-win32-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", - "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha1-ud5QoXGWOD9iYgtfnQovNK07YNc=", "cpu": [ "arm64" ], @@ -1923,8 +1922,8 @@ }, "node_modules/@typescript/typescript-win32-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", - "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha1-zzt7DWzlY12spMjgHBic3N5H7Dw=", "cpu": [ "x64" ], @@ -1940,8 +1939,8 @@ }, "node_modules/@typespec/compiler": { "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.14.0.tgz", - "integrity": "sha512-RRN0LGVDlonG/IbB2b4mvRjdCo6LywwB9/J8lOp6UaH7vtaFnKe5FL+rpxhof4rXx/zI/4OWnQO6c01bTCz4/Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/compiler/-/compiler-1.14.0.tgz", + "integrity": "sha1-2FXCBu7K+j54eOf0JVthKC8FP0Y=", "dev": true, "license": "MIT", "dependencies": { @@ -1972,8 +1971,8 @@ }, "node_modules/@typespec/events": { "version": "0.84.0", - "resolved": "https://registry.npmjs.org/@typespec/events/-/events-0.84.0.tgz", - "integrity": "sha512-UroDIu6t6Z+cOLyX8I+GJWhSFmYGrp1L93F7ZVt0Ypmj0ndmC9YYa4cpeEyS5PDDIC8u49WfCIwfGegxt4rPVQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/events/-/events-0.84.0.tgz", + "integrity": "sha1-U6JW0cqeb0+n5fCjTbaW3DlOYPk=", "dev": true, "license": "MIT", "engines": { @@ -1985,8 +1984,8 @@ }, "node_modules/@typespec/http": { "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-1.14.0.tgz", - "integrity": "sha512-W+heCzu8K63AVcoX8MachVWaRxSAMFWOI1yBTc2Kq8QHaJeDiLL5JbU8VfTZ4tL/6EoGSdKfIT5ZNRW7oVCzhg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/http/-/http-1.14.0.tgz", + "integrity": "sha1-La9yB2Ny8FhnXSBbst9wYQBiOq4=", "dev": true, "license": "MIT", "engines": { @@ -2004,8 +2003,8 @@ }, "node_modules/@typespec/openapi": { "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-1.14.0.tgz", - "integrity": "sha512-KL7kImPhCXRmxpHVt1k7TWaa4bb3NbSeUx2rxyxeq7lYZFllI6/NYRCTOI/5JOrbElWmmSxrajU9K9IAKI6PkQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi/-/openapi-1.14.0.tgz", + "integrity": "sha1-uwjWOV3VwWP59UXlR2xVUuzyCGc=", "dev": true, "license": "MIT", "engines": { @@ -2018,8 +2017,8 @@ }, "node_modules/@typespec/rest": { "version": "0.84.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.84.0.tgz", - "integrity": "sha512-9s5dDfRoHRPdtbVvkBasUx/RnMvwWMTuXRieSQDEji4gWGgxVu4Zt4MiEEKSfQrkMr3Aw0QjRCSxBxjMCHIOmA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/rest/-/rest-0.84.0.tgz", + "integrity": "sha1-kMLB39G8geZbiA3EEdQBaqteuuA=", "dev": true, "license": "MIT", "engines": { @@ -2032,8 +2031,8 @@ }, "node_modules/@typespec/spec-api": { "version": "0.1.0-alpha.15", - "resolved": "https://registry.npmjs.org/@typespec/spec-api/-/spec-api-0.1.0-alpha.15.tgz", - "integrity": "sha512-rVPcA3KFJEBYpXq9BJkmtOk0SmF/pHUXv4m1FJNbXX8YW7eo3/NUKwB2Tc3TQVZB9zEIfBmf3BtLWpwvmVMAUQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/spec-api/-/spec-api-0.1.0-alpha.15.tgz", + "integrity": "sha1-FvthJPmh0u+gw9SAUbchhndg3tQ=", "dev": true, "license": "MIT", "dependencies": { @@ -2046,8 +2045,8 @@ }, "node_modules/@typespec/spec-coverage-sdk": { "version": "0.1.0-alpha.16", - "resolved": "https://registry.npmjs.org/@typespec/spec-coverage-sdk/-/spec-coverage-sdk-0.1.0-alpha.16.tgz", - "integrity": "sha512-qwSnuE+CXjv4mn2uhioTVlaO4GjypR4ZtbkSoLmWA677ggYmoAjIDpyNgT1tjsc1lDKVtSiPvGhM9XFKExVmbQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/spec-coverage-sdk/-/spec-coverage-sdk-0.1.0-alpha.16.tgz", + "integrity": "sha1-5giTADH6pjWV0xMTviGRlCL624c=", "dev": true, "license": "MIT", "dependencies": { @@ -2063,8 +2062,8 @@ }, "node_modules/@typespec/spec-coverage-sdk/node_modules/@types/node": { "version": "25.3.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.5.tgz", - "integrity": "sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@types/node/-/node-25.3.5.tgz", + "integrity": "sha1-vsy1kVVh96mXCs5UetRNbNvzm0Y=", "dev": true, "license": "MIT", "dependencies": { @@ -2073,15 +2072,15 @@ }, "node_modules/@typespec/spec-coverage-sdk/node_modules/undici-types": { "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha1-KTV6iee3ykrvO/D9P9DNc4hCKek=", "dev": true, "license": "MIT" }, "node_modules/@typespec/spector": { "version": "0.1.0-alpha.26", - "resolved": "https://registry.npmjs.org/@typespec/spector/-/spector-0.1.0-alpha.26.tgz", - "integrity": "sha512-WtaWIJE+Xh80G11Bi/3zC1GIrK4EVYBSCnkmSvm9bEYcBMH8QuryPDbUeTXYUyozcCrMYXaKnBboHN91IEi8ug==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/spector/-/spector-0.1.0-alpha.26.tgz", + "integrity": "sha1-a1UJwCwv7rnrqCr0F+Rh6fSd1nY=", "dev": true, "license": "MIT", "dependencies": { @@ -2111,8 +2110,8 @@ }, "node_modules/@typespec/sse": { "version": "0.84.0", - "resolved": "https://registry.npmjs.org/@typespec/sse/-/sse-0.84.0.tgz", - "integrity": "sha512-9joNgVisRCWDFfV1d79iTAuR1W/6r+AKJrKUfcjsaTrq5A8OWW3v5TTsfxbHAZArn7n2WxQkqhNGgNyc8LjEng==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/sse/-/sse-0.84.0.tgz", + "integrity": "sha1-dkP/3P+tvI4Q2SV3oRz/F2JMVXo=", "dev": true, "license": "MIT", "engines": { @@ -2127,8 +2126,8 @@ }, "node_modules/@typespec/streams": { "version": "0.84.0", - "resolved": "https://registry.npmjs.org/@typespec/streams/-/streams-0.84.0.tgz", - "integrity": "sha512-SDneR8+zY+ueOpzg9yJtttfDe/ikB99JgddZSXKPwiDPlAIEeEvI8auipcYfB58EEOB21h8Oq0tEm8HqiAAWdQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/streams/-/streams-0.84.0.tgz", + "integrity": "sha1-Bm3D76chBKlcou2jj913xFfTBI4=", "dev": true, "license": "MIT", "engines": { @@ -2139,9 +2138,9 @@ } }, "node_modules/@typespec/ts-http-runtime": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.6.tgz", - "integrity": "sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og==", + "version": "0.3.7", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.7.tgz", + "integrity": "sha1-mrJ1NYmDu9MLyJUM9NxX5kcGcPM=", "dev": true, "license": "MIT", "dependencies": { @@ -2150,13 +2149,13 @@ "tslib": "^2.6.2" }, "engines": { - "node": ">=20.0.0" + "node": ">=22.0.0" } }, "node_modules/@typespec/versioning": { "version": "0.84.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.84.0.tgz", - "integrity": "sha512-ZoDasTDj4z0mgFK+0cJL2+7DduCaTjvICHL2nQ/RBWc7nLgObaIYCjvXLno8WneDXnpxCAr7larN4/nlHEv9fg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/versioning/-/versioning-0.84.0.tgz", + "integrity": "sha1-YS06C7uMMWXKp7vwuy8qV8kjr38=", "dev": true, "license": "MIT", "engines": { @@ -2168,8 +2167,8 @@ }, "node_modules/@typespec/xml": { "version": "0.84.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.84.0.tgz", - "integrity": "sha512-3x0spgIrr4u3azkYaOxrlumtjoqPiUnJ/G5RwGBmUCAeE5F413MHf/AeIkmZ2ULT1gY3myabfZp8bOijTbMk7A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/xml/-/xml-0.84.0.tgz", + "integrity": "sha1-aP99jZ3+wHS7f9mMJbEUT4Py7+g=", "dev": true, "license": "MIT", "engines": { @@ -2181,8 +2180,8 @@ }, "node_modules/@vitest/coverage-v8": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.10.tgz", - "integrity": "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/coverage-v8/-/coverage-v8-4.1.10.tgz", + "integrity": "sha1-A3zV5+qKL0SPTC4Q2xQRwrDJJ70=", "dev": true, "license": "MIT", "dependencies": { @@ -2212,8 +2211,8 @@ }, "node_modules/@vitest/expect": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz", - "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/expect/-/expect-4.1.10.tgz", + "integrity": "sha1-eZwG/ES7DPfieEE3tifFzBcyhdQ=", "dev": true, "license": "MIT", "dependencies": { @@ -2230,8 +2229,8 @@ }, "node_modules/@vitest/mocker": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz", - "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/mocker/-/mocker-4.1.10.tgz", + "integrity": "sha1-JBOYerTNf6HCthS0BMQHv2rR6tE=", "dev": true, "license": "MIT", "dependencies": { @@ -2257,8 +2256,8 @@ }, "node_modules/@vitest/pretty-format": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", - "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", + "integrity": "sha1-dVQucnOgjMEP1Nja1OPrHxbNlYw=", "dev": true, "license": "MIT", "dependencies": { @@ -2270,8 +2269,8 @@ }, "node_modules/@vitest/runner": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz", - "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/runner/-/runner-4.1.10.tgz", + "integrity": "sha1-/r8KIakWhCFCLRlVNw5gb+q2A1U=", "dev": true, "license": "MIT", "dependencies": { @@ -2284,8 +2283,8 @@ }, "node_modules/@vitest/snapshot": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz", - "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/snapshot/-/snapshot-4.1.10.tgz", + "integrity": "sha1-fj6f7H1NRyMuSTz9y9IXDeQ3HAQ=", "dev": true, "license": "MIT", "dependencies": { @@ -2300,8 +2299,8 @@ }, "node_modules/@vitest/spy": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz", - "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/spy/-/spy-4.1.10.tgz", + "integrity": "sha1-XAv6l7Vrup43QDyXbbd2/2q1b2U=", "dev": true, "license": "MIT", "funding": { @@ -2310,8 +2309,8 @@ }, "node_modules/@vitest/ui": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-4.1.10.tgz", - "integrity": "sha512-EOUqfXHTXtpSHsyLHH40ts3Ue+hRhSGwzwzMlK0dTEOLSDYyOXLyr5JDGmHQWhN2DYI30gw6dVx3cdgM9FZl+Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/ui/-/ui-4.1.10.tgz", + "integrity": "sha1-cjo+Hm03cfC/B6/+LXAWLkUxTZg=", "dev": true, "license": "MIT", "dependencies": { @@ -2332,8 +2331,8 @@ }, "node_modules/@vitest/utils": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz", - "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@vitest/utils/-/utils-4.1.10.tgz", + "integrity": "sha1-/8cQVfGL/Msf0FhjZevCgkiS5AM=", "dev": true, "license": "MIT", "dependencies": { @@ -2347,8 +2346,8 @@ }, "node_modules/accepts": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", - "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha1-u89LpQdUZ/PyEx6rPP/HPC9deJU=", "dev": true, "license": "MIT", "dependencies": { @@ -2361,8 +2360,8 @@ }, "node_modules/agent-base": { "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha1-48121MVI7oldPD/Y3B9sW5Ay56g=", "dev": true, "license": "MIT", "engines": { @@ -2371,8 +2370,8 @@ }, "node_modules/ajv": { "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha1-iGQYa2c40APrOpMxcrs4M+EM77w=", "dev": true, "license": "MIT", "dependencies": { @@ -2388,8 +2387,8 @@ }, "node_modules/ajv-draft-04": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", - "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha1-O2R2GyaLoLnmaPC0G6U/zgrXf8g=", "dev": true, "license": "MIT", "peerDependencies": { @@ -2403,8 +2402,8 @@ }, "node_modules/ajv-formats": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", - "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha1-PV3HYryhdnnDwup+kK1rdTIwlXg=", "dev": true, "license": "MIT", "dependencies": { @@ -2421,8 +2420,8 @@ }, "node_modules/ansi-regex": { "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha1-YCFu6kZNhkWXzigyAAc4oFiWUME=", "dev": true, "license": "MIT", "engines": { @@ -2434,8 +2433,8 @@ }, "node_modules/ansi-styles": { "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha1-wETV3MUhoHZBNHJZehrLHxA8QEE=", "dev": true, "license": "MIT", "engines": { @@ -2447,8 +2446,8 @@ }, "node_modules/anynum": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/anynum/-/anynum-1.0.1.tgz", - "integrity": "sha512-N6//FLET/tXYNM/F6ABca1oH6fWB+KlTt909Le28WMDBk8oaT4vY17DCrwg2MvmuqUKt3Ni4N5dGJ/EoBgcO6A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/anynum/-/anynum-1.0.1.tgz", + "integrity": "sha1-KqwA4I3603JsHUYuYNvC+DFlmkQ=", "dev": true, "funding": [ { @@ -2460,15 +2459,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=", "dev": true, "license": "MIT" }, "node_modules/argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", "dev": true, "license": "MIT", "dependencies": { @@ -2477,8 +2476,8 @@ }, "node_modules/assertion-error": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha1-9kGhlrM1aQsQcL8AtudZP+wZC/c=", "dev": true, "license": "MIT", "engines": { @@ -2486,9 +2485,9 @@ } }, "node_modules/ast-v8-to-istanbul": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.4.tgz", - "integrity": "sha512-0bC0/4bTSrnwdhU3IsZDwEdojvuPrSg59OYZfKsLRtJZ0u8VBx9DebfqqG8bRdCC0I7vjgxmPi41P0lpkhJHtA==", + "version": "1.0.5", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.5.tgz", + "integrity": "sha1-cIuutvXIeSJtESo0H/qCHEOIHS0=", "dev": true, "license": "MIT", "dependencies": { @@ -2499,15 +2498,15 @@ }, "node_modules/ast-v8-to-istanbul/node_modules/js-tokens": { "version": "10.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", - "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha1-3/51mbSou3/jCv+NAjUjTf+3mDE=", "dev": true, "license": "MIT" }, "node_modules/balanced-match": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha1-v7EGYv7tgZaixi58aOF3IMJ0F5o=", "dev": true, "license": "MIT", "engines": { @@ -2516,8 +2515,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=", "dev": true, "license": "MIT", "dependencies": { @@ -2529,15 +2528,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", "dev": true, "license": "MIT" }, "node_modules/body-parser": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", - "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha1-bYZi9NjDNgKLismqJCUbDKZLpDc=", "dev": true, "license": "MIT", "dependencies": { @@ -2561,8 +2560,8 @@ }, "node_modules/body-parser/node_modules/content-type": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", - "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha1-L7Pt5p3/oK94ynxM51iWgGOLVt8=", "dev": true, "license": "MIT", "engines": { @@ -2575,8 +2574,8 @@ }, "node_modules/brace-expansion": { "version": "5.0.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", - "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha1-Gw5GlltHna1lr3N7SgJ5CgVJgzc=", "dev": true, "license": "MIT", "dependencies": { @@ -2588,8 +2587,8 @@ }, "node_modules/braces": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/braces/-/braces-3.0.3.tgz", + "integrity": "sha1-SQMy9AkZRSJy1VqEgK3AxEE1h4k=", "dev": true, "license": "MIT", "dependencies": { @@ -2601,22 +2600,22 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=", "dev": true, "license": "BSD-3-Clause" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha1-KxRqb9cugLT1XSVfNe1Zo6mkG9U=", "dev": true, "license": "MIT" }, "node_modules/bundle-name": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", - "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha1-87lrNBYNZDGhnXaIE1r3z7h5eIk=", "dev": true, "license": "MIT", "dependencies": { @@ -2631,8 +2630,8 @@ }, "node_modules/busboy": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha1-lm6japUC5DzbkUaWJSO5L1MfaJM=", "dev": true, "dependencies": { "streamsearch": "^1.1.0" @@ -2643,8 +2642,8 @@ }, "node_modules/bytes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha1-iwvuuYYFrfGxKPpDhkA8AJ4CIaU=", "dev": true, "license": "MIT", "engines": { @@ -2653,8 +2652,8 @@ }, "node_modules/c8": { "version": "11.0.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-11.0.0.tgz", - "integrity": "sha512-e/uRViGHSVIJv7zsaDKM7VRn2390TgHXqUSvYwPHBQaU6L7E9L0n9JbdkwdYPvshDT0KymBmmlwSpms3yBaMNg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/c8/-/c8-11.0.0.tgz", + "integrity": "sha1-0EINk7kCAkkAQcM4qKqVF07KBYY=", "dev": true, "license": "ISC", "dependencies": { @@ -2687,8 +2686,8 @@ }, "node_modules/c8/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha1-CCyyyJyf6GWaMRpTvWpNxTAdswQ=", "dev": true, "license": "MIT", "engines": { @@ -2697,8 +2696,8 @@ }, "node_modules/c8/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", "dev": true, "license": "MIT", "dependencies": { @@ -2713,8 +2712,8 @@ }, "node_modules/c8/node_modules/cliui": { "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha1-DASwddsCy/5g3I5s8vVIaxo2CKo=", "dev": true, "license": "ISC", "dependencies": { @@ -2728,15 +2727,15 @@ }, "node_modules/c8/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=", "dev": true, "license": "MIT" }, "node_modules/c8/node_modules/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha1-JpxxF9J7Ba0uU2gwqOyJXvnG0BA=", "dev": true, "license": "MIT", "dependencies": { @@ -2750,8 +2749,8 @@ }, "node_modules/c8/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha1-nibGPTD1NEPpSJSVshBdN7Z6hdk=", "dev": true, "license": "MIT", "dependencies": { @@ -2763,8 +2762,8 @@ }, "node_modules/c8/node_modules/wrap-ansi": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=", "dev": true, "license": "MIT", "dependencies": { @@ -2781,8 +2780,8 @@ }, "node_modules/c8/node_modules/yargs": { "version": "17.7.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", - "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha1-d53/5ryv7FlqcXLpgyiaWIZH+qo=", "dev": true, "license": "MIT", "dependencies": { @@ -2800,8 +2799,8 @@ }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha1-S1QowiK+mF15w9gmV0edvgtZstY=", "dev": true, "license": "MIT", "dependencies": { @@ -2814,8 +2813,8 @@ }, "node_modules/call-bound": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha1-I43pNdKippKSjFOMfM+pEGf9Bio=", "dev": true, "license": "MIT", "dependencies": { @@ -2831,8 +2830,8 @@ }, "node_modules/chai": { "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/chai/-/chai-6.2.2.tgz", + "integrity": "sha1-rkG1LJrKh3NFBTYnF/MlX6zaNg4=", "dev": true, "license": "MIT", "engines": { @@ -2841,22 +2840,22 @@ }, "node_modules/change-case": { "version": "5.4.4", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", - "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha1-DVK1B9j7jyBDQ0MjgdGm17/5egI=", "dev": true, "license": "MIT" }, "node_modules/chardet": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.2.0.tgz", - "integrity": "sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/chardet/-/chardet-2.2.0.tgz", + "integrity": "sha1-AF1mTyy9SWGIjS4sMsWmnlnY7sQ=", "dev": true, "license": "MIT" }, "node_modules/chownr": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", - "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha1-mFXmTs0kCpzEJnzopKpdJKHaFeQ=", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -2865,8 +2864,8 @@ }, "node_modules/cli-width": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", - "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha1-QtqsQdPCVO84rYrAN2chMBc2kcU=", "dev": true, "license": "ISC", "engines": { @@ -2875,8 +2874,8 @@ }, "node_modules/cliui": { "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", - "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha1-b3iQ84b28feZU63B943sRvzC0pE=", "dev": true, "license": "ISC", "dependencies": { @@ -2890,8 +2889,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "dev": true, "license": "MIT", "dependencies": { @@ -2903,15 +2902,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", "dev": true, "license": "MIT" }, "node_modules/concat-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha1-QUz1r3kKSMYKub5FJ9VtXkETPLE=", "dev": true, "engines": [ "node >= 6.0" @@ -2926,8 +2925,8 @@ }, "node_modules/content-disposition": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", - "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha1-89t4nHUtRVZMx+nh4LMXkNSjjhc=", "dev": true, "license": "MIT", "engines": { @@ -2940,8 +2939,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha1-i3cxYmVtHRCGeEyPI6VM5tc9eRg=", "dev": true, "license": "MIT", "engines": { @@ -2950,15 +2949,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha1-S1YPZJ/E6RjdCrdc9JYei8iC2Co=", "dev": true, "license": "MIT" }, "node_modules/cookie": { "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha1-VWNpxHKiupEPKXmJG1JrNDYjftc=", "dev": true, "license": "MIT", "engines": { @@ -2967,8 +2966,8 @@ }, "node_modules/cookie-signature": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", - "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha1-V8f8PMKTrKuf7FTXPhVpDr5KF5M=", "dev": true, "license": "MIT", "engines": { @@ -2977,8 +2976,8 @@ }, "node_modules/cross-spawn": { "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha1-ilj+ePANzXDDcEUXWd+/rwPo7p8=", "dev": true, "license": "MIT", "dependencies": { @@ -2992,8 +2991,8 @@ }, "node_modules/debug": { "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/debug/-/debug-4.4.3.tgz", + "integrity": "sha1-xq5DLZvZZiWC/OCHCbA4xY6ePWo=", "dev": true, "license": "MIT", "dependencies": { @@ -3010,8 +3009,8 @@ }, "node_modules/default-browser": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz", - "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/default-browser/-/default-browser-5.5.0.tgz", + "integrity": "sha1-J5LohvJCKJRUWUfMgOGkRElsWXY=", "dev": true, "license": "MIT", "dependencies": { @@ -3027,8 +3026,8 @@ }, "node_modules/default-browser-id": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", - "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha1-96fMuPUQS/jg9xujscz6Xq/bIeg=", "dev": true, "license": "MIT", "engines": { @@ -3040,8 +3039,8 @@ }, "node_modules/define-lazy-prop": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", - "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha1-27Ga37dG1/xtc0oGty9KANAhJV8=", "dev": true, "license": "MIT", "engines": { @@ -3053,8 +3052,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/depd/-/depd-2.0.0.tgz", + "integrity": "sha1-tpYWPMdXVg0JzyLMj60Vcbeedt8=", "dev": true, "license": "MIT", "engines": { @@ -3063,8 +3062,8 @@ }, "node_modules/detect-libc": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha1-aJxdzcGQDvVYOky59te0c3QgdK0=", "dev": true, "license": "Apache-2.0", "engines": { @@ -3073,8 +3072,8 @@ }, "node_modules/diff": { "version": "8.0.4", - "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz", - "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/diff/-/diff-8.0.4.tgz", + "integrity": "sha1-T1uvMYi5skMRF7li6yC6Mw+t9pY=", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -3083,8 +3082,8 @@ }, "node_modules/dunder-proto": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha1-165mfh3INIL4tw/Q9u78UNow9Yo=", "dev": true, "license": "MIT", "dependencies": { @@ -3098,8 +3097,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha1-rg8PothQRe8UqBfao86azQSJ5b8=", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -3108,22 +3107,22 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true, "license": "MIT" }, "node_modules/emoji-regex": { "version": "10.6.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", - "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha1-vz1uj3+P0ipl2XA0dbwBRzV6aw0=", "dev": true, "license": "MIT" }, "node_modules/encodeurl": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha1-e46omAd9fkCdOsRUdOo46vCFelg=", "dev": true, "license": "MIT", "engines": { @@ -3132,8 +3131,8 @@ }, "node_modules/env-paths": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-4.0.0.tgz", - "integrity": "sha512-pxP8eL2SwwaTRi/KHYwLYXinDs7gL3jxFcBYmEdYfZmZXbaVDvdppd0XBU8qVz03rDfKZMXg1omHCbsJjZrMsw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/env-paths/-/env-paths-4.0.0.tgz", + "integrity": "sha1-0LsfhKgdJUJYG/e36AhdBoOzkJc=", "dev": true, "license": "MIT", "dependencies": { @@ -3148,8 +3147,8 @@ }, "node_modules/es-define-property": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha1-mD6y+aZyTpMD9hrd8BHHLgngsPo=", "dev": true, "license": "MIT", "engines": { @@ -3158,8 +3157,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha1-BfdaJdq5jk+x3NXhRywFRtUFfI8=", "dev": true, "license": "MIT", "engines": { @@ -3168,15 +3167,15 @@ }, "node_modules/es-module-lexer": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.1.tgz", - "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/es-module-lexer/-/es-module-lexer-2.3.1.tgz", + "integrity": "sha1-W/LfBpmdu+XwBqX0ahH7n1t7ORs=", "dev": true, "license": "MIT" }, "node_modules/es-object-atoms": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha1-otCzcyBXJN+lJdI7DD4bHKWCyZs=", "dev": true, "license": "MIT", "dependencies": { @@ -3188,8 +3187,8 @@ }, "node_modules/escalade": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha1-ARo/aYVroYnf+n3I/M6Z0qh5A+U=", "dev": true, "license": "MIT", "engines": { @@ -3198,15 +3197,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", "dev": true, "license": "MIT" }, "node_modules/estree-walker": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha1-Z8PlSexAKkh7T8GT0ZU6UkdSNA0=", "dev": true, "license": "MIT", "dependencies": { @@ -3215,8 +3214,8 @@ }, "node_modules/etag": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true, "license": "MIT", "engines": { @@ -3225,8 +3224,8 @@ }, "node_modules/events": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/events/-/events-3.3.0.tgz", + "integrity": "sha1-Mala0Kkk4tLEGagTrrLE6HjqdAA=", "dev": true, "license": "MIT", "engines": { @@ -3235,8 +3234,8 @@ }, "node_modules/expect-type": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", - "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha1-JO338MxppE0AhWe6RZSrlvPDo9Y=", "dev": true, "license": "Apache-2.0", "engines": { @@ -3245,8 +3244,8 @@ }, "node_modules/express": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", - "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/express/-/express-5.2.1.tgz", + "integrity": "sha1-jyHRW20yf5K0eU7PjLCKcvlWrAQ=", "dev": true, "license": "MIT", "dependencies": { @@ -3289,22 +3288,22 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=", "dev": true, "license": "MIT" }, "node_modules/fast-string-truncated-width": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", - "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", + "integrity": "sha1-I6/g2mfXUsoHJ1OPHmlndZcozkk=", "dev": true, "license": "MIT" }, "node_modules/fast-string-width": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz", - "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-string-width/-/fast-string-width-3.0.2.tgz", + "integrity": "sha1-FturtJHOVYW17LZ1tlwWXXFojus=", "dev": true, "license": "MIT", "dependencies": { @@ -3312,9 +3311,9 @@ } }, "node_modules/fast-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", - "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "version": "3.1.3", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-uri/-/fast-uri-3.1.3.tgz", + "integrity": "sha1-9pWkDwBqulBWMVc6ACHdshGUrRE=", "dev": true, "funding": [ { @@ -3330,8 +3329,8 @@ }, "node_modules/fast-wrap-ansi": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz", - "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz", + "integrity": "sha1-lelSoBRbzj9ZrVbhefhMSNQHKTU=", "dev": true, "license": "MIT", "dependencies": { @@ -3339,9 +3338,9 @@ } }, "node_modules/fast-xml-builder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", - "integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==", + "version": "1.3.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-xml-builder/-/fast-xml-builder-1.3.0.tgz", + "integrity": "sha1-vISYBHlv5Hv5FQIt2Tmw/DC6RV0=", "dev": true, "funding": [ { @@ -3351,14 +3350,14 @@ ], "license": "MIT", "dependencies": { - "path-expression-matcher": "^1.5.0", - "xml-naming": "^0.1.0" + "path-expression-matcher": "^1.6.2", + "xml-naming": "^0.3.0" } }, "node_modules/fast-xml-parser": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.9.3.tgz", - "integrity": "sha512-brCNCeScma/kqa54J4PIDriSSSLssRkuYaUCpvHJulGc3HGI/xxKUCTDcYkAdqJsyb//ydpbxecjC3hB9+tb/g==", + "version": "5.10.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fast-xml-parser/-/fast-xml-parser-5.10.1.tgz", + "integrity": "sha1-GTE/fJOGxH+kod5SdUe3PtLPzt4=", "dev": true, "funding": [ { @@ -3368,12 +3367,12 @@ ], "license": "MIT", "dependencies": { - "@nodable/entities": "^2.2.0", + "@nodable/entities": "^3.0.0", "fast-xml-builder": "^1.2.0", - "is-unsafe": "^1.0.1", - "path-expression-matcher": "^1.5.0", + "is-unsafe": "^2.0.0", + "path-expression-matcher": "^1.6.2", "strnum": "^2.4.1", - "xml-naming": "^0.1.0" + "xml-naming": "^0.3.0" }, "bin": { "fxparser": "src/cli/cli.js" @@ -3381,15 +3380,15 @@ }, "node_modules/fflate": { "version": "0.8.3", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", - "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha1-vCfY6zA0PU1RKrsDSAICzmXYJfw=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha1-RCZdPKwH4+p9wkdRY4BkN1SgUpI=", "dev": true, "license": "MIT", "dependencies": { @@ -3401,8 +3400,8 @@ }, "node_modules/finalhandler": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", - "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha1-osUXplWYUrzbBtH4vX9Rto+tgJk=", "dev": true, "license": "MIT", "dependencies": { @@ -3423,8 +3422,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha1-TJKBnstwg1YeT0okCoa+UZj1Nvw=", "dev": true, "license": "MIT", "dependencies": { @@ -3440,15 +3439,15 @@ }, "node_modules/flatted": { "version": "3.4.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", - "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha1-9cI8EH8PN96NvfJPE3IrO5jVJyY=", "dev": true, "license": "ISC" }, "node_modules/foreground-child": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha1-Mujp7Rtoo0l777msK2rfkqY4V28=", "dev": true, "license": "ISC", "dependencies": { @@ -3464,8 +3463,8 @@ }, "node_modules/forwarded": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha1-ImmTZCiq1MFcfr6XeahL8LKoGBE=", "dev": true, "license": "MIT", "engines": { @@ -3474,8 +3473,8 @@ }, "node_modules/fresh": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", - "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha1-jdffahs6Gzpc8YbAWl3SZ2ImNaQ=", "dev": true, "license": "MIT", "engines": { @@ -3483,9 +3482,9 @@ } }, "node_modules/fs-extra": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz", - "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==", + "version": "11.3.6", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fs-extra/-/fs-extra-11.3.6.tgz", + "integrity": "sha1-98uA6d9VDNHbb1N/pc3VaNPnDRA=", "dev": true, "license": "MIT", "dependencies": { @@ -3499,10 +3498,9 @@ }, "node_modules/fsevents": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha1-ysZAd4XQNnWipeGlMFxpezR9kNY=", "dev": true, - "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ @@ -3514,8 +3512,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha1-LALYZNl/PqbIgwxGTL0Rq26rehw=", "dev": true, "license": "MIT", "funding": { @@ -3524,8 +3522,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=", "dev": true, "license": "ISC", "engines": { @@ -3534,8 +3532,8 @@ }, "node_modules/get-east-asian-width": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", - "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha1-IWkA+R3xGossGYw+HZPWwDWndrk=", "dev": true, "license": "MIT", "engines": { @@ -3547,8 +3545,8 @@ }, "node_modules/get-intrinsic": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha1-dD8OO2lkqTpUke0b/6rgVNf5jQE=", "dev": true, "license": "MIT", "dependencies": { @@ -3572,8 +3570,8 @@ }, "node_modules/get-proto": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha1-FQs/J0OGnvPoUewMSdFbHRTQDuE=", "dev": true, "license": "MIT", "dependencies": { @@ -3586,8 +3584,8 @@ }, "node_modules/glob": { "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/glob/-/glob-13.0.6.tgz", + "integrity": "sha1-B4ZmVmpCUUfMrPvS4zLetmor5x0=", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -3604,8 +3602,8 @@ }, "node_modules/gopd": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha1-ifVrghe9vIgCvSmd9tfxCB1+UaE=", "dev": true, "license": "MIT", "engines": { @@ -3617,14 +3615,14 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha1-QYPk6L8Iu24Fu7L30uDI9xLKQOM=", "license": "ISC" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", "dev": true, "license": "MIT", "engines": { @@ -3633,8 +3631,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha1-/JxqeDoISVHQuXH+EBjegTcHozg=", "dev": true, "license": "MIT", "engines": { @@ -3646,8 +3644,8 @@ }, "node_modules/hasown": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha1-jGLYy5C+sqrV0KW2dYGtmFTD8AM=", "dev": true, "license": "MIT", "dependencies": { @@ -3659,15 +3657,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha1-39YAJ9o2o238viNiYsAKWCJoFFM=", "dev": true, "license": "MIT" }, "node_modules/http-errors": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha1-NtL2W8kJyHkAGN02+02T2myq4Gs=", "dev": true, "license": "MIT", "dependencies": { @@ -3687,8 +3685,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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha1-mosfJGhmwChQlIZYX2K48sGMJw4=", "dev": true, "license": "MIT", "dependencies": { @@ -3701,8 +3699,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha1-2o3+rH2hMLBcK6S1nJts1mYRprk=", "dev": true, "license": "MIT", "dependencies": { @@ -3714,9 +3712,9 @@ } }, "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "version": "0.7.3", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha1-hO4S+WPn3lC8AaE+FgoHizsPQV8=", "dev": true, "license": "MIT", "dependencies": { @@ -3732,8 +3730,8 @@ }, "node_modules/import-lazy": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha1-6OtidIOgpD2jwD8+NVSL5csMwVM=", "dev": true, "license": "MIT", "engines": { @@ -3742,15 +3740,15 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", "dev": true, "license": "ISC" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM=", "dev": true, "license": "MIT", "engines": { @@ -3759,8 +3757,8 @@ }, "node_modules/is-core-module": { "version": "2.16.2", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", - "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha1-PgdFCoCA684/vwysSU9NKrMk4II=", "dev": true, "license": "MIT", "dependencies": { @@ -3775,8 +3773,8 @@ }, "node_modules/is-docker": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha1-kAk6oxBid9inelkQ265xdH4VogA=", "dev": true, "license": "MIT", "bin": { @@ -3791,8 +3789,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=", "dev": true, "license": "MIT", "engines": { @@ -3801,8 +3799,8 @@ }, "node_modules/is-inside-container": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", - "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha1-6B+6aZZi6zHb2vJnZqYdSBRxfqQ=", "dev": true, "license": "MIT", "dependencies": { @@ -3820,8 +3818,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", "dev": true, "license": "MIT", "engines": { @@ -3830,15 +3828,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha1-Qv+fhCBsGZHSbev1IN1cAQQt0vM=", "dev": true, "license": "MIT" }, "node_modules/is-safe-filename": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-safe-filename/-/is-safe-filename-0.1.1.tgz", - "integrity": "sha512-4SrR7AdnY11LHfDKTZY1u6Ga3RuxZdl3YKWWShO5iyuG5h8QS4GD2tOb04peBJ5I7pXbR+CGBNEhTcwK+FzN3g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-safe-filename/-/is-safe-filename-0.1.1.tgz", + "integrity": "sha1-+yLurQl8YUxHqmdN5deaFkilPmY=", "dev": true, "license": "MIT", "engines": { @@ -3850,8 +3848,8 @@ }, "node_modules/is-unicode-supported": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", - "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha1-CfCrDebTdE1I0mXruY9l0R8qmzo=", "dev": true, "license": "MIT", "engines": { @@ -3862,9 +3860,9 @@ } }, "node_modules/is-unsafe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-1.0.1.tgz", - "integrity": "sha512-CLK2+VdgERgD96EYm5lUQssZYlRg2tkZnbsxZoacmSiRxiFJ4Nk4SzjCl+Ur+v3kXIY9dTIdb3IH22y1mZ56LA==", + "version": "2.0.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-unsafe/-/is-unsafe-2.0.0.tgz", + "integrity": "sha1-wNzk4GdCZi3eJjYBYOQU6kh9ouk=", "dev": true, "funding": [ { @@ -3876,8 +3874,8 @@ }, "node_modules/is-wsl": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", - "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha1-MniXsmgyo+sRfabCdJLQTKEyWU8=", "dev": true, "license": "MIT", "dependencies": { @@ -3892,15 +3890,15 @@ }, "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true, "license": "ISC" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha1-LRZsSwZE1Do58Ev2wu3R5YXzF1Y=", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -3909,8 +3907,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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha1-kIMFusmlvRdaxqdEier9D8JEWn0=", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -3924,8 +3922,8 @@ }, "node_modules/istanbul-lib-report/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", "dev": true, "license": "MIT", "dependencies": { @@ -3937,8 +3935,8 @@ }, "node_modules/istanbul-reports": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", - "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha1-y0U1FitXhKpiPO4hpyUs8sgHrJM=", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -3951,29 +3949,47 @@ }, "node_modules/jju": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", "dev": true, "license": "MIT" }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/js-yaml/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=", + "license": "Python-2.0" + }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha1-rnvLNlard6c7pcSb9lTzjmtoYOI=", "dev": true, "license": "MIT" }, "node_modules/jsonfile": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", - "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha1-tuMXF/Isw3MwsIHOAFHtXeU68vY=", "dev": true, "license": "MIT", "dependencies": { @@ -3985,8 +4001,8 @@ }, "node_modules/jsonwebtoken": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", - "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha1-bNV6sB6bCsB8uEfVPTybbuMfeuI=", "dev": true, "license": "MIT", "dependencies": { @@ -4008,8 +4024,8 @@ }, "node_modules/jwa": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", - "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha1-v4F20a0M1y4PP1gzhZWhPhELyAQ=", "dev": true, "license": "MIT", "dependencies": { @@ -4020,8 +4036,8 @@ }, "node_modules/jws": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", - "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jws/-/jws-4.0.1.tgz", + "integrity": "sha1-B+3Bvo+sIOZ3soPs4mFJi9OPBpA=", "dev": true, "license": "MIT", "dependencies": { @@ -4031,8 +4047,8 @@ }, "node_modules/lightningcss": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha1-uFqulkhtyxv0mnyFcSISc/Tx5Kk=", "dev": true, "license": "MPL-2.0", "dependencies": { @@ -4061,8 +4077,8 @@ }, "node_modules/lightningcss-android-arm64": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", - "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha1-8DOIURbf79nG9UeHUj41FLYeGWg=", "cpu": [ "arm64" ], @@ -4082,8 +4098,8 @@ }, "node_modules/lightningcss-darwin-arm64": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", - "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha1-ULcYcbAcgZlYS2SeKSVH+up6+bU=", "cpu": [ "arm64" ], @@ -4103,8 +4119,8 @@ }, "node_modules/lightningcss-darwin-x64": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", - "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha1-NfPpczLRMLnKGB4RtWje1q68bV4=", "cpu": [ "x64" ], @@ -4124,8 +4140,8 @@ }, "node_modules/lightningcss-freebsd-x64": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", - "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha1-l3enZHK2Ttb/lDQq1kx7r9eUpXU=", "cpu": [ "x64" ], @@ -4145,8 +4161,8 @@ }, "node_modules/lightningcss-linux-arm-gnueabihf": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", - "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha1-E65lLhq3O5E117faFy9mbEEK1T0=", "cpu": [ "arm" ], @@ -4166,12 +4182,15 @@ }, "node_modules/lightningcss-linux-arm64-gnu": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", - "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha1-QXhYeVqUWS9oASOhsfnaig4e8zU=", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4187,12 +4206,15 @@ }, "node_modules/lightningcss-linux-arm64-musl": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", - "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha1-a+NmkugQtxgECAL9gJYjz/5zITM=", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4208,12 +4230,15 @@ }, "node_modules/lightningcss-linux-x64-gnu": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha1-C3gDr06yHP043Tn+Kru1PH3QkfY=", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4229,12 +4254,15 @@ }, "node_modules/lightningcss-linux-x64-musl": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", - "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha1-iNyLqGXd3bGsXvBLDxYYBEGMFjs=", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4250,8 +4278,8 @@ }, "node_modules/lightningcss-win32-arm64-msvc": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", - "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha1-TzC6P6XpJfW3n5RejMDRdsOxqzg=", "cpu": [ "arm64" ], @@ -4271,8 +4299,8 @@ }, "node_modules/lightningcss-win32-x64-msvc": { "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", - "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha1-FBqlYFZFBkkokCu0rwRfp9n0Igo=", "cpu": [ "x64" ], @@ -4292,8 +4320,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha1-VTIeswn+u8WcSAHZMackUqaB0oY=", "dev": true, "license": "MIT", "dependencies": { @@ -4308,57 +4336,57 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", "dev": true, "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=", "dev": true, "license": "MIT" }, "node_modules/lru-cache": { - "version": "11.5.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", - "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", + "version": "11.5.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha1-AOFmZckMYg+6FKPDaHMql2ST92A=", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -4367,8 +4395,8 @@ }, "node_modules/magic-string": { "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha1-VnY+wJoPqAkd8nh5/ZTRkHjADZE=", "dev": true, "license": "MIT", "dependencies": { @@ -4377,8 +4405,8 @@ }, "node_modules/magicast": { "version": "0.5.3", - "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", - "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/magicast/-/magicast-0.5.3.tgz", + "integrity": "sha1-GAD2523YsNvnJXQ4osM2rvq72QU=", "dev": true, "license": "MIT", "dependencies": { @@ -4389,8 +4417,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha1-w8IwencSd82WODBfkVwprnQbYU4=", "dev": true, "license": "MIT", "dependencies": { @@ -4405,8 +4433,6 @@ }, "node_modules/math-intrinsics": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, "license": "MIT", "engines": { @@ -4415,8 +4441,8 @@ }, "node_modules/media-typer": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha1-ardLjy0zIPIGSyqHo455Mf86VWE=", "dev": true, "license": "MIT", "engines": { @@ -4425,8 +4451,8 @@ }, "node_modules/merge-descriptors": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", - "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha1-6pIvZgY1oiSe5WXgRJ+VHmtgOAg=", "dev": true, "license": "MIT", "engines": { @@ -4438,8 +4464,8 @@ }, "node_modules/micromatch": { "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha1-1m+hjzpHB2eJMgubGvMr2G2fogI=", "dev": true, "license": "MIT", "dependencies": { @@ -4452,8 +4478,8 @@ }, "node_modules/mime-db": { "version": "1.54.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha1-zds+5PnGRTDf9kAjZmHULLajFPU=", "dev": true, "license": "MIT", "engines": { @@ -4462,8 +4488,8 @@ }, "node_modules/mime-types": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", - "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha1-OQAtQYJXXVrwNv+hGBAPJSSy4qs=", "dev": true, "license": "MIT", "dependencies": { @@ -4479,8 +4505,8 @@ }, "node_modules/minimatch": { "version": "10.2.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.3.tgz", - "integrity": "sha512-Rwi3pnapEqirPSbWbrZaa6N3nmqq4Xer/2XooiOKyV3q12ML06f7MOuc5DVH8ONZIFhwIYQ3yzPH4nt7iWHaTg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/minimatch/-/minimatch-10.2.3.tgz", + "integrity": "sha1-wO9YLyEHGwEjpbvydSUuvakh+/Y=", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -4495,8 +4521,8 @@ }, "node_modules/minipass": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha1-eTibTrG7LQA6m7qH1JLyvTe9xls=", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -4505,8 +4531,8 @@ }, "node_modules/minizlib": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", - "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/minizlib/-/minizlib-3.1.0.tgz", + "integrity": "sha1-atdsOo8QInybUdHJrI4wsn9aJRw=", "dev": true, "license": "MIT", "dependencies": { @@ -4518,8 +4544,8 @@ }, "node_modules/morgan": { "version": "1.11.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.11.0.tgz", - "integrity": "sha512-zSkVu3t18r39pw4ixfBKvfZi3y2UOqr7d4WYwcj3m8nXpEQK4rPO6GLzs/CExoRgmX3y9EjmmcXqv6jq0SK46g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/morgan/-/morgan-1.11.0.tgz", + "integrity": "sha1-mEZLhTiALxTp5TdOviOsNkzWF+g=", "dev": true, "license": "MIT", "dependencies": { @@ -4539,8 +4565,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/debug/-/debug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "license": "MIT", "dependencies": { @@ -4549,15 +4575,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "license": "MIT" }, "node_modules/mrmime": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", - "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha1-vD6H95h4U6VMmFDusfEHjNRK3dw=", "dev": true, "license": "MIT", "engines": { @@ -4566,15 +4592,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ms/-/ms-2.1.3.tgz", + "integrity": "sha1-V0yBOM4dK1hh8LRFedut1gxmFbI=", "dev": true, "license": "MIT" }, "node_modules/multer": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/multer/-/multer-2.2.0.tgz", - "integrity": "sha512-6rdyFg2kLrMh9Jee7/BMPuV9lEAd7lLW2YUpF9/YxR7njyoUwwQ0ZPh3TaIY50Sw6vlyD2HW3wGOkTS4P79xrQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/multer/-/multer-2.2.0.tgz", + "integrity": "sha1-8AUmjKgWMkunM147SBZolqP6XXk=", "dev": true, "license": "MIT", "dependencies": { @@ -4593,8 +4619,8 @@ }, "node_modules/multer/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true, "license": "MIT", "engines": { @@ -4603,8 +4629,8 @@ }, "node_modules/multer/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha1-u6vNwChZ9JhzAchW4zh85exDv3A=", "dev": true, "license": "MIT", "engines": { @@ -4613,8 +4639,8 @@ }, "node_modules/multer/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha1-OBqHG2KnNEUGYK497uRIE/cNlZo=", "dev": true, "license": "MIT", "dependencies": { @@ -4626,8 +4652,8 @@ }, "node_modules/multer/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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=", "dev": true, "license": "MIT", "dependencies": { @@ -4640,8 +4666,8 @@ }, "node_modules/mustache": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha1-5YkjJNYKEuycKnM1ntylKXK/b2Q=", "dev": true, "license": "MIT", "bin": { @@ -4650,8 +4676,8 @@ }, "node_modules/mute-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-3.0.0.tgz", - "integrity": "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/mute-stream/-/mute-stream-3.0.0.tgz", + "integrity": "sha1-zYAU3SrLcuHpG7Z8dPABnmILotE=", "dev": true, "license": "ISC", "engines": { @@ -4660,8 +4686,8 @@ }, "node_modules/nanoid": { "version": "3.3.16", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha1-oE2OxLHxAAnS1TOUeu/kKTc3gWw=", "dev": true, "funding": [ { @@ -4679,8 +4705,8 @@ }, "node_modules/negotiator": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha1-tskbtHFy1p+Tz9fDV7u1KQGbX2o=", "dev": true, "license": "MIT", "engines": { @@ -4689,8 +4715,8 @@ }, "node_modules/object-inspect": { "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha1-g3UmXiG8IND6WCwi4bE0hdbgAhM=", "dev": true, "license": "MIT", "engines": { @@ -4702,8 +4728,8 @@ }, "node_modules/obug": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.3.tgz", - "integrity": "sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/obug/-/obug-2.1.3.tgz", + "integrity": "sha1-wCxg+Vq9YDQJMw52fbfygjGTMx4=", "dev": true, "funding": [ "https://github.com/sponsors/sxzz", @@ -4716,8 +4742,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha1-WMjEQRblSEWtV/FKsQsDUzGErD8=", "dev": true, "license": "MIT", "dependencies": { @@ -4729,8 +4755,8 @@ }, "node_modules/on-headers": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", - "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha1-WdpPkcRfX5icbkvO3Fo7Cu1w/2U=", "dev": true, "license": "MIT", "engines": { @@ -4739,8 +4765,8 @@ }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "license": "ISC", "dependencies": { @@ -4749,8 +4775,8 @@ }, "node_modules/open": { "version": "10.2.0", - "resolved": "https://registry.npmjs.org/open/-/open-10.2.0.tgz", - "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/open/-/open-10.2.0.tgz", + "integrity": "sha1-udhVvgB2IOgLb7BfrJgUH+Yttzw=", "dev": true, "license": "MIT", "dependencies": { @@ -4768,8 +4794,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha1-4drMvnjQ0TiMoYxk/qOOPlfjcGs=", "dev": true, "license": "MIT", "dependencies": { @@ -4784,8 +4810,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha1-g8gxXGeFAF470CGDlBHJ4RDm2DQ=", "dev": true, "license": "MIT", "dependencies": { @@ -4800,15 +4826,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha1-TxRxoBCCeob5TP2bByfjbSZ95QU=", "dev": true, "license": "BlueOak-1.0.0" }, "node_modules/parseurl": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=", "dev": true, "license": "MIT", "engines": { @@ -4817,8 +4843,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", "dev": true, "license": "MIT", "engines": { @@ -4826,9 +4852,9 @@ } }, "node_modules/path-expression-matcher": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.6.1.tgz", - "integrity": "sha512-h7bxdzhHk8Knyc4Tj+jMaa7fEEoUJy7p1qtbVgkYg1Uhpe5Np5VuGXCRZnkZvU+Q42M1vStt0ifa3ueykRJPmQ==", + "version": "1.6.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/path-expression-matcher/-/path-expression-matcher-1.6.2.tgz", + "integrity": "sha1-VnxzwHGX6dzvJOkO3NxXEFZZkWg=", "dev": true, "funding": [ { @@ -4843,8 +4869,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", "dev": true, "license": "MIT", "engines": { @@ -4853,15 +4879,15 @@ }, "node_modules/path-parse": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU=", "dev": true, "license": "MIT" }, "node_modules/path-scurry": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha1-a+DQ7gKhDZ4N56mLrmXhgskGH4U=", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -4877,8 +4903,8 @@ }, "node_modules/path-to-regexp": { "version": "8.4.2", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", - "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha1-eVxCDE98pFxbiHNm9iLuDJhSzM0=", "dev": true, "license": "MIT", "funding": { @@ -4888,22 +4914,22 @@ }, "node_modules/pathe": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha1-PsvsVUIWhbcKnahyss/z4cvtFxY=", "dev": true, "license": "MIT" }, "node_modules/picocolors": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha1-PTIa8+q5ObCDyPkpodEs2oHCa2s=", "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha1-WpQpFeJrNy3A8OZ1MUmhbmscVgE=", "dev": true, "license": "MIT", "engines": { @@ -4915,8 +4941,8 @@ }, "node_modules/pluralize": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha1-Gm+hajjRKhkB4DIPoBcFHFOc47E=", "dev": true, "license": "MIT", "engines": { @@ -4925,8 +4951,8 @@ }, "node_modules/postcss": { "version": "8.5.19", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz", - "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/postcss/-/postcss-8.5.19.tgz", + "integrity": "sha1-Ra1c/eSZQI4gFHNII3VROBqSIDc=", "dev": true, "funding": [ { @@ -4953,9 +4979,9 @@ } }, "node_modules/prettier": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.1.tgz", - "integrity": "sha512-ppiDo2CSwexck1eyZUwJHg/N3nf1+6IRCv7W/VJ5vaLnVCmB7+3CdRfMwoCHBBX6xTrREDTksZ4OZl5SSf4zXA==", + "version": "3.9.5", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha1-T+yXc24zudC2ILSJFP6TtTDoNa0=", "dev": true, "license": "MIT", "bin": { @@ -4970,8 +4996,8 @@ }, "node_modules/proper-lockfile": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-2.0.1.tgz", - "integrity": "sha512-rjaeGbsmhNDcDInmwi4MuI6mRwJu6zq8GjYCLuSuE7GF+4UjgzkL69sVKKJ2T2xH61kK7rXvGYpvaTu909oXaQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/proper-lockfile/-/proper-lockfile-2.0.1.tgz", + "integrity": "sha1-FZ+wYZPTIAP0s2kd0uwaY0qoDR0=", "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", @@ -4983,8 +5009,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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=", "dev": true, "license": "MIT", "dependencies": { @@ -4997,8 +5023,8 @@ }, "node_modules/qs": { "version": "6.15.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", - "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/qs/-/qs-6.15.3.tgz", + "integrity": "sha1-doUhMqWO1cfA72fkRBubtdYGGzs=", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -5014,8 +5040,8 @@ }, "node_modules/range-parser": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", - "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha1-1/Gb6BK7YnIUcrRdO+IZ7wlXK0c=", "dev": true, "license": "MIT", "engines": { @@ -5028,8 +5054,8 @@ }, "node_modules/raw-body": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", - "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha1-PjraWuVWj5CV2EN2/TpJuPsAClE=", "dev": true, "license": "MIT", "dependencies": { @@ -5044,8 +5070,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha1-VqmzbqllwAxak+8x6xEaDxEFaWc=", "dev": true, "license": "MIT", "dependencies": { @@ -5059,8 +5085,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true, "license": "MIT", "engines": { @@ -5069,8 +5095,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha1-iaf92TgmEmcxjq/hT5wy5ZjDaQk=", "dev": true, "license": "MIT", "engines": { @@ -5079,8 +5105,8 @@ }, "node_modules/resolve": { "version": "1.22.12", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha1-9bKmgIl8acI4oTzRaxVnH4tzVJ8=", "dev": true, "license": "MIT", "dependencies": { @@ -5101,8 +5127,8 @@ }, "node_modules/retry": { "version": "0.10.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "integrity": "sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", "license": "MIT", "engines": { "node": "*" @@ -5110,8 +5136,8 @@ }, "node_modules/rimraf": { "version": "6.1.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", - "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha1-r77iNrO9K+Mx1OfORJO6wXGJga8=", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -5130,8 +5156,8 @@ }, "node_modules/rolldown": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", - "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/rolldown/-/rolldown-1.1.5.tgz", + "integrity": "sha1-M5quJQhENR/FW3TiZS0+vW+6OJ0=", "dev": true, "license": "MIT", "dependencies": { @@ -5164,8 +5190,8 @@ }, "node_modules/router": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", - "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/router/-/router-2.2.0.tgz", + "integrity": "sha1-AZvmILcRyHZBFnzHm5kJDwCxRu8=", "dev": true, "license": "MIT", "dependencies": { @@ -5181,8 +5207,8 @@ }, "node_modules/run-applescript": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", - "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha1-Lp5UxGZOwxBsW1Yw4knT1llcSRE=", "dev": true, "license": "MIT", "engines": { @@ -5194,8 +5220,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=", "dev": true, "funding": [ { @@ -5215,15 +5241,15 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", "dev": true, "license": "MIT" }, "node_modules/semver": { "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/semver/-/semver-7.8.5.tgz", + "integrity": "sha1-ObZGA33VDBT7RR5+TKxY7YuGP2k=", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -5234,8 +5260,8 @@ }, "node_modules/send": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", - "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/send/-/send-1.2.1.tgz", + "integrity": "sha1-nqt0O4dPNVD0CiaGe/KGrWDT8+0=", "dev": true, "license": "MIT", "dependencies": { @@ -5261,8 +5287,8 @@ }, "node_modules/serve-static": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", - "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha1-fxhqSk5fW2Y616QpT/G/N88OmKk=", "dev": true, "license": "MIT", "dependencies": { @@ -5281,15 +5307,15 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha1-ZsmiSnP5/CjL5msJ/tPTPcrxtCQ=", "dev": true, "license": "ISC" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", "dev": true, "license": "MIT", "dependencies": { @@ -5301,8 +5327,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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", "dev": true, "license": "MIT", "engines": { @@ -5311,8 +5337,8 @@ }, "node_modules/side-channel": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", - "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha1-6gLGLgXcS+pn1EQvD7ce4ZL44Ks=", "dev": true, "license": "MIT", "dependencies": { @@ -5331,8 +5357,8 @@ }, "node_modules/side-channel-list": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha1-wuC1oUpUCuvuO7xsP4ZmzJtQkSc=", "dev": true, "license": "MIT", "dependencies": { @@ -5348,8 +5374,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha1-1rtrN5Asb+9RdOX1M/q0xzKib0I=", "dev": true, "license": "MIT", "dependencies": { @@ -5367,8 +5393,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha1-Ed2hnVNo5Azp7CvcH7DsvAeQ7Oo=", "dev": true, "license": "MIT", "dependencies": { @@ -5387,15 +5413,15 @@ }, "node_modules/siginfo": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha1-MudscLeXJOO7Vny51UPrhYzPrzA=", "dev": true, "license": "ISC" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha1-lSGIwcvVRgcOLdIND0HArgUwywQ=", "dev": true, "license": "ISC", "engines": { @@ -5407,8 +5433,8 @@ }, "node_modules/sirv": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", - "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha1-93X8zxDiKkCDJoSEjWNjRvQc2XA=", "dev": true, "license": "MIT", "dependencies": { @@ -5422,8 +5448,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -5432,8 +5458,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha1-HOVlD93YerwJnto33P8CTCZnrkY=", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -5442,8 +5468,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha1-BP58f54e0tZiIzwoyys1ufY/bk8=", "dev": true, "license": "MIT", "dependencies": { @@ -5453,22 +5479,22 @@ }, "node_modules/sprintf-js": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true, "license": "BSD-3-Clause" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha1-Gsig2Ug4SNFpXkGLbQMaPDzmjjs=", "dev": true, "license": "MIT" }, "node_modules/statuses": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha1-j3XuzvdlteHPzcCA2llAntQk44I=", "dev": true, "license": "MIT", "engines": { @@ -5477,15 +5503,15 @@ }, "node_modules/std-env": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", - "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha1-jr4OxgSFZoq0ciezEvQlTN+AydM=", "dev": true, "license": "MIT" }, "node_modules/streamsearch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha1-QE3R4iR8qUr1VOhBqO8OqiONp2Q=", "dev": true, "engines": { "node": ">=10.0.0" @@ -5493,8 +5519,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=", "dev": true, "license": "MIT", "dependencies": { @@ -5503,8 +5529,8 @@ }, "node_modules/string-argv": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", - "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha1-K20O8ktlYnTZV9VOCku/YVPcArY=", "dev": true, "license": "MIT", "engines": { @@ -5513,8 +5539,8 @@ }, "node_modules/string-width": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha1-tbuOIWXOJ11NQ0dt0nAK2Qkdttw=", "dev": true, "license": "MIT", "dependencies": { @@ -5531,8 +5557,8 @@ }, "node_modules/strip-ansi": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha1-0iomlSKDamJ6+NBLXD/Sx/o+MuM=", "dev": true, "license": "MIT", "dependencies": { @@ -5547,8 +5573,8 @@ }, "node_modules/strnum": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.1.tgz", - "integrity": "sha512-M9eUSMT2dCB2cTNPG7UYj6KuK7RJR2SN2+yCV/fTW3xzTCS6EaGZ5pSMgDIjB7r8zSfTGk+dvvn9rTjpVS9Mwg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/strnum/-/strnum-2.4.1.tgz", + "integrity": "sha1-hUF/aDETut6g/n4XInZ2+In/flg=", "dev": true, "funding": [ { @@ -5563,8 +5589,8 @@ }, "node_modules/supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha1-zW/BfihQDP9WwbhsCn/UpUpzAFw=", "dev": true, "license": "MIT", "dependencies": { @@ -5579,8 +5605,8 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha1-btpL00SjyUrqN21MwxvHcxEDngk=", "dev": true, "license": "MIT", "engines": { @@ -5591,9 +5617,9 @@ } }, "node_modules/tar": { - "version": "7.5.19", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.19.tgz", - "integrity": "sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw==", + "version": "7.5.20", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tar/-/tar-7.5.20.tgz", + "integrity": "sha1-N6ZaqRHL1phkAC4Uv4qSalVR4kA=", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -5609,8 +5635,8 @@ }, "node_modules/temporal-polyfill": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", - "integrity": "sha512-N2SoI9olnW7BUsU8RosDphZQl9s+WJ8O7PoJMFCr/e5/1rFkVI4GNOWaSeySG+UoP04foPYsnLWbJmbXOiShZg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", + "integrity": "sha1-lWd9+PpWcaeY6KqztY9FlJGIDZ8=", "dev": true, "license": "MIT", "dependencies": { @@ -5620,22 +5646,22 @@ }, "node_modules/temporal-spec": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-1.0.0.tgz", - "integrity": "sha512-00Ahj1e1ifaERTMOIIGpOCdOo9IEk2m6GGSMedsn9a2SIsGLdOTbmME1Htv6IM82b6VHrzSUTIVc7YHy6hdhFQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-spec/-/temporal-spec-1.0.0.tgz", + "integrity": "sha1-gep3lAsAmndZ/SH0R9wPK3VHwco=", "dev": true, "license": "Apache-2.0" }, "node_modules/temporal-utils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/temporal-utils/-/temporal-utils-1.0.1.tgz", - "integrity": "sha512-HAixuesxFQIUaQk3ptX2jhfO/FsOkgVkDDMawvp6n/fkB1q6BKfs3lURw9I+pK/2e2e/q/vrLrxmeqauBoyGMQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-utils/-/temporal-utils-1.0.1.tgz", + "integrity": "sha1-+vJ24hZRLM0VdaRwWljXOgka64I=", "dev": true, "license": "MIT" }, "node_modules/test-exclude": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", - "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/test-exclude/-/test-exclude-8.0.0.tgz", + "integrity": "sha1-hYka3T+ka7gisbFXnH+Mmj0E69g=", "dev": true, "license": "ISC", "dependencies": { @@ -5649,15 +5675,15 @@ }, "node_modules/tinybench": { "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha1-EDyfi6bXI3pHq23R3P93JRhjQms=", "dev": true, "license": "MIT" }, "node_modules/tinyexec": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", - "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha1-rkW7Lt69qUxw9OqJfg8SQ+Rw23E=", "dev": true, "license": "MIT", "engines": { @@ -5666,8 +5692,8 @@ }, "node_modules/tinyglobby": { "version": "0.2.17", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha1-ViqabJ6ys7Ej05cZ+a9btE/NdjE=", "dev": true, "license": "MIT", "dependencies": { @@ -5683,8 +5709,8 @@ }, "node_modules/tinyglobby/node_modules/fdir": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha1-7Sq5Z6MxreYvGNB32uGSaE1Q01A=", "dev": true, "license": "MIT", "engines": { @@ -5701,8 +5727,8 @@ }, "node_modules/tinyglobby/node_modules/picomatch": { "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha1-UepXoX2G9gX4EDlZX7xA7QalX6s=", "dev": true, "license": "MIT", "engines": { @@ -5714,8 +5740,8 @@ }, "node_modules/tinyrainbow": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", - "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha1-HYpiOJP5XPCi3bnl0RFQ4ZFAlCE=", "dev": true, "license": "MIT", "engines": { @@ -5724,8 +5750,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", "dev": true, "license": "MIT", "dependencies": { @@ -5737,8 +5763,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha1-O+NDIaiKgg7RvYDfqjPkefu43TU=", "dev": true, "license": "MIT", "engines": { @@ -5747,8 +5773,8 @@ }, "node_modules/totalist": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha1-ujo9YAyRWxqXhyNI95wSdHX2rPg=", "dev": true, "license": "MIT", "engines": { @@ -5757,15 +5783,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha1-YS7+TtI11Wfoq6Xypfq3AoCt6D8=", "dev": true, "license": "0BSD" }, "node_modules/type-is": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", - "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha1-cdGnBTKTWC4WrJ8+uvGrmqSeVXA=", "dev": true, "license": "MIT", "dependencies": { @@ -5783,8 +5809,8 @@ }, "node_modules/type-is/node_modules/content-type": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", - "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha1-L7Pt5p3/oK94ynxM51iWgGOLVt8=", "dev": true, "license": "MIT", "engines": { @@ -5797,15 +5823,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true, "license": "MIT" }, "node_modules/typescript": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha1-nsdz15VKjBgsF8xbvVdaoovFFYI=", "dev": true, "license": "Apache-2.0", "bin": { @@ -5839,15 +5865,15 @@ }, "node_modules/undici-types": { "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha1-ROn8nzJEZIzeo15Pm7LWgelBCAk=", "dev": true, "license": "MIT" }, "node_modules/universalify": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha1-Fo78IYCWTmOG0GHglN9hr+I5sY0=", "dev": true, "license": "MIT", "engines": { @@ -5856,8 +5882,8 @@ }, "node_modules/unpipe": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true, "license": "MIT", "engines": { @@ -5866,15 +5892,15 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "license": "MIT" }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha1-uVcqv6Yr1VbBbXX968GkEdX/MXU=", "dev": true, "license": "ISC", "dependencies": { @@ -5888,8 +5914,8 @@ }, "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==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "dev": true, "license": "MIT", "engines": { @@ -5897,16 +5923,16 @@ } }, "node_modules/vite": { - "version": "8.1.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", - "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", + "version": "8.1.5", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vite/-/vite-8.1.5.tgz", + "integrity": "sha1-zP/OPuSHsYhiI7JOuye5FnSCfTA=", "dev": true, "license": "MIT", "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.5", - "postcss": "^8.5.16", - "rolldown": "~1.1.4", + "postcss": "^8.5.17", + "rolldown": "~1.1.5", "tinyglobby": "^0.2.17" }, "bin": { @@ -5976,8 +6002,8 @@ }, "node_modules/vite/node_modules/picomatch": { "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha1-UepXoX2G9gX4EDlZX7xA7QalX6s=", "dev": true, "license": "MIT", "engines": { @@ -5989,8 +6015,8 @@ }, "node_modules/vitest": { "version": "4.1.10", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz", - "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vitest/-/vitest-4.1.10.tgz", + "integrity": "sha1-fpKF7+JksRZwULejp/80eI4bevw=", "dev": true, "license": "MIT", "dependencies": { @@ -6079,8 +6105,8 @@ }, "node_modules/vitest/node_modules/picomatch": { "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha1-UepXoX2G9gX4EDlZX7xA7QalX6s=", "dev": true, "license": "MIT", "engines": { @@ -6092,8 +6118,8 @@ }, "node_modules/vscode-jsonrpc": { "version": "9.0.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", - "integrity": "sha512-rfuA6T75H6m5EkbhtEPzre9pT0HPcDI2MMy4+nPFIBks5J8JBAUHD4tRYSgaBOijIEC7SRkC1kKyXTLqbmh9jw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", + "integrity": "sha1-XoSKSt3wBLYzcVb3hYoAbgg4tPU=", "dev": true, "license": "MIT", "engines": { @@ -6102,8 +6128,8 @@ }, "node_modules/vscode-languageserver": { "version": "10.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", - "integrity": "sha512-9gEWpXkYGXoqG7pBnE8O8hx/yP7+Aabn4+peQ3KDicQv6qunHSWyLTud3OF0w4S2+HfDD+5HqYKiXQW9HAU6mA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", + "integrity": "sha1-6IB0MTmF2kpsCPrCvr1zN5ykv8U=", "dev": true, "license": "MIT", "dependencies": { @@ -6115,8 +6141,8 @@ }, "node_modules/vscode-languageserver-protocol": { "version": "3.18.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", - "integrity": "sha512-XRyDbT0Pp3sSNti3JmxVEUMySWCSi1hhM+/KUlCy1hV1zmrqpM1OwO12EAki8blhmLuIMpaJrYbo0OzGVfK2Qg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", + "integrity": "sha1-5/s25royvHumIiV623imEmJz3cU=", "dev": true, "license": "MIT", "dependencies": { @@ -6126,22 +6152,22 @@ }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha1-RX7gQnGrOJmKCTxowjQvU/bkpjE=", "dev": true, "license": "MIT" }, "node_modules/vscode-languageserver-types": { "version": "3.18.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", - "integrity": "sha512-8TsGPNMIMiiBdkORgRSvLjuiEIiAFtO+KssmYWxQ+uSVvlf7RjK8YKCOjPzZ+YA04jXEV7+7LvkSmHkhpNS99g==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha1-EyMhIpYEg2urcQyXSH5s2vub17s=", "dev": true, "license": "MIT" }, "node_modules/which": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/which/-/which-2.0.2.tgz", + "integrity": "sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=", "dev": true, "license": "ISC", "dependencies": { @@ -6156,8 +6182,8 @@ }, "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", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha1-o/aalxB/SUs83Dvd3Yg6fWXOvwQ=", "dev": true, "license": "MIT", "dependencies": { @@ -6173,8 +6199,8 @@ }, "node_modules/wrap-ansi": { "version": "9.0.2", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", - "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha1-lWgy3qlJQwbm0gnrhxZDu4c9fJg=", "dev": true, "license": "MIT", "dependencies": { @@ -6191,15 +6217,15 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "license": "ISC" }, "node_modules/wsl-utils": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz", - "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/wsl-utils/-/wsl-utils-0.1.0.tgz", + "integrity": "sha1-h4PU32cdTVA2W+LuTHGRegVXuqs=", "dev": true, "license": "MIT", "dependencies": { @@ -6213,9 +6239,9 @@ } }, "node_modules/xml-naming": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz", - "integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==", + "version": "0.3.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/xml-naming/-/xml-naming-0.3.0.tgz", + "integrity": "sha1-RsHhi/4oWEeZgt0qzPNNFudJ7aI=", "dev": true, "funding": [ { @@ -6230,8 +6256,8 @@ }, "node_modules/y18n": { "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha1-f0k00PfKjFb5UxSTndzS3ZHOHVU=", "dev": true, "license": "ISC", "engines": { @@ -6240,8 +6266,8 @@ }, "node_modules/yallist": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", - "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha1-AOLeRDY57Q14/YfeDSdGn7z/tTM=", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -6250,8 +6276,8 @@ }, "node_modules/yaml": { "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha1-eCdK/ZNZih391hMN9qVm3vy/mqQ=", "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -6265,8 +6291,8 @@ }, "node_modules/yargs": { "version": "18.0.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", - "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha1-bIQlmAYnOnRrCfV5CHtoo8LSW9E=", "dev": true, "license": "MIT", "dependencies": { @@ -6283,8 +6309,8 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha1-kJa87r+ZDSG7MfqVFuDt4pSnfTU=", "dev": true, "license": "ISC", "engines": { @@ -6293,8 +6319,8 @@ }, "node_modules/yargs/node_modules/yargs-parser": { "version": "22.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", - "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha1-h7gglAUbBWdxc0bs0A/RSASzV8g=", "dev": true, "license": "ISC", "engines": { @@ -6303,8 +6329,8 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha1-ApTrPe4FAo0x7hpfosVWpqrxChs=", "dev": true, "license": "MIT", "engines": { From a17136c6be2ba1c59f43aba1a0f30066300ba60a Mon Sep 17 00:00:00 2001 From: Christian Vaagland Tellnes Date: Fri, 17 Jul 2026 15:27:37 +0200 Subject: [PATCH 020/249] Add scope support to OpenIdConnectAuth (#11153) The model now accepts an optional `Scopes` template parameter so operations can declare required scopes. The OpenAPI3 emitter emits those scopes on each operation's security requirement while the scheme object itself remains unchanged. Existing usages without scopes are unaffected. --- ...idconnect-auth-scopes-2026-6-25-22-45-0.md | 8 ++++ packages/http/lib/auth.tsp | 8 +++- packages/http/src/auth.ts | 14 +++++- packages/http/src/decorators.ts | 10 ++++- packages/http/src/types.ts | 8 ++++ packages/http/test/auth.test.ts | 29 ++++++++++++ packages/openapi3/src/openapi.ts | 4 +- packages/openapi3/test/security.test.ts | 44 +++++++++++++++++++ .../docs/libraries/http/authentication.md | 25 +++++++++++ .../libraries/http/reference/data-types.md | 18 ++++---- 10 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 .chronus/changes/openidconnect-auth-scopes-2026-6-25-22-45-0.md diff --git a/.chronus/changes/openidconnect-auth-scopes-2026-6-25-22-45-0.md b/.chronus/changes/openidconnect-auth-scopes-2026-6-25-22-45-0.md new file mode 100644 index 00000000000..0a02e0a5e03 --- /dev/null +++ b/.chronus/changes/openidconnect-auth-scopes-2026-6-25-22-45-0.md @@ -0,0 +1,8 @@ +--- +changeKind: feature +packages: + - "@typespec/http" + - "@typespec/openapi3" +--- + +Add scope support to `OpenIdConnectAuth`. The model now accepts an optional `Scopes` template parameter (`OpenIdConnectAuth`) and the OpenAPI3 emitter emits those scopes on each operation's `openIdConnect` security requirement. The scheme object itself remains unchanged (scopes are discovered via the `openIdConnectUrl`). Existing `OpenIdConnectAuth` usages are unaffected. diff --git a/packages/http/lib/auth.tsp b/packages/http/lib/auth.tsp index cc643eac10e..0b3920e1573 100644 --- a/packages/http/lib/auth.tsp +++ b/packages/http/lib/auth.tsp @@ -211,13 +211,19 @@ model ClientCredentialsFlow { * ```http * https://server.com/.well-known/openid-configuration * ``` + * + * @template ConnectUrl The openIdConnectUrl, where the OpenID provider publishes its discovery metadata. It can be specified relative to the server URL. + * @template Scopes The scope names required for operations that use this scheme. */ -model OpenIdConnectAuth { +model OpenIdConnectAuth { /** Auth type */ type: AuthType.openIdConnect; /** Connect url. It can be specified relative to the server URL */ openIdConnectUrl: ConnectUrl; + + /** Scope names required for operations that use this authentication scheme. */ + scopes: Scopes; } /** diff --git a/packages/http/src/auth.ts b/packages/http/src/auth.ts index a667ed984c8..a0aa8e7cbac 100644 --- a/packages/http/src/auth.ts +++ b/packages/http/src/auth.ts @@ -122,7 +122,12 @@ function makeHttpAuthRef(local: HttpAuth, reference: HttpAuth): HttpAuthRef { } else if (reference.type === "noAuth") { return { kind: "noAuth", auth: reference }; } else { - return { kind: "any", auth: reference }; + // Requirement scopes are read from the per-option (`local`) scheme so that + // operation-level `@useAuth` can request a different scope subset than the + // service default. Only openIdConnect currently surfaces scopes; the ref is + // scheme-agnostic so other scheme types can opt in without a new ref kind. + const scopes = local.type === "openIdConnect" ? (local.scopes ?? []) : []; + return { kind: "any", auth: reference, scopes }; } } @@ -161,5 +166,12 @@ function authsAreEqual(scheme1: HttpAuth, scheme2: HttpAuth): boolean { if (withoutModel1.type === "oauth2" && withoutModel2.type === "oauth2") { return deepEquals(ignoreScopes(withoutModel1), ignoreScopes(withoutModel2)); } + // Scopes live on the security requirement, not on the scheme identity, so two + // openIdConnect schemes that differ only by scopes are the same scheme and + // must dedupe to a single id (per-requirement scopes are still carried on the + // auth ref). No scope merge is needed because the scheme object lists no scopes. + if (withoutModel1.type === "openIdConnect" && withoutModel2.type === "openIdConnect") { + return deepEquals({ ...withoutModel1, scopes: [] }, { ...withoutModel2, scopes: [] }); + } return deepEquals(withoutModel1, withoutModel2); } diff --git a/packages/http/src/decorators.ts b/packages/http/src/decorators.ts index 8eebcd529c6..407849a0b7f 100644 --- a/packages/http/src/decorators.ts +++ b/packages/http/src/decorators.ts @@ -659,7 +659,15 @@ function extractHttpAuthentication( const auth = result.type === "oauth2" ? extractOAuth2Auth(modelType, result) - : { ...result, model: modelType }; + : { + ...result, + // OpenID Connect requirement scopes come from the `scopes` tuple on the + // model. Normalize to an array so downstream resolution can rely on it. + ...(result.type === "openIdConnect" && { + scopes: Array.isArray((result as any).scopes) ? (result as any).scopes : [], + }), + model: modelType, + }; return [ { ...auth, diff --git a/packages/http/src/types.ts b/packages/http/src/types.ts index 86486e93a16..6012f1d8817 100644 --- a/packages/http/src/types.ts +++ b/packages/http/src/types.ts @@ -188,6 +188,8 @@ export interface OAuth2Scope { export interface OpenIDConnectAuth extends HttpAuthBase { type: "openIdConnect"; openIdConnectUrl: string; + /** Scope names required for operations that use this scheme. */ + scopes: string[]; } /** @@ -203,6 +205,12 @@ export type HttpAuthRef = AnyHttpAuthRef | OAuth2HttpAuthRef | NoHttpAuthRef; export interface AnyHttpAuthRef { readonly kind: "any"; readonly auth: HttpAuth; + /** + * Scope names required for this scheme in the containing auth option. Empty + * for schemes that do not carry scopes. Populated for `openIdConnect`; kept + * scheme-agnostic so other scheme types can carry scopes without a new ref kind. + */ + readonly scopes: string[]; } export interface NoHttpAuthRef { diff --git a/packages/http/test/auth.test.ts b/packages/http/test/auth.test.ts index 1dab123c2f6..4d438ef331a 100644 --- a/packages/http/test/auth.test.ts +++ b/packages/http/test/auth.test.ts @@ -124,3 +124,32 @@ it("should deduplicate scopes when multiple flows share the same scopes", async expect(oauthRef.scopes).toHaveLength(1); } }); + +it("carries scopes on the auth ref for OpenIdConnectAuth", async () => { + const { program } = await Tester.compile(` + model oidc + is OpenIdConnectAuth<"https://example.org/.well-known/openid-configuration", Scopes>; + + @useAuth(oidc<["read", "write"]>) + @test op testOp(): void; + `); + + const [services] = getAllHttpServices(program); + const httpService = services[0]; + const auth = resolveAuthentication(httpService); + + const testOp = httpService.operations.find((op) => op.operation.name === "testOp"); + ok(testOp, "Should find test operation"); + + const operationAuth = auth.operationsAuth.get(testOp.operation); + ok(operationAuth, "Should have operation auth"); + + const ref = operationAuth.options[0].all[0]; + // OIDC routes through the scheme-agnostic `any` ref which carries the + // requirement scopes. + strictEqual(ref.kind, "any"); + strictEqual(ref.auth.type, "openIdConnect"); + if (ref.kind === "any") { + expect(ref.scopes).toEqual(["read", "write"]); + } +}); diff --git a/packages/openapi3/src/openapi.ts b/packages/openapi3/src/openapi.ts index 7c032d517f7..d98a8afd188 100644 --- a/packages/openapi3/src/openapi.ts +++ b/packages/openapi3/src/openapi.ts @@ -1994,7 +1994,9 @@ function createOAPIEmitter( securityOption[httpAuthRef.auth.id] = httpAuthRef.scopes; continue; default: - securityOption[httpAuthRef.auth.id] = []; + // Requirement scopes for any scheme that carries them (e.g. + // openIdConnect). Schemes without scopes resolve to an empty array. + securityOption[httpAuthRef.auth.id] = httpAuthRef.scopes; } } return securityOption; diff --git a/packages/openapi3/test/security.test.ts b/packages/openapi3/test/security.test.ts index 0380635afa3..5c7583ef6e8 100644 --- a/packages/openapi3/test/security.test.ts +++ b/packages/openapi3/test/security.test.ts @@ -247,6 +247,50 @@ worksFor(supportedVersions, ({ diagnoseOpenApiFor, openApiFor }) => { deepStrictEqual(res.security, [{ OpenIdConnectAuth: [] }]); }); + it("set openId auth with scopes", async () => { + const res = await openApiFor( + ` + @service + @useAuth(OpenIdConnectAuth<"https://api.example.com/openid", ["read", "write"]>) + namespace MyService {} + `, + ); + // The scheme object must NOT list scopes (clients discover them via the + // openIdConnectUrl); only the security requirement lists required scopes. + expect(res.components.securitySchemes).toEqual({ + OpenIdConnectAuth: { + type: "openIdConnect", + openIdConnectUrl: "https://api.example.com/openid", + description: expect.stringMatching(/^OpenID Connect/), + }, + }); + deepStrictEqual(res.security, [{ OpenIdConnectAuth: ["read", "write"] }]); + }); + + it("set openId auth scopes at the operation level", async () => { + const res = await openApiFor( + ` + @service + @useAuth(OpenIdConnectAuth<"https://api.example.com/openid", ["read"]>) + namespace MyService { + @route("/a") + @useAuth(OpenIdConnectAuth<"https://api.example.com/openid", ["read", "write"]>) + op a(): void; + } + `, + ); + // Same OIDC scheme (differs only by scopes) must dedupe to a single scheme. + expect(res.components.securitySchemes).toEqual({ + OpenIdConnectAuth: { + type: "openIdConnect", + openIdConnectUrl: "https://api.example.com/openid", + description: expect.stringMatching(/^OpenID Connect/), + }, + }); + deepStrictEqual(res.security, [{ OpenIdConnectAuth: ["read"] }]); + deepStrictEqual(res.paths["/a"].get.security, [{ OpenIdConnectAuth: ["read", "write"] }]); + }); + it("set a unsupported auth", async () => { const diagnostics = await diagnoseOpenApiFor( ` diff --git a/website/src/content/docs/docs/libraries/http/authentication.md b/website/src/content/docs/docs/libraries/http/authentication.md index 5b6532f7ae3..aacf76ff38e 100644 --- a/website/src/content/docs/docs/libraries/http/authentication.md +++ b/website/src/content/docs/docs/libraries/http/authentication.md @@ -150,6 +150,31 @@ OAuth relies on authentication scenarios called flows, which allow the resource For this purpose, an OAuth 2.0 server issues access tokens that client applications can use to access protected resources on behalf of the resource owner. For more information about OAuth 2.0, see [oauth.net](https://oauth.net) and [RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749). +### `OpenIdConnectAuth` + +OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0. The provider publishes its metadata (including its authorization and token endpoints) at a well-known discovery URL, so the scheme only needs that URL rather than explicit flow endpoints. + +```typespec +@useAuth(OpenIdConnectAuth<"https://api.example.com/.well-known/openid-configuration">) +``` + +Operations can require specific scopes via the second template argument. As with OAuth2, define a template alias so different operations can request different scopes without repeating the discovery URL: + +```tsp +alias MyOidc = OpenIdConnectAuth< + "https://api.example.com/.well-known/openid-configuration", + Scopes +>; + +// Use OpenID Connect with the "read" scope +@useAuth(MyOidc<["read"]>) +op list(): string[]; + +// Use OpenID Connect with the "write" scope +@useAuth(MyOidc<["write"]>) +op write(value: string): void; +``` + ## Application hierarchy The `@useAuth` decorator can be used on a service namespace, sub-namespace, interface or operation. The security scheme specified will be applied to all operations contained in the type. diff --git a/website/src/content/docs/docs/libraries/http/reference/data-types.md b/website/src/content/docs/docs/libraries/http/reference/data-types.md index bd4681e0542..7375babe930 100644 --- a/website/src/content/docs/docs/libraries/http/reference/data-types.md +++ b/website/src/content/docs/docs/libraries/http/reference/data-types.md @@ -567,21 +567,23 @@ https://server.com/.well-known/openid-configuration ``` ```typespec -model TypeSpec.Http.OpenIdConnectAuth +model TypeSpec.Http.OpenIdConnectAuth ``` #### Template Parameters -| Name | Description | -| ---------- | ----------- | -| ConnectUrl | | +| Name | Description | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------- | +| ConnectUrl | The openIdConnectUrl, where the OpenID provider publishes its discovery metadata. It can be specified relative to the server URL. | +| Scopes | The scope names required for operations that use this scheme. | #### Properties -| Name | Type | Description | -| ---------------- | -------------------------------------- | ----------------------------------------------------------- | -| type | `TypeSpec.Http.AuthType.openIdConnect` | Auth type | -| openIdConnectUrl | `ConnectUrl` | Connect url. It can be specified relative to the server URL | +| Name | Type | Description | +| ---------------- | -------------------------------------- | ------------------------------------------------------------------------ | +| type | `TypeSpec.Http.AuthType.openIdConnect` | Auth type | +| openIdConnectUrl | `ConnectUrl` | Connect url. It can be specified relative to the server URL | +| scopes | `Scopes` | Scope names required for operations that use this authentication scheme. | ### `PasswordFlow` {#TypeSpec.Http.PasswordFlow} From 1b9efa87f7baca9fee8471a44841df1f69a9e0ce Mon Sep 17 00:00:00 2001 From: Fiona Huang Date: Fri, 17 Jul 2026 09:51:53 -0400 Subject: [PATCH 021/249] [graphql] Add @typespec/graphql emitter (#11000) ## Summary This PR introduces `@typespec/graphql`, a new emitter that generates GraphQL SDL (Schema Definition Language) from TypeSpec definitions. ### Features - **Schema generation**: Emit complete GraphQL schemas from TypeSpec models and operations - **Operation types**: Support for `@query`, `@mutation`, and `@subscription` decorators - **Interface composition**: Use `@graphqlInterface` and `@compose` for GraphQL interface inheritance patterns - **Visibility filtering**: Automatic input/output type generation based on `@visibility` decorators - **Custom scalars**: `@specifiedBy` decorator for custom scalar URL specifications - **Schema customization**: `@schema` decorator for multi-schema scenarios ### Architecture The emitter uses a two-phase approach: 1. **Mutation phase**: Transforms TypeSpec types into GraphQL-compatible structures using the mutator framework, handling visibility filtering, naming conventions, and type deduplication 2. **Render phase**: Uses `@pinterest/alloy-graphql` components to emit the final SDL output ### Example ```typespec import "@typespec/graphql"; using TypeSpec.GraphQL; @query op getUser(id: string): User; @mutation op createUser(user: User): User; model User { name: string; email: string; } ``` Generates: ```graphql type Query { getUser(id: String!): User! } type Mutation { createUser(user: UserInput!): User! } type User { name: String! email: String! } input UserInput { name: String! email: String! } ``` ### Test plan - Unit tests for all decorators and components - E2E tests covering schema generation scenarios - Mutation engine tests for type transformation logic ### Notes - This emitter depends on [@pinterest/alloy-graphql](https://github.com/pinterest/alloy-graphql) - Tracked in GitHub issue #4933 --------- Co-authored-by: Timothee Guerin Co-authored-by: Swati Kumar Co-authored-by: swatikumar Co-authored-by: Steve Rice Co-authored-by: Angel Co-authored-by: Swati Kumar Co-authored-by: Claude Opus 4.6 (1M context) Co-authored-by: Timothee Guerin --- .../auto-decorator-setter-2026-7-14-11-0-0.md | 13 + .../feature-graphql-2026-6-9-12-47-10.md | 7 + ...ount-library-tspconfig-2026-7-14-11-0-2.md | 7 + ...-auto-decorator-setter-2026-7-14-11-0-1.md | 7 + .chronus/config.yaml | 1 + .gitignore | 3 + cspell.yaml | 3 + packages/graphql/CHANGELOG.md | 16 + packages/graphql/README.md | 319 +++++ packages/graphql/api-extractor.json | 4 + .../generated-defs/TypeSpec.GraphQL.ts | 220 ++++ .../TypeSpec.GraphQL.ts-test.ts | 10 + packages/graphql/lib/input-type.tsp | 12 + packages/graphql/lib/interface.tsp | 57 + packages/graphql/lib/main.tsp | 10 + packages/graphql/lib/nullable.tsp | 19 + packages/graphql/lib/one-of.tsp | 14 + packages/graphql/lib/operation-fields.tsp | 23 + packages/graphql/lib/operation-kind.tsp | 36 + packages/graphql/lib/scalars.tsp | 17 + packages/graphql/lib/schema.tsp | 31 + packages/graphql/lib/specified-by.tsp | 17 + packages/graphql/package.json | 76 ++ .../graphql/src/components/fields/field.tsx | 72 ++ .../graphql/src/components/fields/index.ts | 2 + .../src/components/fields/operation-field.tsx | 58 + packages/graphql/src/components/schema.tsx | 81 ++ .../src/components/types/enum-type.tsx | 25 + .../graphql/src/components/types/index.ts | 6 + .../src/components/types/input-type.tsx | 27 + .../src/components/types/interface-type.tsx | 25 + .../src/components/types/object-type.tsx | 30 + .../src/components/types/scalar-type.tsx | 21 + .../src/components/types/union-type.tsx | 24 + .../src/context/graphql-schema-context.tsx | 19 + packages/graphql/src/context/index.ts | 5 + packages/graphql/src/emitter.tsx | 81 ++ packages/graphql/src/index.ts | 5 + packages/graphql/src/lib.ts | 206 ++++ packages/graphql/src/lib/graphql-type-name.ts | 28 + packages/graphql/src/lib/interface.ts | 150 +++ packages/graphql/src/lib/naming.ts | 101 ++ packages/graphql/src/lib/operation-fields.ts | 108 ++ packages/graphql/src/lib/operation-kind.ts | 67 + packages/graphql/src/lib/scalar-mappings.ts | 236 ++++ packages/graphql/src/lib/schema.ts | 65 + packages/graphql/src/lib/specified-by.ts | 20 + .../graphql/src/lib/template-composition.ts | 55 + packages/graphql/src/lib/type-utils.ts | 338 ++++++ packages/graphql/src/lib/utils.ts | 55 + packages/graphql/src/lib/visibility.ts | 49 + .../graphql/src/mutation-engine/engine.ts | 138 +++ packages/graphql/src/mutation-engine/index.ts | 13 + .../mutation-engine/mutations/enum-member.ts | 49 + .../src/mutation-engine/mutations/enum.ts | 76 ++ .../src/mutation-engine/mutations/index.ts | 7 + .../mutations/model-property.ts | 64 + .../src/mutation-engine/mutations/model.ts | 222 ++++ .../mutation-engine/mutations/operation.ts | 104 ++ .../src/mutation-engine/mutations/scalar.ts | 97 ++ .../src/mutation-engine/mutations/union.ts | 312 +++++ .../graphql/src/mutation-engine/options.ts | 53 + .../graphql/src/mutation-engine/print-type.ts | 32 + .../src/mutation-engine/schema-mutator.ts | 207 ++++ .../graphql/src/mutation-engine/type-graph.ts | 106 ++ packages/graphql/src/tsp-index.ts | 23 + packages/graphql/src/type-usage.ts | 183 +++ packages/graphql/src/validate.ts | 148 +++ .../test/components/enum-type.test.tsx | 98 ++ .../test/components/input-type.test.tsx | 81 ++ .../test/components/interface-type.test.tsx | 60 + .../test/components/object-type.test.tsx | 88 ++ .../test/components/scalar-type.test.tsx | 79 ++ .../graphql/test/components/test-utils.tsx | 33 + .../test/components/union-type.test.tsx | 140 +++ packages/graphql/test/crash-repro.test.ts | 148 +++ .../graphql/test/e2e-manual/TEST_COVERAGE.md | 161 +++ packages/graphql/test/e2e-manual/emit.test.ts | 550 +++++++++ .../graphql/test/e2e-manual/output/.gitignore | 2 + packages/graphql/test/e2e.test.ts | 1074 +++++++++++++++++ packages/graphql/test/emitter.test.ts | 74 ++ packages/graphql/test/interface.test.ts | 216 ++++ packages/graphql/test/lib/naming.test.ts | 101 ++ .../graphql/test/lib/scalar-mappings.test.ts | 83 ++ .../test/lib/template-composition.test.ts | 107 ++ packages/graphql/test/lib/type-utils.test.ts | 129 ++ packages/graphql/test/main.tsp | 27 + .../test/mutation-engine/context.test.ts | 184 +++ .../test/mutation-engine/enums.test.ts | 94 ++ .../test/mutation-engine/models.test.ts | 255 ++++ .../naming-integration.test.ts | 121 ++ .../test/mutation-engine/operations.test.ts | 77 ++ .../test/mutation-engine/print-type.test.ts | 107 ++ .../test/mutation-engine/scalars.test.ts | 194 +++ .../mutation-engine/schema-mutator.test.ts | 291 +++++ .../test/mutation-engine/type-graph.test.ts | 200 +++ .../test/mutation-engine/unions.test.ts | 579 +++++++++ .../test/mutation-engine/visibility.test.ts | 276 +++++ .../graphql/test/operation-fields.test.ts | 170 +++ packages/graphql/test/operation-kind.test.ts | 45 + packages/graphql/test/schema.test.ts | 34 + packages/graphql/test/test-host.ts | 71 ++ packages/graphql/test/type-usage.test.ts | 253 ++++ .../graphql/test/unsupported-types.test.ts | 40 + packages/graphql/test/validate.test.ts | 306 +++++ packages/graphql/tsconfig.build.json | 9 + packages/graphql/tsconfig.json | 25 + packages/graphql/tspconfig.yaml | 7 + packages/graphql/vitest.config.ts | 20 + packages/playground-website/package.json | 1 + packages/playground-website/samples/build.js | 5 + .../playground-website/samples/graphql.tsp | 36 + packages/playground-website/src/config.ts | 1 + packages/playground-website/tsconfig.json | 3 +- pnpm-lock.yaml | 83 ++ pnpm-workspace.yaml | 3 + website/src/content/current-sidebar.ts | 7 + .../docs/docs/emitters/graphql/guide.md | 238 ++++ .../emitters/graphql/reference/data-types.md | 39 + .../emitters/graphql/reference/decorators.md | 235 ++++ .../emitters/graphql/reference/emitter.md | 73 ++ .../docs/emitters/graphql/reference/index.mdx | 52 + 122 files changed, 12099 insertions(+), 1 deletion(-) create mode 100644 .chronus/changes/auto-decorator-setter-2026-7-14-11-0-0.md create mode 100644 .chronus/changes/feature-graphql-2026-6-9-12-47-10.md create mode 100644 .chronus/changes/tester-mount-library-tspconfig-2026-7-14-11-0-2.md create mode 100644 .chronus/changes/tspd-auto-decorator-setter-2026-7-14-11-0-1.md create mode 100644 packages/graphql/CHANGELOG.md create mode 100644 packages/graphql/README.md create mode 100644 packages/graphql/api-extractor.json create mode 100644 packages/graphql/generated-defs/TypeSpec.GraphQL.ts create mode 100644 packages/graphql/generated-defs/TypeSpec.GraphQL.ts-test.ts create mode 100644 packages/graphql/lib/input-type.tsp create mode 100644 packages/graphql/lib/interface.tsp create mode 100644 packages/graphql/lib/main.tsp create mode 100644 packages/graphql/lib/nullable.tsp create mode 100644 packages/graphql/lib/one-of.tsp create mode 100644 packages/graphql/lib/operation-fields.tsp create mode 100644 packages/graphql/lib/operation-kind.tsp create mode 100644 packages/graphql/lib/scalars.tsp create mode 100644 packages/graphql/lib/schema.tsp create mode 100644 packages/graphql/lib/specified-by.tsp create mode 100644 packages/graphql/package.json create mode 100644 packages/graphql/src/components/fields/field.tsx create mode 100644 packages/graphql/src/components/fields/index.ts create mode 100644 packages/graphql/src/components/fields/operation-field.tsx create mode 100644 packages/graphql/src/components/schema.tsx create mode 100644 packages/graphql/src/components/types/enum-type.tsx create mode 100644 packages/graphql/src/components/types/index.ts create mode 100644 packages/graphql/src/components/types/input-type.tsx create mode 100644 packages/graphql/src/components/types/interface-type.tsx create mode 100644 packages/graphql/src/components/types/object-type.tsx create mode 100644 packages/graphql/src/components/types/scalar-type.tsx create mode 100644 packages/graphql/src/components/types/union-type.tsx create mode 100644 packages/graphql/src/context/graphql-schema-context.tsx create mode 100644 packages/graphql/src/context/index.ts create mode 100644 packages/graphql/src/emitter.tsx create mode 100644 packages/graphql/src/index.ts create mode 100644 packages/graphql/src/lib.ts create mode 100644 packages/graphql/src/lib/graphql-type-name.ts create mode 100644 packages/graphql/src/lib/interface.ts create mode 100644 packages/graphql/src/lib/naming.ts create mode 100644 packages/graphql/src/lib/operation-fields.ts create mode 100644 packages/graphql/src/lib/operation-kind.ts create mode 100644 packages/graphql/src/lib/scalar-mappings.ts create mode 100644 packages/graphql/src/lib/schema.ts create mode 100644 packages/graphql/src/lib/specified-by.ts create mode 100644 packages/graphql/src/lib/template-composition.ts create mode 100644 packages/graphql/src/lib/type-utils.ts create mode 100644 packages/graphql/src/lib/utils.ts create mode 100644 packages/graphql/src/lib/visibility.ts create mode 100644 packages/graphql/src/mutation-engine/engine.ts create mode 100644 packages/graphql/src/mutation-engine/index.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/enum-member.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/enum.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/index.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/model-property.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/model.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/operation.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/scalar.ts create mode 100644 packages/graphql/src/mutation-engine/mutations/union.ts create mode 100644 packages/graphql/src/mutation-engine/options.ts create mode 100644 packages/graphql/src/mutation-engine/print-type.ts create mode 100644 packages/graphql/src/mutation-engine/schema-mutator.ts create mode 100644 packages/graphql/src/mutation-engine/type-graph.ts create mode 100644 packages/graphql/src/tsp-index.ts create mode 100644 packages/graphql/src/type-usage.ts create mode 100644 packages/graphql/src/validate.ts create mode 100644 packages/graphql/test/components/enum-type.test.tsx create mode 100644 packages/graphql/test/components/input-type.test.tsx create mode 100644 packages/graphql/test/components/interface-type.test.tsx create mode 100644 packages/graphql/test/components/object-type.test.tsx create mode 100644 packages/graphql/test/components/scalar-type.test.tsx create mode 100644 packages/graphql/test/components/test-utils.tsx create mode 100644 packages/graphql/test/components/union-type.test.tsx create mode 100644 packages/graphql/test/crash-repro.test.ts create mode 100644 packages/graphql/test/e2e-manual/TEST_COVERAGE.md create mode 100644 packages/graphql/test/e2e-manual/emit.test.ts create mode 100644 packages/graphql/test/e2e-manual/output/.gitignore create mode 100644 packages/graphql/test/e2e.test.ts create mode 100644 packages/graphql/test/emitter.test.ts create mode 100644 packages/graphql/test/interface.test.ts create mode 100644 packages/graphql/test/lib/naming.test.ts create mode 100644 packages/graphql/test/lib/scalar-mappings.test.ts create mode 100644 packages/graphql/test/lib/template-composition.test.ts create mode 100644 packages/graphql/test/lib/type-utils.test.ts create mode 100644 packages/graphql/test/main.tsp create mode 100644 packages/graphql/test/mutation-engine/context.test.ts create mode 100644 packages/graphql/test/mutation-engine/enums.test.ts create mode 100644 packages/graphql/test/mutation-engine/models.test.ts create mode 100644 packages/graphql/test/mutation-engine/naming-integration.test.ts create mode 100644 packages/graphql/test/mutation-engine/operations.test.ts create mode 100644 packages/graphql/test/mutation-engine/print-type.test.ts create mode 100644 packages/graphql/test/mutation-engine/scalars.test.ts create mode 100644 packages/graphql/test/mutation-engine/schema-mutator.test.ts create mode 100644 packages/graphql/test/mutation-engine/type-graph.test.ts create mode 100644 packages/graphql/test/mutation-engine/unions.test.ts create mode 100644 packages/graphql/test/mutation-engine/visibility.test.ts create mode 100644 packages/graphql/test/operation-fields.test.ts create mode 100644 packages/graphql/test/operation-kind.test.ts create mode 100644 packages/graphql/test/schema.test.ts create mode 100644 packages/graphql/test/test-host.ts create mode 100644 packages/graphql/test/type-usage.test.ts create mode 100644 packages/graphql/test/unsupported-types.test.ts create mode 100644 packages/graphql/test/validate.test.ts create mode 100644 packages/graphql/tsconfig.build.json create mode 100644 packages/graphql/tsconfig.json create mode 100644 packages/graphql/tspconfig.yaml create mode 100644 packages/graphql/vitest.config.ts create mode 100644 packages/playground-website/samples/graphql.tsp create mode 100644 website/src/content/docs/docs/emitters/graphql/guide.md create mode 100644 website/src/content/docs/docs/emitters/graphql/reference/data-types.md create mode 100644 website/src/content/docs/docs/emitters/graphql/reference/decorators.md create mode 100644 website/src/content/docs/docs/emitters/graphql/reference/emitter.md create mode 100644 website/src/content/docs/docs/emitters/graphql/reference/index.mdx diff --git a/.chronus/changes/auto-decorator-setter-2026-7-14-11-0-0.md b/.chronus/changes/auto-decorator-setter-2026-7-14-11-0-0.md new file mode 100644 index 00000000000..831f769d2f2 --- /dev/null +++ b/.chronus/changes/auto-decorator-setter-2026-7-14-11-0-0.md @@ -0,0 +1,13 @@ +--- +changeKind: feature +packages: + - "@typespec/compiler" +--- + +Add `setAutoDecorator` API to programmatically apply an `auto` decorator to a target, mirroring what the synthesized `auto dec` implementation does when the decorator is written in source. This lets emitters and mutators mark synthetic types without reaching into the program state map directly. + +```ts +import { setAutoDecorator } from "@typespec/compiler"; + +setAutoDecorator(program, "MyLib.myFlag", target); +``` diff --git a/.chronus/changes/feature-graphql-2026-6-9-12-47-10.md b/.chronus/changes/feature-graphql-2026-6-9-12-47-10.md new file mode 100644 index 00000000000..2b332b3f2d9 --- /dev/null +++ b/.chronus/changes/feature-graphql-2026-6-9-12-47-10.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/graphql" +--- + +Add @typespec/graphql emitter for generating GraphQL SDL from TypeSpec definitions \ No newline at end of file diff --git a/.chronus/changes/tester-mount-library-tspconfig-2026-7-14-11-0-2.md b/.chronus/changes/tester-mount-library-tspconfig-2026-7-14-11-0-2.md new file mode 100644 index 00000000000..70b623b5b66 --- /dev/null +++ b/.chronus/changes/tester-mount-library-tspconfig-2026-7-14-11-0-2.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/compiler" +--- + +`createTester` now mounts each discovered library's `tspconfig.yaml` into the virtual file system, so experimental features a library opts into (e.g. `auto-decorators`) are honored when compiling against the tester. diff --git a/.chronus/changes/tspd-auto-decorator-setter-2026-7-14-11-0-1.md b/.chronus/changes/tspd-auto-decorator-setter-2026-7-14-11-0-1.md new file mode 100644 index 00000000000..84bbb9b0a5a --- /dev/null +++ b/.chronus/changes/tspd-auto-decorator-setter-2026-7-14-11-0-1.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/tspd" +--- + +`tspd gen-extern-signature` now also generates a typed setter (e.g. `setMyFlag`, `setMyLabel`) for each `auto` decorator, alongside the existing `is*`/`get*` readers. diff --git a/.chronus/config.yaml b/.chronus/config.yaml index 39eb1f5dd5b..49886edc3c4 100644 --- a/.chronus/config.yaml +++ b/.chronus/config.yaml @@ -60,6 +60,7 @@ versionPolicies: - "@typespec/streams" - "@typespec/xml" - "@typespec/standalone-cli" + - "@typespec/graphql" - name: standalone type: independent diff --git a/.gitignore b/.gitignore index fb099c3ec88..b2d237a3bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -243,3 +243,6 @@ packages/http-client-python/tests/.wheels/ # Turborepo .turbo + +# agents +.claude/settings.local.json diff --git a/cspell.yaml b/cspell.yaml index 2c26354c41f..fe535d312a0 100644 --- a/cspell.yaml +++ b/cspell.yaml @@ -61,6 +61,7 @@ words: - debugpy - Declipse - dedented + - dedup - Dedupes - deps - deser @@ -200,6 +201,7 @@ words: - onigasm - onwarn - openapi + - opfields - oxlint - openapiv - Packument @@ -367,6 +369,7 @@ ignorePaths: - "**/*.plist" - .git/** - .gitignore + - .claude/** - .vscode/** - .editorconfig - .github/CODEOWNERS diff --git a/packages/graphql/CHANGELOG.md b/packages/graphql/CHANGELOG.md new file mode 100644 index 00000000000..cefd47fc332 --- /dev/null +++ b/packages/graphql/CHANGELOG.md @@ -0,0 +1,16 @@ +# Change Log - @typespec/graphql + +## 0.1.0 + +### Features + +- Initial release of the GraphQL emitter +- Support for `@query`, `@mutation`, and `@subscription` operation decorators +- Support for `@graphqlInterface` decorator to mark models as GraphQL interfaces +- Support for `@compose` decorator to implement interfaces +- Support for `@operationFields` decorator to add operations to models +- Support for `@specifiedBy` decorator for custom scalar URLs +- Automatic input type generation with `Input` suffix +- `@oneOf` input generation for union-as-input parameters +- Visibility-based input/output type splitting +- Union flattening and scalar wrapper generation diff --git a/packages/graphql/README.md b/packages/graphql/README.md new file mode 100644 index 00000000000..09b5a8dc94c --- /dev/null +++ b/packages/graphql/README.md @@ -0,0 +1,319 @@ +# @typespec/graphql + +TypeSpec library for emitting GraphQL + +## Install + +```bash +npm install @typespec/graphql +``` + +## Emitter usage + +1. Via the command line + +```bash +tsp compile . --emit=@typespec/graphql +``` + +2. Via the config + +```yaml +emit: + - "@typespec/graphql" +``` + +The config can be extended with options as follows: + +```yaml +emit: + - "@typespec/graphql" +options: + "@typespec/graphql": + option: value +``` + +## Emitter options + +### `emitter-output-dir` + +**Type:** `absolutePath` + +Defines the emitter output directory. Defaults to `{output-dir}/@typespec/graphql` +See [Configuring output directory for more info](https://typespec.io/docs/handbook/configuration/configuration/#configuring-output-directory) + +### `output-file` + +**Type:** `string` + +Name of the output file. +Output file will interpolate the following values: + +- schema-name: Name of the schema if multiple + +Default: `{schema-name}.graphql` + +Example Single schema + +- `schema.graphql` + +Example Multiple schemas + +- `Org1.Schema1.graphql` +- `Org1.Schema2.graphql` + +### `new-line` + +**Type:** `"crlf" | "lf"` + +**Default:** `"lf"` + +Set the newLine character for emitting files. + +### `omit-unreachable-types` + +**Type:** `boolean` + +Omit unreachable types. +By default all types declared under the schema namespace will be included. +With this flag on only types references in an operation will be emitted. + +## Decorators + +### TypeSpec.GraphQL + +- [`@compose`](#@compose) +- [`@graphqlInterface`](#@graphqlinterface) +- [`@mutation`](#@mutation) +- [`@operationFields`](#@operationfields) +- [`@query`](#@query) +- [`@schema`](#@schema) +- [`@specifiedBy`](#@specifiedby) +- [`@subscription`](#@subscription) + +#### `@compose` + +Specify the GraphQL interfaces that should be implemented by a model. +The interfaces must be decorated with the `@graphqlInterface` decorator, +and all of the interfaces' properties must be present and compatible. + +```typespec +@TypeSpec.GraphQL.compose(...interfaces: Model[]) +``` + +##### Target + +`Model` + +##### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| interfaces | `Model[]` | | + +##### Examples + +```typespec +@graphqlInterface(#{ interfaceOnly: true }) +model Node { + id: string; +} + +@compose(Node) +model User { + ...Node; + name: string; +} +``` + +#### `@graphqlInterface` + +Mark this model as a GraphQL Interface. Interfaces can be implemented by other models +using the `@compose` decorator. + +```typespec +@TypeSpec.GraphQL.graphqlInterface(options?: valueof { interfaceOnly: boolean }) +``` + +##### Target + +`Model` + +##### Parameters + +| Name | Type | Description | +| ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| options | `valueof {...}` | .interfaceOnly When true, the model will only be emitted as an interface
(no "Interface" suffix is added to the name). Use this for abstract interfaces that
will never be used directly as output/input types (e.g., Node, Connection). Defaults to false. | + +##### Examples + +```typespec +@graphqlInterface(#{ interfaceOnly: true }) +model Node { + id: string; +} + +@compose(Node) +model User { + ...Node; + name: string; +} +// Emits: interface Node { id: String! } +// type User implements Node { id: String!; name: String! } +``` + +#### `@mutation` + +Specify the GraphQL Operation kind for the target operation to be `MUTATION`. + +```typespec +@TypeSpec.GraphQL.mutation +``` + +##### Target + +`Operation` + +##### Parameters + +None + +##### Examples + +```typespec +@mutation op createUser(name: string): User; +``` + +#### `@operationFields` + +Assign one or more operations or interfaces to act as fields with arguments on a model. +The operations become fields on the GraphQL type with their parameters as arguments. + +```typespec +@TypeSpec.GraphQL.operationFields(...operations: Operation | Interface[]) +``` + +##### Target + +`Model` + +##### Parameters + +| Name | Type | Description | +| ---------- | -------------------------- | ----------- | +| operations | `Operation \| Interface[]` | | + +##### Examples + +```typespec +op followers(query: string): Person[]; + +@operationFields(followers) +model Person { + name: string; +} +// Emits: type Person { name: String!; followers(query: String!): [Person!]! } +``` + +#### `@query` + +Specify the GraphQL Operation kind for the target operation to be `QUERY`. + +```typespec +@TypeSpec.GraphQL.query +``` + +##### Target + +`Operation` + +##### Parameters + +None + +##### Examples + +```typespec +@query op getUser(id: string): User; +``` + +#### `@schema` + +Mark this namespace as describing a GraphQL schema and configure schema properties. +All types and operations within the namespace will be emitted to a single GraphQL schema file. + +```typespec +@TypeSpec.GraphQL.schema(options?: valueof TypeSpec.GraphQL.Schema.SchemaOptions) +``` + +##### Target + +`Namespace` + +##### Parameters + +| Name | Type | Description | +| ------- | ----------------------------------------- | ----------- | +| options | [valueof `SchemaOptions`](#schemaoptions) | | + +##### Examples + +```typespec +@schema(#{ name: "MyAPI" }) +namespace MyAPI { + model User { + id: string; + name: string; + } + @query op getUser(id: string): User; +} +// Emits: MyAPI.graphql +``` + +#### `@specifiedBy` + +Provide a specification URL for a custom GraphQL scalar type. +This maps to the `@specifiedBy` directive in the emitted GraphQL schema. + +```typespec +@TypeSpec.GraphQL.specifiedBy(url: valueof url) +``` + +##### Target + +`Scalar` + +##### Parameters + +| Name | Type | Description | +| ---- | ------------- | ------------------------------------ | +| url | `valueof url` | URL to the scalar type specification | + +##### Examples + +```typespec +@specifiedBy("https://scalars.graphql.org/andimarek/date-time") +scalar DateTime extends utcDateTime; +``` + +#### `@subscription` + +Specify the GraphQL Operation kind for the target operation to be `SUBSCRIPTION`. + +```typespec +@TypeSpec.GraphQL.subscription +``` + +##### Target + +`Operation` + +##### Parameters + +None + +##### Examples + +```typespec +@subscription op onUserCreated(): User; +``` diff --git a/packages/graphql/api-extractor.json b/packages/graphql/api-extractor.json new file mode 100644 index 00000000000..2069b8ac37f --- /dev/null +++ b/packages/graphql/api-extractor.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "../../api-extractor.base.json" +} diff --git a/packages/graphql/generated-defs/TypeSpec.GraphQL.ts b/packages/graphql/generated-defs/TypeSpec.GraphQL.ts new file mode 100644 index 00000000000..16ea56e7827 --- /dev/null +++ b/packages/graphql/generated-defs/TypeSpec.GraphQL.ts @@ -0,0 +1,220 @@ +import { + type DecoratorContext, + type DecoratorValidatorCallbacks, + hasAutoDecorator, + type Interface, + type Model, + type ModelProperty, + type Namespace, + type Operation, + type Program, + type Scalar, + setAutoDecorator, + type Union, +} from "@typespec/compiler"; + +export interface SchemaOptions { + readonly name?: string; +} + +/** + * Mark this model as a GraphQL Interface. Interfaces can be implemented by other models + * using the `@compose` decorator. + * + * @param options .interfaceOnly When true, the model will only be emitted as an interface + * (no "Interface" suffix is added to the name). Use this for abstract interfaces that + * will never be used directly as output/input types (e.g., Node, Connection). Defaults to false. + * @example + * ```typespec + * @graphqlInterface(#{ interfaceOnly: true }) + * model Node { + * id: string; + * } + * + * @compose(Node) + * model User { + * ...Node; + * name: string; + * } + * // Emits: interface Node { id: String! } + * // type User implements Node { id: String!; name: String! } + * ``` + */ +export type GraphqlInterfaceDecorator = ( + context: DecoratorContext, + target: Model, + options?: { + readonly interfaceOnly?: boolean; + }, +) => DecoratorValidatorCallbacks | void; + +/** + * Specify the GraphQL interfaces that should be implemented by a model. + * The interfaces must be decorated with the `@graphqlInterface` decorator, + * and all of the interfaces' properties must be present and compatible. + * + * @example + * ```typespec + * @graphqlInterface(#{ interfaceOnly: true }) + * model Node { + * id: string; + * } + * + * @compose(Node) + * model User { + * ...Node; + * name: string; + * } + * ``` + */ +export type ComposeDecorator = ( + context: DecoratorContext, + target: Model, + ...interfaces: Model[] +) => DecoratorValidatorCallbacks | void; + +/** + * Assign one or more operations or interfaces to act as fields with arguments on a model. + * The operations become fields on the GraphQL type with their parameters as arguments. + * + * @example + * ```typespec + * op followers(query: string): Person[]; + * + * @operationFields(followers) + * model Person { + * name: string; + * } + * // Emits: type Person { name: String!; followers(query: String!): [Person!]! } + * ``` + */ +export type OperationFieldsDecorator = ( + context: DecoratorContext, + target: Model, + ...operations: (Operation | Interface)[] +) => DecoratorValidatorCallbacks | void; + +/** + * Specify the GraphQL Operation kind for the target operation to be `MUTATION`. + * + * @example + * ```typespec + * @mutation op createUser(name: string): User; + * ``` + */ +export type MutationDecorator = ( + context: DecoratorContext, + target: Operation, +) => DecoratorValidatorCallbacks | void; + +/** + * Specify the GraphQL Operation kind for the target operation to be `QUERY`. + * + * @example + * ```typespec + * @query op getUser(id: string): User; + * ``` + */ +export type QueryDecorator = ( + context: DecoratorContext, + target: Operation, +) => DecoratorValidatorCallbacks | void; + +/** + * Specify the GraphQL Operation kind for the target operation to be `SUBSCRIPTION`. + * + * @example + * ```typespec + * @subscription op onUserCreated(): User; + * ``` + */ +export type SubscriptionDecorator = ( + context: DecoratorContext, + target: Operation, +) => DecoratorValidatorCallbacks | void; + +/** + * Mark this namespace as describing a GraphQL schema and configure schema properties. + * All types and operations within the namespace will be emitted to a single GraphQL schema file. + * + * @example + * ```typespec + * @schema(#{ name: "MyAPI" }) + * namespace MyAPI { + * model User { id: string; name: string; } + * @query op getUser(id: string): User; + * } + * // Emits: MyAPI.graphql + * ``` + */ +export type SchemaDecorator = ( + context: DecoratorContext, + target: Namespace, + options?: SchemaOptions, +) => DecoratorValidatorCallbacks | void; + +/** + * Provide a specification URL for a custom GraphQL scalar type. + * This maps to the `@specifiedBy` directive in the emitted GraphQL schema. + * + * @param url URL to the scalar type specification + * @example + * ```typespec + * @specifiedBy("https://scalars.graphql.org/andimarek/date-time") + * scalar DateTime extends utcDateTime; + * ``` + */ +export type SpecifiedByDecorator = ( + context: DecoratorContext, + target: Scalar, + url: string, +) => DecoratorValidatorCallbacks | void; + +export type TypeSpecGraphQLDecorators = { + graphqlInterface: GraphqlInterfaceDecorator; + compose: ComposeDecorator; + operationFields: OperationFieldsDecorator; + mutation: MutationDecorator; + query: QueryDecorator; + subscription: SubscriptionDecorator; + schema: SchemaDecorator; + specifiedBy: SpecifiedByDecorator; +}; + +export function isInputType(program: Program, target: Model): boolean { + return hasAutoDecorator(program, "TypeSpec.GraphQL.inputType", target); +} + +export function setInputType(program: Program, target: Model): void { + setAutoDecorator(program, "TypeSpec.GraphQL.inputType", target); +} + +export function isNullable( + program: Program, + target: ModelProperty | Operation | Union | Model, +): boolean { + return hasAutoDecorator(program, "TypeSpec.GraphQL.nullable", target); +} + +export function setNullable( + program: Program, + target: ModelProperty | Operation | Union | Model, +): void { + setAutoDecorator(program, "TypeSpec.GraphQL.nullable", target); +} + +export function isNullableElements(program: Program, target: ModelProperty | Operation): boolean { + return hasAutoDecorator(program, "TypeSpec.GraphQL.nullableElements", target); +} + +export function setNullableElements(program: Program, target: ModelProperty | Operation): void { + setAutoDecorator(program, "TypeSpec.GraphQL.nullableElements", target); +} + +export function isOneOf(program: Program, target: Model): boolean { + return hasAutoDecorator(program, "TypeSpec.GraphQL.oneOf", target); +} + +export function setOneOf(program: Program, target: Model): void { + setAutoDecorator(program, "TypeSpec.GraphQL.oneOf", target); +} diff --git a/packages/graphql/generated-defs/TypeSpec.GraphQL.ts-test.ts b/packages/graphql/generated-defs/TypeSpec.GraphQL.ts-test.ts new file mode 100644 index 00000000000..5224d584e53 --- /dev/null +++ b/packages/graphql/generated-defs/TypeSpec.GraphQL.ts-test.ts @@ -0,0 +1,10 @@ +// An error in the imports would mean that the decorator is not exported or +// doesn't have the right name. + +import { $decorators } from "@typespec/graphql"; +import type { TypeSpecGraphQLDecorators } from "./TypeSpec.GraphQL.js"; + +/** + * An error here would mean that the exported decorator is not using the same signature. Make sure to have export const $decName: DecNameDecorator = (...) => ... + */ +const _decs: TypeSpecGraphQLDecorators = $decorators["TypeSpec.GraphQL"]; diff --git a/packages/graphql/lib/input-type.tsp b/packages/graphql/lib/input-type.tsp new file mode 100644 index 00000000000..267cd7e1b9c --- /dev/null +++ b/packages/graphql/lib/input-type.tsp @@ -0,0 +1,12 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +/** + * Mark a model as a GraphQL input type in the emitted schema. + * + * This decorator is applied automatically by the mutation engine when it produces + * a model that is used in input position. The emitter uses this to emit the model + * as an `input` type rather than an object `type`. + */ +internal auto dec inputType(target: Model); diff --git a/packages/graphql/lib/interface.tsp b/packages/graphql/lib/interface.tsp new file mode 100644 index 00000000000..081e06b0a8e --- /dev/null +++ b/packages/graphql/lib/interface.tsp @@ -0,0 +1,57 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +/** + * Mark this model as a GraphQL Interface. Interfaces can be implemented by other models + * using the `@compose` decorator. + * + * @param options.interfaceOnly When true, the model will only be emitted as an interface + * (no "Interface" suffix is added to the name). Use this for abstract interfaces that + * will never be used directly as output/input types (e.g., Node, Connection). Defaults to false. + * + * @example + * + * ```typespec + * @graphqlInterface(#{ interfaceOnly: true }) + * model Node { + * id: string; + * } + * + * @compose(Node) + * model User { + * ...Node; + * name: string; + * } + * // Emits: interface Node { id: String! } + * // type User implements Node { id: String!; name: String! } + * ``` + */ +extern dec graphqlInterface( + target: Model, + options?: valueof { + interfaceOnly?: boolean, + } +); + +/** + * Specify the GraphQL interfaces that should be implemented by a model. + * The interfaces must be decorated with the `@graphqlInterface` decorator, + * and all of the interfaces' properties must be present and compatible. + * + * @example + * + * ```typespec + * @graphqlInterface(#{ interfaceOnly: true }) + * model Node { + * id: string; + * } + * + * @compose(Node) + * model User { + * ...Node; + * name: string; + * } + * ``` + */ +extern dec compose(target: Model, ...interfaces: Model[]); diff --git a/packages/graphql/lib/main.tsp b/packages/graphql/lib/main.tsp new file mode 100644 index 00000000000..a05ff78a47e --- /dev/null +++ b/packages/graphql/lib/main.tsp @@ -0,0 +1,10 @@ +import "../dist/src/tsp-index.js"; +import "./interface.tsp"; +import "./input-type.tsp"; +import "./nullable.tsp"; +import "./one-of.tsp"; +import "./operation-fields.tsp"; +import "./operation-kind.tsp"; +import "./scalars.tsp"; +import "./schema.tsp"; +import "./specified-by.tsp"; diff --git a/packages/graphql/lib/nullable.tsp b/packages/graphql/lib/nullable.tsp new file mode 100644 index 00000000000..f8b0f119837 --- /dev/null +++ b/packages/graphql/lib/nullable.tsp @@ -0,0 +1,19 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +/** + * Mark a field, operation, or type as nullable in the emitted GraphQL schema. + * + * Applied automatically by the mutation engine when it strips `| null` from + * union types, and can also be applied directly in TypeSpec source. + */ +internal auto dec nullable(target: ModelProperty | Operation | Union | Model); + +/** + * Mark a field or operation as having nullable array elements in the emitted GraphQL schema. + * + * Applied automatically by the mutation engine when it detects `Array` + * patterns. Causes the emitter to emit `[T]` instead of `[T!]`. + */ +internal auto dec nullableElements(target: ModelProperty | Operation); diff --git a/packages/graphql/lib/one-of.tsp b/packages/graphql/lib/one-of.tsp new file mode 100644 index 00000000000..17d7091446c --- /dev/null +++ b/packages/graphql/lib/one-of.tsp @@ -0,0 +1,14 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +/** + * Mark a model as a `@oneOf` input object in the emitted GraphQL schema. + * + * This decorator is applied automatically by the mutation engine when it converts + * a union type in input context to a synthetic input object (since GraphQL unions + * are output-only). The emitter uses this to emit the `@oneOf` directive. + * + * @see https://spec.graphql.org/September2025/#sec-OneOf-Input-Objects + */ +internal auto dec oneOf(target: Model); diff --git a/packages/graphql/lib/operation-fields.tsp b/packages/graphql/lib/operation-fields.tsp new file mode 100644 index 00000000000..8c918e7edcf --- /dev/null +++ b/packages/graphql/lib/operation-fields.tsp @@ -0,0 +1,23 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +alias OperationOrInterface = Operation | Interface; + +/** + * Assign one or more operations or interfaces to act as fields with arguments on a model. + * The operations become fields on the GraphQL type with their parameters as arguments. + * + * @example + * + * ```typespec + * op followers(query: string): Person[]; + * + * @operationFields(followers) + * model Person { + * name: string; + * } + * // Emits: type Person { name: String!; followers(query: String!): [Person!]! } + * ``` + */ +extern dec operationFields(target: Model, ...operations: OperationOrInterface[]); diff --git a/packages/graphql/lib/operation-kind.tsp b/packages/graphql/lib/operation-kind.tsp new file mode 100644 index 00000000000..1f23c5d734b --- /dev/null +++ b/packages/graphql/lib/operation-kind.tsp @@ -0,0 +1,36 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +/** + * Specify the GraphQL Operation kind for the target operation to be `MUTATION`. + * + * @example + * + * ```typespec + * @mutation op createUser(name: string): User; + * ``` + */ +extern dec mutation(target: Operation); + +/** + * Specify the GraphQL Operation kind for the target operation to be `QUERY`. + * + * @example + * + * ```typespec + * @query op getUser(id: string): User; + * ``` + */ +extern dec query(target: Operation); + +/** + * Specify the GraphQL Operation kind for the target operation to be `SUBSCRIPTION`. + * + * @example + * + * ```typespec + * @subscription op onUserCreated(): User; + * ``` + */ +extern dec subscription(target: Operation); diff --git a/packages/graphql/lib/scalars.tsp b/packages/graphql/lib/scalars.tsp new file mode 100644 index 00000000000..26ec0808e48 --- /dev/null +++ b/packages/graphql/lib/scalars.tsp @@ -0,0 +1,17 @@ +namespace TypeSpec.GraphQL; + +/** + * Represents a GraphQL ID scalar — a unique identifier serialized as a string. + * + * @see https://spec.graphql.org/September2025/#sec-ID + * + * @example + * + * ```typespec + * model User { + * id: GraphQL.ID; + * name: string; + * } + * ``` + */ +scalar ID extends string; diff --git a/packages/graphql/lib/schema.tsp b/packages/graphql/lib/schema.tsp new file mode 100644 index 00000000000..7e815e534d3 --- /dev/null +++ b/packages/graphql/lib/schema.tsp @@ -0,0 +1,31 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +namespace Schema { + /** Options for configuring a GraphQL schema. */ + model SchemaOptions { + /** + * The name of the GraphQL schema. Used in the output filename when emitting + * multiple schemas (e.g., `{name}.graphql`). Defaults to `"schema"`. + */ + name?: string; + } +} + +/** + * Mark this namespace as describing a GraphQL schema and configure schema properties. + * All types and operations within the namespace will be emitted to a single GraphQL schema file. + * + * @example + * + * ```typespec + * @schema(#{ name: "MyAPI" }) + * namespace MyAPI { + * model User { id: string; name: string; } + * @query op getUser(id: string): User; + * } + * // Emits: MyAPI.graphql + * ``` + */ +extern dec schema(target: Namespace, options?: valueof Schema.SchemaOptions); diff --git a/packages/graphql/lib/specified-by.tsp b/packages/graphql/lib/specified-by.tsp new file mode 100644 index 00000000000..8b5d5edfd44 --- /dev/null +++ b/packages/graphql/lib/specified-by.tsp @@ -0,0 +1,17 @@ +using TypeSpec.Reflection; + +namespace TypeSpec.GraphQL; + +/** + * Provide a specification URL for a custom GraphQL scalar type. + * This maps to the `@specifiedBy` directive in the emitted GraphQL schema. + * + * @param url URL to the scalar type specification + * @example + * + * ```typespec + * @specifiedBy("https://scalars.graphql.org/andimarek/date-time") + * scalar DateTime extends utcDateTime; + * ``` + */ +extern dec specifiedBy(target: Scalar, url: valueof url); diff --git a/packages/graphql/package.json b/packages/graphql/package.json new file mode 100644 index 00000000000..63f34784230 --- /dev/null +++ b/packages/graphql/package.json @@ -0,0 +1,76 @@ +{ + "name": "@typespec/graphql", + "version": "0.1.0", + "author": "Microsoft Corporation", + "description": "TypeSpec library for emitting GraphQL", + "homepage": "https://typespec.io", + "readme": "https://github.com/microsoft/typespec/blob/main/README.md", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/microsoft/typespec.git" + }, + "bugs": { + "url": "https://github.com/microsoft/typespec/issues" + }, + "keywords": [ + "typespec" + ], + "type": "module", + "tspMain": "lib/main.tsp", + "main": "dist/src/index.js", + "exports": { + ".": { + "typespec": "./lib/main.tsp", + "types": "./dist/src/index.d.ts", + "default": "./dist/src/index.js" + } + }, + "engines": { + "node": ">=22.0.0" + }, + "dependencies": { + "@alloy-js/core": "catalog:", + "@alloy-js/typescript": "catalog:", + "@pinterest/alloy-graphql": "catalog:", + "change-case": "catalog:", + "graphql": "catalog:" + }, + "scripts": { + "clean": "rimraf ./dist ./temp", + "build": "pnpm gen-extern-signature && alloy build", + "watch": "alloy build --watch", + "gen-extern-signature": "tspd --enable-experimental gen-extern-signature .", + "test": "vitest run", + "test:watch": "vitest -w", + "lint": "oxlint . --deny-warnings", + "lint:fix": "oxlint . --fix", + "regen-docs": "tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/graphql/reference" + }, + "files": [ + "lib/*.tsp", + "tspconfig.yaml", + "dist/**", + "!dist/test/**" + ], + "peerDependencies": { + "@typespec/compiler": "workspace:~", + "@typespec/emitter-framework": "workspace:~", + "@typespec/http": "workspace:~", + "@typespec/mutator-framework": "workspace:~" + }, + "devDependencies": { + "@alloy-js/cli": "catalog:", + "@alloy-js/rollup-plugin": "catalog:", + "@types/node": "catalog:", + "@typespec/compiler": "workspace:~", + "@typespec/emitter-framework": "workspace:~", + "@typespec/http": "workspace:~", + "@typespec/mutator-framework": "workspace:~", + "@typespec/tspd": "workspace:~", + "rimraf": "catalog:", + "source-map-support": "catalog:", + "typescript": "catalog:", + "vitest": "catalog:" + } +} diff --git a/packages/graphql/src/components/fields/field.tsx b/packages/graphql/src/components/fields/field.tsx new file mode 100644 index 00000000000..5b51fe71c02 --- /dev/null +++ b/packages/graphql/src/components/fields/field.tsx @@ -0,0 +1,72 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type ModelProperty, getDeprecationDetails, isArrayModelType } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; +import { isNullable, isNullableElements } from "../../../generated-defs/TypeSpec.GraphQL.js"; +import { resolveGraphQLTypeName } from "../../lib/graphql-type-name.js"; + +export interface FieldProps { + property: ModelProperty; + isInput: boolean; +} + +export function Field(props: FieldProps) { + const { $, program } = useTsp(); + + const doc = $.type.getDoc(props.property); + const deprecation = getDeprecationDetails(program, props.property); + const nullable = isNullable(program, props.property) || props.property.optional; + const type = props.property.type; + + if (type.kind === "Model" && isArrayModelType(type)) { + const elemNullable = isNullableElements(program, props.property); + const typeName = resolveGraphQLTypeName(type.indexer.value, program); + + if (props.isInput) { + return ( + + + + ); + } + + return ( + + + + ); + } + + if (props.isInput) { + return ( + + ); + } + + return ( + + ); +} diff --git a/packages/graphql/src/components/fields/index.ts b/packages/graphql/src/components/fields/index.ts new file mode 100644 index 00000000000..0cec3b46b26 --- /dev/null +++ b/packages/graphql/src/components/fields/index.ts @@ -0,0 +1,2 @@ +export { Field, type FieldProps } from "./field.js"; +export { OperationField, type OperationFieldProps } from "./operation-field.js"; diff --git a/packages/graphql/src/components/fields/operation-field.tsx b/packages/graphql/src/components/fields/operation-field.tsx new file mode 100644 index 00000000000..e26f2833b80 --- /dev/null +++ b/packages/graphql/src/components/fields/operation-field.tsx @@ -0,0 +1,58 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Operation, getDeprecationDetails, isArrayModelType } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; +import { isNullable, isNullableElements } from "../../../generated-defs/TypeSpec.GraphQL.js"; +import { resolveGraphQLTypeName } from "../../lib/graphql-type-name.js"; + +export interface OperationFieldProps { + operation: Operation; +} + +export function OperationField(props: OperationFieldProps) { + const { $, program } = useTsp(); + + const doc = $.type.getDoc(props.operation); + const deprecation = getDeprecationDetails(program, props.operation); + const returnType = props.operation.returnType; + const nullable = isNullable(program, props.operation); + const params = Array.from(props.operation.parameters.properties.values()); + + const isList = returnType.kind === "Model" && isArrayModelType(returnType); + const typeName = isList + ? resolveGraphQLTypeName(returnType.indexer.value, program) + : resolveGraphQLTypeName(returnType, program); + const elemNullable = isList && isNullableElements(program, props.operation); + + return ( + + {isList ? : undefined} + {params.map((param) => { + const paramNullable = isNullable(program, param) || param.optional; + const paramType = param.type; + const paramIsList = paramType.kind === "Model" && isArrayModelType(paramType); + const paramElemNullable = paramIsList && isNullableElements(program, param); + const paramTypeName = paramIsList + ? resolveGraphQLTypeName(paramType.indexer.value, program) + : resolveGraphQLTypeName(paramType, program); + + return ( + + {paramIsList ? : undefined} + + ); + })} + + ); +} diff --git a/packages/graphql/src/components/schema.tsx b/packages/graphql/src/components/schema.tsx new file mode 100644 index 00000000000..e56e3a508ca --- /dev/null +++ b/packages/graphql/src/components/schema.tsx @@ -0,0 +1,81 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Model } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; +import { isInputType } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { useGraphQLSchema } from "../context/index.js"; +import { isInterface } from "../lib/interface.js"; +import { getOperationFields } from "../lib/operation-fields.js"; +import { getOperationKind } from "../lib/operation-kind.js"; +import { getSpecifiedBy } from "../lib/specified-by.js"; +import { OperationField } from "./fields/index.js"; +import { EnumType } from "./types/enum-type.js"; +import { InputType } from "./types/input-type.js"; +import { InterfaceType } from "./types/interface-type.js"; +import { ObjectType } from "./types/object-type.js"; +import { ScalarType } from "./types/scalar-type.js"; +import { UnionType, type GraphQLUnion } from "./types/union-type.js"; + +export function Schema() { + const { typeGraph } = useGraphQLSchema(); + const { program } = useTsp(); + const ns = typeGraph.globalNamespace; + + const operations = [...ns.operations.values()]; + const queries = operations.filter((op) => getOperationKind(program, op) === "Query"); + const mutations = operations.filter((op) => getOperationKind(program, op) === "Mutation"); + const subscriptions = operations.filter((op) => getOperationKind(program, op) === "Subscription"); + + const models = [...ns.models.values()]; + const scalars = [...ns.scalars.values()]; + const enums = [...ns.enums.values()]; + const unions = [...ns.unions.values()]; + + return ( + <> + {scalars.map((s) => ( + + ))} + {enums.map((e) => ( + + ))} + {unions.map((u) => ( + + ))} + {models.map((m) => renderModel(m))} + {queries.length > 0 && ( + + {queries.map((op) => ( + + ))} + + )} + {mutations.length > 0 && ( + + {mutations.map((op) => ( + + ))} + + )} + {subscriptions.length > 0 && ( + + {subscriptions.map((op) => ( + + ))} + + )} + + ); + + function renderModel(model: Model) { + const hasFields = model.properties.size > 0 || getOperationFields(program, model).size > 0; + if (!hasFields) return undefined; + + if (isInterface(program, model)) { + return ; + } + if (isInputType(program, model)) { + return ; + } + return ; + } +} diff --git a/packages/graphql/src/components/types/enum-type.tsx b/packages/graphql/src/components/types/enum-type.tsx new file mode 100644 index 00000000000..f4a107bc5b5 --- /dev/null +++ b/packages/graphql/src/components/types/enum-type.tsx @@ -0,0 +1,25 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Enum, getDeprecationDetails, getDoc } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; + +export interface EnumTypeProps { + type: Enum; +} + +export function EnumType(props: EnumTypeProps) { + const { program } = useTsp(); + const doc = getDoc(program, props.type); + const members = [...props.type.members.values()]; + + return ( + + {members.map((member) => ( + + ))} + + ); +} diff --git a/packages/graphql/src/components/types/index.ts b/packages/graphql/src/components/types/index.ts new file mode 100644 index 00000000000..1ab22bd90b0 --- /dev/null +++ b/packages/graphql/src/components/types/index.ts @@ -0,0 +1,6 @@ +export { EnumType, type EnumTypeProps } from "./enum-type.js"; +export { InputType, type InputTypeProps } from "./input-type.js"; +export { InterfaceType, type InterfaceTypeProps } from "./interface-type.js"; +export { ObjectType, type ObjectTypeProps } from "./object-type.js"; +export { ScalarType, type ScalarTypeProps } from "./scalar-type.js"; +export { UnionType, type GraphQLUnion, type UnionTypeProps } from "./union-type.js"; diff --git a/packages/graphql/src/components/types/input-type.tsx b/packages/graphql/src/components/types/input-type.tsx new file mode 100644 index 00000000000..59697a08e6b --- /dev/null +++ b/packages/graphql/src/components/types/input-type.tsx @@ -0,0 +1,27 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Model, getDoc } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; +import { isOneOf } from "../../../generated-defs/TypeSpec.GraphQL.js"; +import { Field } from "../fields/index.js"; + +export interface InputTypeProps { + type: Model; +} + +export function InputType(props: InputTypeProps) { + const { program } = useTsp(); + const doc = getDoc(program, props.type); + const properties = [...props.type.properties.values()]; + + return ( + + {properties.map((prop) => ( + + ))} + + ); +} diff --git a/packages/graphql/src/components/types/interface-type.tsx b/packages/graphql/src/components/types/interface-type.tsx new file mode 100644 index 00000000000..206bc1551c4 --- /dev/null +++ b/packages/graphql/src/components/types/interface-type.tsx @@ -0,0 +1,25 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Model, getDoc } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; +import { getComposition } from "../../lib/interface.js"; +import { Field } from "../fields/index.js"; + +export interface InterfaceTypeProps { + type: Model; +} + +export function InterfaceType(props: InterfaceTypeProps) { + const { program } = useTsp(); + const doc = getDoc(program, props.type); + const properties = [...props.type.properties.values()]; + const composition = getComposition(program, props.type); + const interfaces = composition?.map((iface) => iface.name); + + return ( + + {properties.map((prop) => ( + + ))} + + ); +} diff --git a/packages/graphql/src/components/types/object-type.tsx b/packages/graphql/src/components/types/object-type.tsx new file mode 100644 index 00000000000..5798ca543de --- /dev/null +++ b/packages/graphql/src/components/types/object-type.tsx @@ -0,0 +1,30 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Model, getDoc } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; +import { getComposition } from "../../lib/interface.js"; +import { getOperationFields } from "../../lib/operation-fields.js"; +import { Field, OperationField } from "../fields/index.js"; + +export interface ObjectTypeProps { + type: Model; +} + +export function ObjectType(props: ObjectTypeProps) { + const { program } = useTsp(); + const doc = getDoc(program, props.type); + const properties = [...props.type.properties.values()]; + const composition = getComposition(program, props.type); + const interfaces = composition?.map((iface) => iface.name); + const opFields = getOperationFields(program, props.type); + + return ( + + {properties.map((prop) => ( + + ))} + {[...opFields].map((op) => ( + + ))} + + ); +} diff --git a/packages/graphql/src/components/types/scalar-type.tsx b/packages/graphql/src/components/types/scalar-type.tsx new file mode 100644 index 00000000000..42e04b0e663 --- /dev/null +++ b/packages/graphql/src/components/types/scalar-type.tsx @@ -0,0 +1,21 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Scalar, getDoc } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; + +export interface ScalarTypeProps { + type: Scalar; + specificationUrl?: string; +} + +export function ScalarType(props: ScalarTypeProps) { + const { program } = useTsp(); + const doc = getDoc(program, props.type); + + return ( + + ); +} diff --git a/packages/graphql/src/components/types/union-type.tsx b/packages/graphql/src/components/types/union-type.tsx new file mode 100644 index 00000000000..424f396d7f5 --- /dev/null +++ b/packages/graphql/src/components/types/union-type.tsx @@ -0,0 +1,24 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { type Model, type Union, getDoc } from "@typespec/compiler"; +import { useTsp } from "@typespec/emitter-framework"; + +/** + * A Union guaranteed to have a name after mutation. + * The mutation engine ensures this: anonymous unions get derived names. + */ +export interface GraphQLUnion extends Union { + name: string; +} + +export interface UnionTypeProps { + type: GraphQLUnion; +} + +export function UnionType(props: UnionTypeProps) { + const { program } = useTsp(); + const doc = getDoc(program, props.type); + const variants = [...props.type.variants.values()]; + const members = variants.map((v) => (v.type as Model).name); + + return ; +} diff --git a/packages/graphql/src/context/graphql-schema-context.tsx b/packages/graphql/src/context/graphql-schema-context.tsx new file mode 100644 index 00000000000..be12d498331 --- /dev/null +++ b/packages/graphql/src/context/graphql-schema-context.tsx @@ -0,0 +1,19 @@ +import { type ComponentContext, createNamedContext, useContext } from "@alloy-js/core"; +import type { TypeGraph } from "../mutation-engine/type-graph.js"; + +export interface GraphQLSchemaContextValue { + typeGraph: TypeGraph; +} + +export const GraphQLSchemaContext: ComponentContext = + createNamedContext("GraphQLSchema"); + +export function useGraphQLSchema(): GraphQLSchemaContextValue { + const context = useContext(GraphQLSchemaContext); + + if (!context) { + throw new Error("useGraphQLSchema must be used within GraphQLSchemaContext.Provider."); + } + + return context; +} diff --git a/packages/graphql/src/context/index.ts b/packages/graphql/src/context/index.ts new file mode 100644 index 00000000000..cf8c0efcbbb --- /dev/null +++ b/packages/graphql/src/context/index.ts @@ -0,0 +1,5 @@ +export { + GraphQLSchemaContext, + useGraphQLSchema, + type GraphQLSchemaContextValue, +} from "./graphql-schema-context.js"; diff --git a/packages/graphql/src/emitter.tsx b/packages/graphql/src/emitter.tsx new file mode 100644 index 00000000000..8f90e45166a --- /dev/null +++ b/packages/graphql/src/emitter.tsx @@ -0,0 +1,81 @@ +import { renderSchema as alloyRenderSchema } from "@pinterest/alloy-graphql"; +import { + emitFile, + interpolatePath, + resolvePath, + type EmitContext, + type Namespace, + type Program, +} from "@typespec/compiler"; +import { TspContext } from "@typespec/emitter-framework"; +import { printSchema } from "graphql"; +import { Schema } from "./components/schema.js"; +import { GraphQLSchemaContext } from "./context/index.js"; +import { type GraphQLEmitterOptions } from "./lib.js"; +import { getOperationKind } from "./lib/operation-kind.js"; +import { listSchemas } from "./lib/schema.js"; +import { createGraphQLMutationEngine } from "./mutation-engine/index.js"; +import { mutateSchema } from "./mutation-engine/schema-mutator.js"; +import type { TypeGraph } from "./mutation-engine/type-graph.js"; +import { resolveTypeUsage } from "./type-usage.js"; + +export async function $onEmit(context: EmitContext) { + const schemas = listSchemas(context.program); + if (schemas.length === 0) { + schemas.push({ type: context.program.getGlobalNamespaceType() }); + } + + for (const schema of schemas) { + const typeGraph = buildSchema(context, schema.type); + if (typeGraph) { + const sdl = renderSchema(context.program, typeGraph); + if (!context.program.compilerOptions.dryRun) { + const outputFile = context.options["output-file"] ?? "{schema-name}.graphql"; + const fileName = interpolatePath(outputFile, { + "schema-name": schema.name ?? "schema", + }); + await emitFile(context.program, { + path: resolvePath(context.emitterOutputDir, fileName), + content: sdl, + newLine: context.options["new-line"] ?? "lf", + }); + } + } + } +} + +function buildSchema( + context: EmitContext, + schema: Namespace, +): TypeGraph | undefined { + const program = context.program; + const omitUnreachable = context.options["omit-unreachable-types"] ?? false; + + const typeUsage = resolveTypeUsage(program, schema, omitUnreachable); + const engine = createGraphQLMutationEngine(program); + const typeGraph = mutateSchema(program, engine, schema, typeUsage); + + // Check for GraphQL operations - skip generation if none exist + // (the diagnostic is reported by $onValidate for early IDE feedback) + const hasGraphQLOps = [...typeGraph.globalNamespace.operations.values()].some( + (op) => getOperationKind(program, op) !== undefined, + ); + if (!hasGraphQLOps) { + return undefined; + } + + return typeGraph; +} + +function renderSchema(program: Program, typeGraph: TypeGraph): string { + const graphqlSchema = alloyRenderSchema( + + + + + , + { namePolicy: null }, + ); + + return printSchema(graphqlSchema as any); +} diff --git a/packages/graphql/src/index.ts b/packages/graphql/src/index.ts new file mode 100644 index 00000000000..1686ff2d444 --- /dev/null +++ b/packages/graphql/src/index.ts @@ -0,0 +1,5 @@ +export { $onEmit } from "./emitter.js"; +export { $lib } from "./lib.js"; +export { $decorators } from "./tsp-index.js"; + +export { createGraphQLMutationEngine } from "./mutation-engine/index.js"; diff --git a/packages/graphql/src/lib.ts b/packages/graphql/src/lib.ts new file mode 100644 index 00000000000..71d95f1df68 --- /dev/null +++ b/packages/graphql/src/lib.ts @@ -0,0 +1,206 @@ +import { createTypeSpecLibrary, paramMessage, type JSONSchemaType } from "@typespec/compiler"; + +export interface GraphQLEmitterOptions { + /** + * Name of the output file. + * Output file will interpolate the following values: + * - schema-name: Name of the schema if multiple + * + * @default `{schema-name}.graphql` + * + * @example Single schema + * - `schema.graphql` + * + * @example Multiple schemas + * - `Org1.Schema1.graphql` + * - `Org1.Schema2.graphql` + */ + "output-file"?: string; + + /** + * Set the newline character for emitting files. + * @default lf + */ + "new-line"?: "crlf" | "lf"; + + /** + * Omit unreachable types. + * By default all types declared under the schema namespace will be included. With this flag on only types references in an operation will be emitted. + * @default false + */ + "omit-unreachable-types"?: boolean; +} + +const EmitterOptionsSchema: JSONSchemaType = { + type: "object", + additionalProperties: false, + properties: { + "output-file": { + type: "string", + nullable: true, + description: [ + "Name of the output file.", + " Output file will interpolate the following values:", + " - schema-name: Name of the schema if multiple", + "", + " Default: `{schema-name}.graphql`", + "", + " Example Single schema", + " - `schema.graphql`", + "", + " Example Multiple schemas", + " - `Org1.Schema1.graphql`", + " - `Org1.Schema2.graphql`", + ].join("\n"), + }, + "new-line": { + type: "string", + enum: ["crlf", "lf"], + default: "lf", + nullable: true, + description: "Set the newLine character for emitting files.", + }, + "omit-unreachable-types": { + type: "boolean", + nullable: true, + description: [ + "Omit unreachable types.", + "By default all types declared under the schema namespace will be included.", + "With this flag on only types references in an operation will be emitted.", + ].join("\n"), + }, + }, + required: [], +}; + +export const libDef = { + name: "@typespec/graphql", + diagnostics: { + "graphql-operation-kind-duplicate": { + severity: "error", + messages: { + default: paramMessage`GraphQL Operation Kind already applied to \`${"entityName"}\`.`, + }, + }, + "operation-field-conflict": { + severity: "error", + messages: { + default: paramMessage`Operation \`${"operation"}\` conflicts with an existing ${"conflictType"} on model \`${"model"}\`.`, + }, + }, + "operation-field-duplicate": { + severity: "warning", + messages: { + default: paramMessage`Operation \`${"operation"}\` is defined multiple times on \`${"model"}\`.`, + }, + }, + "invalid-interface": { + severity: "error", + messages: { + default: paramMessage`All models used with \`@compose\` must be marked with \`@graphqlInterface\`, but ${"interface"} is not.`, + }, + }, + "circular-interface": { + severity: "error", + messages: { + default: "An interface cannot implement itself.", + }, + }, + "missing-interface-property": { + severity: "error", + messages: { + default: paramMessage`Model must contain property \`${"property"}\` from \`${"interface"}\` in order to implement it in GraphQL.`, + }, + }, + "incompatible-interface-property": { + severity: "error", + messages: { + default: paramMessage`Property \`${"property"}\` is incompatible with \`${"interface"}\`.`, + }, + }, + "unrecognized-union": { + severity: "error", + messages: { + default: + "Unrecognized union construction. Union must be named, a return type, a model property, or an alias.", + }, + }, + "duplicate-union-variant": { + severity: "warning", + messages: { + default: paramMessage`Union variant type "${"type"}" appears multiple times after flattening nested unions. Duplicate removed.`, + }, + }, + "empty-union": { + severity: "error", + messages: { + default: + "Union has no non-null variants. A GraphQL union must contain at least one member type.", + }, + }, + "graphql-builtin-scalar-collision": { + severity: "warning", + messages: { + default: paramMessage`Scalar "${"name"}" collides with GraphQL built-in type "${"builtinName"}". This may cause unexpected behavior. Consider renaming the scalar.`, + }, + }, + "type-name-collision": { + severity: "error", + messages: { + default: paramMessage`Type "${"name"}" collides with another type of the same name in the GraphQL schema. Consider renaming one of the types.`, + }, + }, + "operation-fields-ignored-on-input": { + severity: "warning", + messages: { + default: paramMessage`@operationFields on \`${"model"}\` is ignored in input context — GraphQL input types cannot have operation fields.`, + }, + }, + "empty-schema": { + severity: "warning", + messages: { + default: "GraphQL schema has no operations. At minimum a Query root type is required.", + }, + }, + "empty-enum": { + severity: "error", + messages: { + default: paramMessage`Enum "${"name"}" must define at least one value. GraphQL enums cannot be empty.`, + }, + }, + "reserved-name": { + severity: "error", + messages: { + default: paramMessage`Name "${"name"}" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.`, + }, + }, + "unsupported-type": { + severity: "warning", + messages: { + default: paramMessage`Type "${"type"}" has no GraphQL equivalent. Using String as fallback.`, + }, + }, + }, + emitter: { + options: EmitterOptionsSchema as JSONSchemaType, + capabilities: { + dryRun: true, + }, + }, + state: { + operationKind: { + description: + "State for the graphql operation kind decorators (@query, @mutation, @subscription)", + }, + operationFields: { description: "State for the @operationFields decorator." }, + compose: { description: "State for the @compose decorator." }, + interface: { description: "State for the @interface decorator." }, + interfaceOnly: { description: "State for @interface(#{interfaceOnly: true})." }, + schema: { description: "State for the @schema decorator." }, + specifiedBy: { description: "State for the @specifiedBy decorator." }, + }, +} as const; + +export const $lib = createTypeSpecLibrary(libDef); + +export const { reportDiagnostic, createDiagnostic, stateKeys: GraphQLKeys } = $lib; diff --git a/packages/graphql/src/lib/graphql-type-name.ts b/packages/graphql/src/lib/graphql-type-name.ts new file mode 100644 index 00000000000..87b5879a8d9 --- /dev/null +++ b/packages/graphql/src/lib/graphql-type-name.ts @@ -0,0 +1,28 @@ +import type { Program, Type } from "@typespec/compiler"; +import { reportDiagnostic } from "../lib.js"; +import { resolveScalarToGraphQL } from "./scalar-mappings.js"; + +export function resolveGraphQLTypeName(type: Type, program?: Program): string { + switch (type.kind) { + case "Scalar": + // resolveScalarToGraphQL maps std scalars to GraphQL types, + // and returns user-defined scalar names as-is + return resolveScalarToGraphQL(type.name); + case "Model": + return type.name; + case "Enum": + return type.name; + case "Union": + return type.name ?? "Union"; + default: + // Unsupported type (literals, etc.) - warn and fall back to String + if (program) { + reportDiagnostic(program, { + code: "unsupported-type", + format: { type: type.kind }, + target: type, + }); + } + return "String"; + } +} diff --git a/packages/graphql/src/lib/interface.ts b/packages/graphql/src/lib/interface.ts new file mode 100644 index 00000000000..47145041f42 --- /dev/null +++ b/packages/graphql/src/lib/interface.ts @@ -0,0 +1,150 @@ +import { + type DecoratorContext, + type Model, + type ModelProperty, + type Program, + validateDecoratorUniqueOnNode, + walkPropertiesInherited, +} from "@typespec/compiler"; + +import { useStateMap, useStateSet } from "@typespec/compiler/utils"; +import type { + ComposeDecorator, + GraphqlInterfaceDecorator, +} from "../../generated-defs/TypeSpec.GraphQL.js"; +import { GraphQLKeys, reportDiagnostic } from "../lib.js"; +import { propertiesEqual } from "./utils.js"; + +declare const tags: unique symbol; +type Tagged = BaseType & { [tags]: { [K in Tag]: void } }; + +/** An Interface is a model that has been marked as an Interface */ +type Interface = Tagged; + +const [getInterface, setInterface] = useStateSet(GraphQLKeys.interface); +const [getInterfaceOnly, setInterfaceOnly] = useStateSet(GraphQLKeys.interfaceOnly); +const [getComposition, setComposition, _getCompositionMap] = useStateMap( + GraphQLKeys.compose, +); + +export { + /** + * Get the implemented interfaces for a given model + * @param program Program + * @param model Model + * @returns Composed interfaces or undefined if no interfaces are composed. + */ + getComposition, + setComposition, +}; + +/** + * Check if the model is defined as a schema. + * @param program Program + * @param model Model + * @returns Boolean + */ +export function isInterface(program: Program, model: Model | Interface): model is Interface { + return !!getInterface(program, model as Interface); +} + +export function isInterfaceOnly(program: Program, model: Model): boolean { + return !!getInterfaceOnly(program, model as Interface); +} + +function validateImplementedsAreInterfaces(context: DecoratorContext, interfaces: Model[]) { + let valid = true; + + for (const iface of interfaces) { + if (!isInterface(context.program, iface)) { + valid = false; + reportDiagnostic(context.program, { + code: "invalid-interface", + format: { interface: iface.name }, + target: context.decoratorTarget, + }); + } + } + + return valid; +} + +function validateNoCircularImplementation( + context: DecoratorContext, + target: Model, + interfaces: Interface[], +) { + const valid = !isInterface(context.program, target) || !interfaces.includes(target); + if (!valid) { + reportDiagnostic(context.program, { + code: "circular-interface", + target: context.decoratorTarget, + }); + } + return valid; +} + +function validateImplementsInterfaceProperties( + context: DecoratorContext, + modelProperties: Map, + iface: Interface, +) { + let valid = true; + + for (const prop of walkPropertiesInherited(iface)) { + if (!modelProperties.has(prop.name)) { + valid = false; + reportDiagnostic(context.program, { + code: "missing-interface-property", + format: { interface: iface.name, property: prop.name }, + target: context.decoratorTarget, + }); + } else if (!propertiesEqual(modelProperties.get(prop.name)!, prop)) { + valid = false; + reportDiagnostic(context.program, { + code: "incompatible-interface-property", + format: { interface: iface.name, property: prop.name }, + target: context.decoratorTarget, + }); + } + } + + return valid; +} + +function validateImplementsInterfacesProperties( + context: DecoratorContext, + target: Model, + interfaces: Interface[], +) { + let valid = true; + const allModelProperties = new Map( + [...walkPropertiesInherited(target)].map((prop) => [prop.name, prop]), + ); + for (const iface of interfaces) { + if (!validateImplementsInterfaceProperties(context, allModelProperties, iface)) { + valid = false; + } + } + return valid; +} + +export const $graphqlInterface: GraphqlInterfaceDecorator = (context, target, options) => { + validateDecoratorUniqueOnNode(context, target, $graphqlInterface); + setInterface(context.program, target as Interface); + if (options?.interfaceOnly) { + setInterfaceOnly(context.program, target as Interface); + } +}; + +export const $compose: ComposeDecorator = (context, target, ...interfaces) => { + validateImplementedsAreInterfaces(context, interfaces as Interface[]); + validateNoCircularImplementation(context, target, interfaces as Interface[]); + validateImplementsInterfacesProperties(context, target, interfaces as Interface[]); + const existingCompose = getComposition(context.program, target); + let composed = interfaces as Interface[]; + if (existingCompose) { + composed = [...existingCompose, ...composed]; + } + setComposition(context.program, target, composed); +}; diff --git a/packages/graphql/src/lib/naming.ts b/packages/graphql/src/lib/naming.ts new file mode 100644 index 00000000000..9f67502e223 --- /dev/null +++ b/packages/graphql/src/lib/naming.ts @@ -0,0 +1,101 @@ +import { camelCase, constantCase, pascalCase, split, splitSeparateNumbers } from "change-case"; + +export interface NamingContext { + isInput: boolean; + isInterface: boolean; + inputQualifier?: string; +} + +type NameTransform = (name: string, context: NamingContext) => string; + +function stripNamespace(name: string, _context: NamingContext): string { + const parts = name.trim().split("."); + return parts[parts.length - 1]; +} + +function sanitizeForGraphQL(name: string, _context: NamingContext): string { + name = name.replaceAll("[]", "Array"); + name = name.replaceAll(/\W/g, "_"); + if (!/^[_a-zA-Z]/.test(name)) { + name = `_${name}`; + } + return name; +} + +function splitWithAcronyms(skipStart: boolean, name: string): string[] { + const parts = split(name); + if (name === name.toUpperCase()) { + return parts; + } + return parts.flatMap((part, index) => { + if (skipStart && index === 0) return part; + if (part.match(/^[A-Z]+$/)) return part.split(""); + return part; + }); +} + +function toPascalCase(name: string, _context: NamingContext): string { + if (/^[A-Z]+$/.test(name)) { + return name; + } + return pascalCase(name, { + prefixCharacters: "_", + split: splitWithAcronyms.bind(null, false), + }); +} + +function toCamelCase(name: string, _context: NamingContext): string { + return camelCase(name, { + prefixCharacters: "_", + split: splitWithAcronyms.bind(null, true), + }); +} + +function toConstantCase(name: string, _context: NamingContext): string { + return constantCase(name, { + split: splitSeparateNumbers, + prefixCharacters: "_", + }); +} + +function applyInterfaceSuffix(name: string, context: NamingContext): string { + if (!context.isInterface) return name; + return name.endsWith("Interface") ? name : name + "Interface"; +} + +function applyInputSuffix(name: string, context: NamingContext): string { + if (!context.isInput) return name; + const qualifier = context.inputQualifier ?? ""; + const suffix = `${qualifier}Input`; + return name.endsWith(suffix) ? name : name + suffix; +} + +const baseNamePipeline: NameTransform[] = [stripNamespace, sanitizeForGraphQL, toPascalCase]; + +const typeNamePipeline: NameTransform[] = [ + ...baseNamePipeline, + applyInterfaceSuffix, + applyInputSuffix, +]; + +const fieldNamePipeline: NameTransform[] = [sanitizeForGraphQL, toCamelCase]; + +const enumMemberPipeline: NameTransform[] = [sanitizeForGraphQL, toConstantCase]; + +const noContext: NamingContext = { isInput: false, isInterface: false }; + +export function applyBaseNamePipeline(name: string): string { + return baseNamePipeline.reduce((n, transform) => transform(n, noContext), name); +} + +export function applyTypeNamePipeline(name: string, context: NamingContext): string { + return typeNamePipeline.reduce((n, transform) => transform(n, context), name); +} + +export function applyFieldNamePipeline(name: string): string { + return fieldNamePipeline.reduce((n, transform) => transform(n, noContext), name); +} + +export function applyEnumMemberPipeline(name: string): string { + return enumMemberPipeline.reduce((n, transform) => transform(n, noContext), name); +} diff --git a/packages/graphql/src/lib/operation-fields.ts b/packages/graphql/src/lib/operation-fields.ts new file mode 100644 index 00000000000..6d02d6a53b0 --- /dev/null +++ b/packages/graphql/src/lib/operation-fields.ts @@ -0,0 +1,108 @@ +import { + walkPropertiesInherited, + type DecoratorContext, + type Interface, + type Model, + type Operation, + type Program, +} from "@typespec/compiler"; +import { useStateMap } from "@typespec/compiler/utils"; +import type { OperationFieldsDecorator } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { GraphQLKeys, reportDiagnostic } from "../lib.js"; +import { operationsEqual } from "./utils.js"; + +const [getOperationFieldsInternal, setOperationFields, _getOperationFieldsMap] = useStateMap< + Model, + Set +>(GraphQLKeys.operationFields); + +/** + * Get the operation fields for a given model + * @param program Program + * @param model Model + * @returns Set of operations defined for the model + */ +export function getOperationFields(program: Program, model: Model): Set { + return getOperationFieldsInternal(program, model) || new Set(); +} + +function validateDuplicateProperties( + context: DecoratorContext, + model: Model, + operation: Operation, +) { + const operationFields = getOperationFields(context.program, model); + if (operationFields.has(operation)) { + reportDiagnostic(context.program, { + code: "operation-field-duplicate", + format: { operation: operation.name, model: model.name }, + target: context.getArgumentTarget(0)!, + }); + return false; + } + return true; +} + +function validateNoConflictWithProperties( + context: DecoratorContext, + model: Model, + operation: Operation, +) { + const conflictTypes = []; + if ([...walkPropertiesInherited(model)].some((prop) => prop.name === operation.name)) { + conflictTypes.push("property"); // an operation and a property is always a conflict + } + const existingOperation = [...getOperationFields(context.program, model)].find( + (op) => op.name === operation.name, + ); + + if (existingOperation && !operationsEqual(existingOperation, operation)) { + conflictTypes.push("operation"); + } + for (const conflictType of conflictTypes) { + reportDiagnostic(context.program, { + code: "operation-field-conflict", + format: { operation: operation.name, model: model.name, conflictType }, + target: context.getArgumentTarget(0)!, + }); + } + return conflictTypes.length === 0; +} + +/** + * Add this operation to the model's operation fields. + * @param context DecoratorContext + * @param model Model + * @param operation Operation + */ +export function addOperationField( + context: DecoratorContext, + model: Model, + operation: Operation, +): void { + const operationFields = getOperationFields(context.program, model); + if (!validateDuplicateProperties(context, model, operation)) { + return; + } + if (!validateNoConflictWithProperties(context, model, operation)) { + return; + } + operationFields.add(operation); + setOperationFields(context.program, model, operationFields); +} + +export const $operationFields: OperationFieldsDecorator = ( + context, + target, + ...operationOrInterfaces +): void => { + for (const operationOrInterface of operationOrInterfaces as (Operation | Interface)[]) { + if (operationOrInterface.kind === "Operation") { + addOperationField(context, target, operationOrInterface); + } else { + for (const [_, operation] of operationOrInterface.operations) { + addOperationField(context, target, operation); + } + } + } +}; diff --git a/packages/graphql/src/lib/operation-kind.ts b/packages/graphql/src/lib/operation-kind.ts new file mode 100644 index 00000000000..00b93a46492 --- /dev/null +++ b/packages/graphql/src/lib/operation-kind.ts @@ -0,0 +1,67 @@ +import { type DecoratorContext, type Operation } from "@typespec/compiler"; +import { SyntaxKind } from "@typespec/compiler/ast"; +import { useStateMap } from "@typespec/compiler/utils"; +import type { + MutationDecorator, + QueryDecorator, + SubscriptionDecorator, +} from "../../generated-defs/TypeSpec.GraphQL.js"; +import { GraphQLKeys, reportDiagnostic } from "../lib.js"; + +export type GraphQLOperationKind = "Mutation" | "Query" | "Subscription"; + +const [getOperationKind, setOperationKindInternal, _getOperationKindMap] = useStateMap< + Operation, + GraphQLOperationKind +>(GraphQLKeys.operationKind); + +function validateOperationKindUniqueOnNode(context: DecoratorContext, operation: Operation) { + const operationKindDecorators = operation.decorators.filter( + (x) => + OPERATION_KIND_DECORATORS.includes(x.decorator) && + x.node?.kind === SyntaxKind.DecoratorExpression && + x.node?.parent === operation.node, + ); + + if (operationKindDecorators.length > 1) { + reportDiagnostic(context.program, { + code: "graphql-operation-kind-duplicate", + format: { entityName: operation.name }, + target: context.decoratorTarget, + }); + return false; + } + return true; +} + +function setOperationKind( + context: DecoratorContext, + entity: Operation, + operationKind: GraphQLOperationKind, +): void { + if (validateOperationKindUniqueOnNode(context, entity)) { + setOperationKindInternal(context.program, entity, operationKind); + } +} + +function createOperationKindDecorator(operationKind: GraphQLOperationKind) { + return (context: DecoratorContext, entity: Operation) => { + setOperationKind(context, entity, operationKind); + }; +} + +export const $mutation: MutationDecorator = createOperationKindDecorator("Mutation"); +export const $query: QueryDecorator = createOperationKindDecorator("Query"); +export const $subscription: SubscriptionDecorator = createOperationKindDecorator("Subscription"); + +export const OPERATION_KIND_DECORATORS = [$mutation, $query, $subscription]; + +export { + /** + * Get the operation kind for the given operation. + * @param program Program + * @param operation Operation + * @returns Operation kind or undefined if operation is not decorated with an operation kind. + */ + getOperationKind, +}; diff --git a/packages/graphql/src/lib/scalar-mappings.ts b/packages/graphql/src/lib/scalar-mappings.ts new file mode 100644 index 00000000000..ce01584b54e --- /dev/null +++ b/packages/graphql/src/lib/scalar-mappings.ts @@ -0,0 +1,236 @@ +import { type IntrinsicScalarName, type Program, type Scalar } from "@typespec/compiler"; +import { $, type Typekit } from "@typespec/compiler/typekit"; + +type GraphQLBuiltinScalar = "String" | "Int" | "Float" | "Boolean" | "ID"; + +/** + * Represents a mapping from a TypeSpec scalar to GraphQL. + */ +export interface ScalarMapping { + /** The GraphQL type to use for field references (String, Int, Float, Boolean, ID) */ + graphqlType: GraphQLBuiltinScalar; + /** Optional custom scalar name for explicit scalar definitions */ + customScalarName?: string; + /** Optional URL to specification for @specifiedBy directive */ + specificationUrl?: string; +} + +/** + * Mapping table for all TypeSpec standard library scalars to GraphQL. + * + * Each scalar has: + * - A `default` entry with `graphqlType` for field type resolution + * - Optional encoding-specific entries for custom scalar emission + * + * Every IntrinsicScalarName must have an entry here - the type system enforces this. + */ +const SCALAR_MAPPINGS: Record> = { + // GraphQL built-in scalars (direct mapping, no custom scalar needed) + string: { + default: { graphqlType: "String" }, + }, + boolean: { + default: { graphqlType: "Boolean" }, + }, + int32: { + default: { graphqlType: "Int" }, + }, + float32: { + default: { graphqlType: "Float" }, + }, + float64: { + default: { graphqlType: "Float" }, + }, + + // Integer types that fit in GraphQL Int + int8: { + default: { graphqlType: "Int" }, + }, + int16: { + default: { graphqlType: "Int" }, + }, + uint8: { + default: { graphqlType: "Int" }, + }, + uint16: { + default: { graphqlType: "Int" }, + }, + + // Integer types that exceed GraphQL Int range + int64: { + default: { + graphqlType: "String", + customScalarName: "Long", + specificationUrl: "http://scalars.graphql.org/jakobmerrild/long.html", + }, + }, + uint32: { + default: { graphqlType: "String" }, + }, + uint64: { + default: { graphqlType: "String" }, + }, + safeint: { + default: { graphqlType: "String" }, + }, + integer: { + default: { graphqlType: "String" }, + }, + + // Numeric/decimal types + numeric: { + default: { + graphqlType: "String", + customScalarName: "Numeric", + }, + }, + float: { + default: { graphqlType: "Float" }, + }, + decimal: { + default: { + graphqlType: "String", + customScalarName: "BigDecimal", + specificationUrl: "https://scalars.graphql.org/chillicream/decimal.html", + }, + }, + decimal128: { + default: { + graphqlType: "String", + customScalarName: "BigDecimal", + specificationUrl: "https://scalars.graphql.org/chillicream/decimal.html", + }, + }, + + // Date/time types + plainDate: { + default: { + graphqlType: "String", + customScalarName: "PlainDate", + specificationUrl: "https://scalars.graphql.org/andimarek/local-date.html", + }, + }, + plainTime: { + default: { + graphqlType: "String", + customScalarName: "PlainTime", + specificationUrl: "https://scalars.graphql.org/apollographql/localtime-v0.1.html", + }, + }, + utcDateTime: { + default: { graphqlType: "String" }, + rfc3339: { + graphqlType: "String", + customScalarName: "UTCDateTime", + specificationUrl: "https://scalars.graphql.org/chillicream/date-time.html", + }, + rfc7231: { + graphqlType: "String", + customScalarName: "UTCDateTimeHuman", + specificationUrl: "https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1", + }, + unixTimestamp: { + graphqlType: "Int", + customScalarName: "UTCDateTimeUnix", + }, + }, + offsetDateTime: { + default: { graphqlType: "String" }, + rfc3339: { + graphqlType: "String", + customScalarName: "OffsetDateTime", + specificationUrl: "https://scalars.graphql.org/chillicream/date-time.html", + }, + rfc7231: { + graphqlType: "String", + customScalarName: "OffsetDateTimeHuman", + specificationUrl: "https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1", + }, + unixTimestamp: { + graphqlType: "Int", + customScalarName: "OffsetDateTimeUnix", + }, + }, + duration: { + default: { graphqlType: "String" }, + ISO8601: { + graphqlType: "String", + customScalarName: "Duration", + specificationUrl: "https://www.iso.org/standard/70907.html", + }, + seconds: { + graphqlType: "Int", + customScalarName: "DurationSeconds", + }, + }, + + // Other types + bytes: { + default: { graphqlType: "String" }, + base64: { + graphqlType: "String", + customScalarName: "Bytes", + specificationUrl: "https://datatracker.ietf.org/doc/html/rfc4648#section-4", + }, + base64url: { + graphqlType: "String", + customScalarName: "BytesUrl", + specificationUrl: "https://datatracker.ietf.org/doc/html/rfc4648#section-5", + }, + }, + url: { + default: { + graphqlType: "String", + customScalarName: "URL", + specificationUrl: "https://url.spec.whatwg.org/", + }, + }, + + // GraphQL library scalar (TypeSpec.GraphQL.ID) + ID: { + default: { graphqlType: "ID" }, + }, +}; + +/** + * Check whether a scalar IS a standard library scalar (not just extends one). + */ +export function isStdScalar(tk: Typekit, scalar: Scalar): boolean { + return tk.scalar.getStdBase(scalar) === scalar; +} + +/** + * Resolve a TypeSpec scalar name to its GraphQL type. + * Returns the mapped GraphQL built-in type, or the original name for user-defined scalars. + */ +export function resolveScalarToGraphQL(scalarName: string): string { + const mapping = (SCALAR_MAPPINGS as Record>)[scalarName]; + return mapping?.default?.graphqlType ?? scalarName; +} + +/** + * Get the full scalar mapping for a scalar, including encoding-specific mappings. + * Used for @specifiedBy inheritance when users define custom scalars. + */ +export function getScalarMapping( + program: Program, + scalar: Scalar, + encoding?: string, +): ScalarMapping | undefined { + const tk = $(program); + const stdBase = tk.scalar.getStdBase(scalar); + if (!stdBase) return undefined; + + const mappingTable = (SCALAR_MAPPINGS as Record>)[ + stdBase.name + ]; + if (!mappingTable) return undefined; + + // Check encoding-specific mapping first + const actualEncoding = encoding ?? tk.scalar.getEncoding(scalar)?.encoding; + if (actualEncoding && mappingTable[actualEncoding]) { + return mappingTable[actualEncoding]; + } + + return mappingTable.default; +} diff --git a/packages/graphql/src/lib/schema.ts b/packages/graphql/src/lib/schema.ts new file mode 100644 index 00000000000..56389e5749e --- /dev/null +++ b/packages/graphql/src/lib/schema.ts @@ -0,0 +1,65 @@ +import { type Namespace, type Program, validateDecoratorUniqueOnNode } from "@typespec/compiler"; + +import { useStateMap } from "@typespec/compiler/utils"; +import type { SchemaDecorator } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { GraphQLKeys } from "../lib.js"; + +export interface SchemaDetails { + name?: string; +} + +export interface Schema extends SchemaDetails { + type: Namespace; +} + +const [getSchema, setSchema, getSchemaMap] = useStateMap(GraphQLKeys.schema); + +/** + * List all the schemas defined in the TypeSpec program + * @param program Program + * @returns List of schemas. + */ +export function listSchemas(program: Program): Schema[] { + return [...getSchemaMap(program).values()]; +} + +export { + /** + * Get the schema information for the given namespace. + * @param program Program + * @param namespace Schema namespace + * @returns Schema information or undefined if namespace is not a schema namespace. + */ + getSchema, +}; + +/** + * Check if the namespace is defined as a schema. + * @param program Program + * @param namespace Namespace + * @returns Boolean + */ +export function isSchema(program: Program, namespace: Namespace): boolean { + return getSchemaMap(program).has(namespace); +} + +/** + * Mark the given namespace as a schema. + * @param program Program + * @param namespace Namespace + * @param details Schema details + */ +export function addSchema( + program: Program, + namespace: Namespace, + details: SchemaDetails = {}, +): void { + const schemaMap = getSchemaMap(program); + const existing = schemaMap.get(namespace) ?? {}; + setSchema(program, namespace, { ...existing, ...details, type: namespace }); +} + +export const $schema: SchemaDecorator = (context, target, options) => { + validateDecoratorUniqueOnNode(context, target, $schema); + addSchema(context.program, target, options); +}; diff --git a/packages/graphql/src/lib/specified-by.ts b/packages/graphql/src/lib/specified-by.ts new file mode 100644 index 00000000000..e87d14c2f7c --- /dev/null +++ b/packages/graphql/src/lib/specified-by.ts @@ -0,0 +1,20 @@ +import { type Program, type Scalar, validateDecoratorUniqueOnNode } from "@typespec/compiler"; +import { useStateMap } from "@typespec/compiler/utils"; +import type { SpecifiedByDecorator } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { GraphQLKeys } from "../lib.js"; + +const [getSpecifiedByUrl, setSpecifiedByUrl] = useStateMap(GraphQLKeys.specifiedBy); + +export { getSpecifiedByUrl, setSpecifiedByUrl }; + +/** + * Get the @specifiedBy URL for a scalar, if one has been set. + */ +export function getSpecifiedBy(program: Program, scalar: Scalar): string | undefined { + return getSpecifiedByUrl(program, scalar); +} + +export const $specifiedBy: SpecifiedByDecorator = (context, target, url) => { + validateDecoratorUniqueOnNode(context, target, $specifiedBy); + setSpecifiedByUrl(context.program, target, url); +}; diff --git a/packages/graphql/src/lib/template-composition.ts b/packages/graphql/src/lib/template-composition.ts new file mode 100644 index 00000000000..a8a77ee2f31 --- /dev/null +++ b/packages/graphql/src/lib/template-composition.ts @@ -0,0 +1,55 @@ +import { + getTypeName, + isArrayModelType, + isTemplateInstance, + type IndeterminateEntity, + type TemplatedType, + type Type, + type Value, +} from "@typespec/compiler"; +import { applyBaseNamePipeline } from "./naming.js"; + +function isNamedType(type: Type | Value | IndeterminateEntity): type is { name: string } & Type { + return "name" in type && typeof type.name === "string"; +} + +function resolveArgName(arg: Type): string { + if (arg.kind === "Model" && isArrayModelType(arg)) { + const rawName = getTypeName(arg); + return applyBaseNamePipeline(rawName); + } + if (isTemplateInstance(arg)) { + return composeTemplateName(arg); + } + const rawName = getTypeName(arg); + return applyBaseNamePipeline(rawName); +} + +/** + * Compose a name for a template instance by joining base name + "Of" + resolved arg names. + * Each arg is resolved recursively (nested templates produce nested "Of" names). + * Non-template types return their raw name unchanged. + * + * Examples: + * PaginatedModel → "PaginatedModelOfAdAccount" + * Map → "MapOfStringAndInt" + * Wrapper> → "WrapperOfPaginatedModelOfBoard" + */ +export function composeTemplateName(type: TemplatedType): string { + const name = type.name ?? ""; + + if (!isTemplateInstance(type)) { + return name; + } + + const args = type.templateMapper.args.filter(isNamedType); + + if (args.length === 0) { + return name; + } + + const resolvedArgs = args.map((arg) => resolveArgName(arg as Type)); + const argString = resolvedArgs.join("And"); + + return `${name}Of${argString}`; +} diff --git a/packages/graphql/src/lib/type-utils.ts b/packages/graphql/src/lib/type-utils.ts new file mode 100644 index 00000000000..b337c54438c --- /dev/null +++ b/packages/graphql/src/lib/type-utils.ts @@ -0,0 +1,338 @@ +import { + type ArrayModelType, + type Enum, + getDoc, + getTypeName, + type IndeterminateEntity, + isNeverType, + isNullType, + isTemplateInstance, + type Model, + type Program, + type RecordModelType, + type Scalar, + type Type, + type Union, + type UnionVariant, + type Value, + walkPropertiesInherited, +} from "@typespec/compiler"; +import { + type AliasStatementNode, + type IdentifierNode, + type ModelPropertyNode, + type ModelStatementNode, + type Node, + SyntaxKind, +} from "@typespec/compiler/ast"; +import { camelCase, constantCase, pascalCase, split, splitSeparateNumbers } from "change-case"; +import { reportDiagnostic } from "../lib.js"; + +/** + * Extract the inner type from a nullable wrapper union (e.g., `string | null` → `string`). + * Matches only the `T | null` pattern (exactly 2 variants, one of which is null). + * + * These unions are not "real" unions in GraphQL terms — they're just TypeSpec's + * way of spelling "nullable T". The mutation engine replaces them with the inner type. + * + * For multi-variant unions that contain null (e.g. `Cat | Dog | null`), + * use {@link stripNullVariants} instead. + * + * @returns The non-null variant type if this is a nullable wrapper, otherwise undefined. + */ +export function unwrapNullableUnion(union: Union): Type | undefined { + if (union.variants.size !== 2) return undefined; + const variants = Array.from(union.variants.values()); + const nullVariant = variants.find((v) => isNullType(v.type)); + if (!nullVariant) return undefined; + return variants.find((v) => v !== nullVariant)?.type; +} + +/** + * Check whether a type is a `T | null` union (exactly two variants, one null). + */ +export function isNullableUnion(type: Type): boolean { + return type.kind === "Union" && unwrapNullableUnion(type) !== undefined; +} + +/** + * Strip null variants from a union, returning the remaining variants + * and whether the union contained null. + * + * Used by the mutation engine to handle unions like `Cat | Dog | null`: + * the null is removed, the remaining variants are processed as a real union, + * and the nullability is tracked separately via the nullable state map. + */ +export function stripNullVariants(union: Union): { + variants: UnionVariant[]; + isNullable: boolean; +} { + const allVariants = Array.from(union.variants.values()); + const nonNullVariants = allVariants.filter((v) => !isNullType(v.type)); + return { + variants: nonNullVariants, + isNullable: nonNullVariants.length < allVariants.length, + }; +} + +/** Generate a GraphQL type name for a templated model (e.g., `ListOfString`). */ +export function getTemplatedModelName(model: Model): string { + const name = getTypeName(model, {}); + const baseName = toTypeName(stripAngleBrackets(name)); + const templateString = getTemplateString(model); + return templateString ? `${baseName}Of${templateString}` : baseName; +} + +/** Strip all angle-bracket type parameters from a type name (e.g., "List" → "List"). */ +function stripAngleBrackets(name: string): string { + let result = name; + let prev; + do { + prev = result; + result = result.replace(/<[^<>]*>/g, ""); + } while (result !== prev); + return result; +} + +function splitWithAcronyms( + splitFn: (name: string) => string[], + skipStart: boolean, + name: string, +): string[] { + const parts = splitFn(name); + + if (name === name.toUpperCase()) { + return parts; + } + // Split consecutive capital letters into individual characters for proper casing, + // e.g. "API" becomes ["A", "P", "I"] so PascalCase produces "Api" → but we preserve + // all-caps names at the toTypeName level, so this only affects mixed-case like "APIResponse". + return parts.flatMap((part, index) => { + if (skipStart && index === 0) return part; + if (part.match(/^[A-Z]+$/)) return part.split(""); + return part; + }); +} + +/** Convert a name to PascalCase for GraphQL type names. */ +export function toTypeName(name: string): string { + const sanitized = sanitizeNameForGraphQL(getNameWithoutNamespace(name)); + // Preserve all-caps names (acronyms like API, HTTP, URL) + if (/^[A-Z]+$/.test(sanitized)) { + return sanitized; + } + return pascalCase(sanitized, { + split: splitWithAcronyms.bind(null, split, false), + }); +} + +/** + * Sanitize a name to conform to GraphQL identifier format. + * Handles character-level formatting only (special chars, leading digits, array syntax). + */ +export function sanitizeNameForGraphQL(name: string, prefix: string = ""): string { + name = name.replace("[]", "Array"); + name = name.replaceAll(/\W/g, "_"); + if (!/^[_a-zA-Z]/.test(name)) { + name = `${prefix}_${name}`; + } + return name; +} + +/** Convert a name to CONSTANT_CASE for GraphQL enum members. */ +export function toEnumMemberName(enumName: string, name: string) { + return constantCase(sanitizeNameForGraphQL(name, enumName), { + split: splitSeparateNumbers, + prefixCharacters: "_", + }); +} + +/** Convert a name to camelCase for GraphQL field names. */ +export function toFieldName(name: string): string { + return camelCase(sanitizeNameForGraphQL(name), { + prefixCharacters: "_", + split: splitWithAcronyms.bind(null, split, true), + }); +} + +function getNameWithoutNamespace(name: string): string { + const parts = name.trim().split("."); + return parts[parts.length - 1]; +} + +/** Generate a GraphQL type name for a union, including anonymous unions. */ +export function getUnionName(union: Union, program: Program): string { + // Named union — use its name directly + if (union.name) { + return union.name; + } + + const ts = getTemplateString(union); + const templateString = ts ? "Of" + ts : ""; + + // Anonymous return type — name after the operation + // e.g. op getBaz(): Foo | Bar => GetBazUnion + if (isReturnType(union)) { + return `${getUnionNameForOperation(program, union)}${templateString}Union`; + } + + // Anonymous model property — name after model + property + // e.g. model Foo { bar: Bar | Baz } => FooBarUnion + const modelProperty = getModelProperty(union); + if (modelProperty) { + const propName = toTypeName(getNameForNode(modelProperty)); + const unionModel = union.node?.parent?.parent as ModelStatementNode; + const modelName = unionModel ? getNameForNode(unionModel) : ""; + return `${modelName}${propName}${templateString}Union`; + } + + // Alias — name after the alias + // e.g. alias Baz = Foo | Bar => Baz + const alias = getAlias(union); + if (alias) { + const aliasName = getNameForNode(alias); + return `${aliasName}${templateString}`; + } + + reportDiagnostic(program, { + code: "unrecognized-union", + target: union, + }); + return "UnknownUnion"; +} + +function isNamedType(type: Type | Value | IndeterminateEntity): type is { name: string } & Type { + return "name" in type && typeof (type as { name: unknown }).name === "string"; +} + +function isAliased(union: Union): boolean { + return union.node?.parent?.kind === SyntaxKind.AliasStatement; +} + +function getAlias(union: Union): AliasStatementNode | undefined { + return isAliased(union) ? (union.node?.parent as AliasStatementNode) : undefined; +} + +function isModelProperty(union: Union): boolean { + return union.node?.parent?.kind === SyntaxKind.ModelProperty; +} + +function getModelProperty(union: Union): ModelPropertyNode | undefined { + return isModelProperty(union) ? (union.node?.parent as ModelPropertyNode) : undefined; +} + +function isReturnType(type: Type): boolean { + return !!( + type.node && + type.node.parent?.kind === SyntaxKind.OperationSignatureDeclaration && + type.node.parent?.parent?.kind === SyntaxKind.OperationStatement + ); +} + +type NamedNode = Node & { id: IdentifierNode }; + +function getNameForNode(node: NamedNode): string { + return "id" in node && node.id?.kind === SyntaxKind.Identifier ? node.id.sv : ""; +} + +function getUnionNameForOperation(program: Program, union: Union): string { + const operationNode = union.node?.parent?.parent; + if (!operationNode) return "Unknown"; + const operation = program.checker.getTypeForNode(operationNode); + + return toTypeName(getTypeName(operation)); +} + +/** Convert a namespaced name to a single name by replacing dots with underscores. */ +export function getSingleNameWithNamespace(name: string): string { + return name.trim().replace(/\./g, "_"); +} + +/** + * Check if a model is an array type. + */ +export function isArray(model: Model): model is ArrayModelType { + return Boolean(model.indexer && model.indexer.key.name === "integer"); +} + +/** + * Check if a model is a record/map type. + */ +export function isRecordType(type: Model): type is RecordModelType { + return Boolean(type.indexer && type.indexer.key.name === "string"); +} + +/** Check if a model is an array of scalars or enums. */ +export function isScalarOrEnumArray(type: Model): type is ArrayModelType { + return ( + isArray(type) && (type.indexer?.value.kind === "Scalar" || type.indexer?.value.kind === "Enum") + ); +} + +/** Check if a model is an array of unions. */ +export function isUnionArray(type: Model): type is ArrayModelType { + return isArray(type) && type.indexer?.value.kind === "Union"; +} + +/** Extract the element type from an array model, or return the model itself. */ +export function unwrapModel(model: ArrayModelType): Model | Scalar | Enum | Union; +export function unwrapModel(model: Exclude): Model; +export function unwrapModel(model: Model): Model | Scalar | Enum | Union { + if (!isArray(model)) { + return model; + } + + if (model.indexer?.value.kind) { + if (["Model", "Scalar", "Enum", "Union"].includes(model.indexer.value.kind)) { + return model.indexer.value as Model | Scalar | Enum | Union; + } + throw new Error(`Unexpected array type: ${model.indexer.value.kind}`); + } + return model; +} + +/** Unwrap array types to get the inner element type. */ +export function unwrapType(type: Model): Model | Scalar | Enum | Union; +export function unwrapType(type: Type): Type; +export function unwrapType(type: Type): Type { + if (type.kind === "Model") { + return unwrapModel(type); + } + return type; +} + +/** Get the GraphQL description for a type from its doc comments. */ +export function getGraphQLDoc(program: Program, type: Type): string | undefined { + // GraphQL uses CommonMark for descriptions + // https://spec.graphql.org/October2021/#sec-Descriptions + return getDoc(program, type); +} + +/** Generate a string representation of template arguments (e.g., `StringAndInt`). */ +export function getTemplateString( + type: Type, + options: { conjunction: string } = { conjunction: "And" }, +): string { + if (isTemplateInstance(type)) { + const args = type.templateMapper.args.filter(isNamedType).map((arg) => getTypeName(arg)); + return getTemplateStringInternal(args, options); + } + return ""; +} + +function getTemplateStringInternal( + args: string[], + options: { conjunction: string } = { conjunction: "And" }, +): string { + // Apply toTypeName to convert raw compiler names (e.g., "string") to GraphQL PascalCase ("String") + return args.length > 0 ? args.map(toTypeName).join(options.conjunction) : ""; +} + +/** Check if a model should be emitted as a GraphQL object type (not an array, record, or never). */ +export function isTrueModel(model: Model): boolean { + if (isScalarOrEnumArray(model)) return false; + if (isUnionArray(model)) return false; + if (isNeverType(model)) return false; + if (isRecordType(model) && [...walkPropertiesInherited(model)].length === 0) return false; + return true; +} diff --git a/packages/graphql/src/lib/utils.ts b/packages/graphql/src/lib/utils.ts new file mode 100644 index 00000000000..609e6724237 --- /dev/null +++ b/packages/graphql/src/lib/utils.ts @@ -0,0 +1,55 @@ +import { + getTypeName, + walkPropertiesInherited, + type Model, + type ModelProperty, + type Operation, + type Type, +} from "@typespec/compiler"; + +function typesEqual(a: Type, b: Type): boolean { + return a === b || getTypeName(a) === getTypeName(b); +} + +export function propertiesEqual( + prop1: ModelProperty, + prop2: ModelProperty, + ignoreNames: boolean = false, +): boolean { + if (!ignoreNames && prop1.name !== prop2.name) { + return false; + } + return typesEqual(prop1.type, prop2.type) && prop1.optional === prop2.optional; +} + +export function modelsEqual(model1: Model, model2: Model, ignoreNames: boolean = false): boolean { + if (!ignoreNames && model1.name !== model2.name) { + return false; + } + const model1Properties = new Set(walkPropertiesInherited(model1)); + const model2Properties = new Set(walkPropertiesInherited(model2)); + if (model1Properties.size !== model2Properties.size) { + return false; + } + if ( + [...model1Properties].some( + (prop) => ![...model2Properties].some((p) => propertiesEqual(prop, p, false)), + ) + ) { + return false; + } + return true; +} + +export function operationsEqual( + op1: Operation, + op2: Operation, + ignoreNames: boolean = false, +): boolean { + if (!ignoreNames && op1.name !== op2.name) { + return false; + } + return ( + typesEqual(op1.returnType, op2.returnType) && modelsEqual(op1.parameters, op2.parameters, true) + ); +} diff --git a/packages/graphql/src/lib/visibility.ts b/packages/graphql/src/lib/visibility.ts new file mode 100644 index 00000000000..1caca41b154 --- /dev/null +++ b/packages/graphql/src/lib/visibility.ts @@ -0,0 +1,49 @@ +import { + getLifecycleVisibilityEnum, + isVisible, + type Model, + type ModelProperty, + type Program, + type VisibilityFilter, +} from "@typespec/compiler"; + +export interface GraphQLVisibilityFilters { + query: VisibilityFilter; + mutation: VisibilityFilter; + output: VisibilityFilter; +} + +export function createVisibilityFilters(program: Program): GraphQLVisibilityFilters { + const lifecycleEnum = getLifecycleVisibilityEnum(program); + const createMember = lifecycleEnum.members.get("Create")!; + const readMember = lifecycleEnum.members.get("Read")!; + const updateMember = lifecycleEnum.members.get("Update")!; + const queryMember = lifecycleEnum.members.get("Query")!; + + return { + query: { any: new Set([readMember, queryMember]) }, + mutation: { any: new Set([createMember, updateMember]) }, + output: { any: new Set([readMember]) }, + }; +} + +export function isPropertyVisible( + program: Program, + property: ModelProperty, + filter: VisibilityFilter, +): boolean { + return isVisible(program, property, filter); +} + +export function hasNoVisibleProperties( + program: Program, + model: Model, + filter: VisibilityFilter, +): boolean { + for (const prop of model.properties.values()) { + if (isVisible(program, prop, filter)) return false; + } + return true; +} + +export type { VisibilityFilter }; diff --git a/packages/graphql/src/mutation-engine/engine.ts b/packages/graphql/src/mutation-engine/engine.ts new file mode 100644 index 00000000000..f6857759a05 --- /dev/null +++ b/packages/graphql/src/mutation-engine/engine.ts @@ -0,0 +1,138 @@ +import { + type Enum, + type Model, + type Operation, + type Program, + type Scalar, + type Union, + type VisibilityFilter, +} from "@typespec/compiler"; + +import { $ } from "@typespec/compiler/typekit"; +import { + MutationEngine, + SimpleInterfaceMutation, + SimpleIntrinsicMutation, + SimpleLiteralMutation, + SimpleMutationOptions, + SimpleUnionVariantMutation, +} from "@typespec/mutator-framework"; +import { + GraphQLEnumMemberMutation, + GraphQLEnumMutation, + GraphQLModelMutation, + GraphQLModelPropertyMutation, + GraphQLOperationMutation, + GraphQLScalarMutation, + GraphQLUnionMutation, +} from "./mutations/index.js"; +import { GraphQLMutationOptions, GraphQLTypeContext } from "./options.js"; + +/** + * Registry configuration for the GraphQL mutation engine. + * Maps TypeSpec type kinds to their corresponding GraphQL mutation classes. + */ +const graphqlMutationRegistry = { + // Custom GraphQL mutations for types we need to transform + Enum: GraphQLEnumMutation, + EnumMember: GraphQLEnumMemberMutation, + Model: GraphQLModelMutation, + ModelProperty: GraphQLModelPropertyMutation, + Operation: GraphQLOperationMutation, + Scalar: GraphQLScalarMutation, + Union: GraphQLUnionMutation, + // Use Simple* classes from mutator-framework for types we don't customize + Interface: SimpleInterfaceMutation, + UnionVariant: SimpleUnionVariantMutation, + String: SimpleLiteralMutation, + Number: SimpleLiteralMutation, + Boolean: SimpleLiteralMutation, + Intrinsic: SimpleIntrinsicMutation, +}; + +/** + * GraphQL mutation engine that applies GraphQL-specific transformations + * to TypeSpec types, such as name sanitization, scalar mapping, and + * input/output type splitting via mutation keys. + * + * When an operation is mutated, parameters are automatically mutated with + * input context and return types with output context. The mutation framework's + * cache ensures each (type, context) pair produces a separate mutation. + */ +export class GraphQLMutationEngine { + // Type is inferred from the MutationEngine constructor. Explicitly typing as + // MutationEngine doesn't work because the + // generic expects instance types, not constructor types. + private engine; + + constructor(program: Program) { + const tk = $(program); + this.engine = new MutationEngine(tk, graphqlMutationRegistry); + } + + /** + * Mutate a model with explicit input/output context and optional visibility filter. + * Models mutated with different contexts produce separate cached mutations, + * allowing the same source model to have both an input and output variant. + */ + mutateModel( + model: Model, + context: GraphQLTypeContext, + visibilityFilter?: VisibilityFilter, + operationKind?: string, + inputQualifier?: string, + ): GraphQLModelMutation { + return this.engine.mutate( + model, + new GraphQLMutationOptions(context, visibilityFilter, operationKind, inputQualifier), + ) as GraphQLModelMutation; + } + + /** + * Mutate an enum, applying GraphQL name sanitization. + */ + mutateEnum(enumType: Enum): GraphQLEnumMutation { + return this.engine.mutate(enumType, new SimpleMutationOptions()) as GraphQLEnumMutation; + } + + /** + * Mutate an operation, applying GraphQL name sanitization. + * Parameters are automatically mutated with input context, + * return types with output context. + */ + mutateOperation(operation: Operation): GraphQLOperationMutation { + return this.engine.mutate(operation, new SimpleMutationOptions()) as GraphQLOperationMutation; + } + + /** + * Mutate a scalar, applying GraphQL name sanitization. + */ + mutateScalar(scalar: Scalar): GraphQLScalarMutation { + return this.engine.mutate(scalar, new SimpleMutationOptions()) as GraphQLScalarMutation; + } + + /** + * Mutate a union with explicit input/output context. + * In output context: creates wrapper types for scalar variants. mutatedType is a Union. + * In input context: replaces the union with a @oneOf input Model in the type graph, + * since GraphQL unions are output-only. mutatedType is a Model. + */ + mutateUnion( + union: Union, + context: GraphQLTypeContext, + visibilityFilter?: VisibilityFilter, + operationKind?: string, + ): GraphQLUnionMutation { + return this.engine.mutate( + union, + new GraphQLMutationOptions(context, visibilityFilter, operationKind), + ) as GraphQLUnionMutation; + } +} + +/** + * Creates a GraphQL mutation engine for the given program. + */ +export function createGraphQLMutationEngine(program: Program): GraphQLMutationEngine { + return new GraphQLMutationEngine(program); +} diff --git a/packages/graphql/src/mutation-engine/index.ts b/packages/graphql/src/mutation-engine/index.ts new file mode 100644 index 00000000000..e66e7ad38c9 --- /dev/null +++ b/packages/graphql/src/mutation-engine/index.ts @@ -0,0 +1,13 @@ +export { GraphQLMutationEngine, createGraphQLMutationEngine } from "./engine.js"; +export { + GraphQLEnumMemberMutation, + GraphQLEnumMutation, + GraphQLModelMutation, + GraphQLModelPropertyMutation, + GraphQLOperationMutation, + GraphQLScalarMutation, + GraphQLUnionMutation, +} from "./mutations/index.js"; +export { GraphQLMutationOptions, GraphQLTypeContext } from "./options.js"; +export { mutateSchema } from "./schema-mutator.js"; +export { buildTypeGraph, type TypeGraph } from "./type-graph.js"; diff --git a/packages/graphql/src/mutation-engine/mutations/enum-member.ts b/packages/graphql/src/mutation-engine/mutations/enum-member.ts new file mode 100644 index 00000000000..bcbbc50258e --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/enum-member.ts @@ -0,0 +1,49 @@ +import type { EnumMember, MemberType } from "@typespec/compiler"; +import { + EnumMemberMutation, + EnumMemberMutationNode, + MutationEngine, + type MutationInfo, + type MutationOptions, +} from "@typespec/mutator-framework"; +import { applyEnumMemberPipeline } from "../../lib/naming.js"; + +/** + * GraphQL-specific EnumMember mutation. + */ +export class GraphQLEnumMemberMutation extends EnumMemberMutation< + MutationOptions, + any, + MutationEngine +> { + #mutationNode: EnumMemberMutationNode; + + constructor( + engine: MutationEngine, + sourceType: EnumMember, + referenceTypes: MemberType[], + options: MutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + this.#mutationNode = this.engine.getMutationNode(this.sourceType, { + mutationKey: info.mutationKey, + isSynthetic: info.isSynthetic, + }) as EnumMemberMutationNode; + } + + get mutationNode() { + return this.#mutationNode; + } + + get mutatedType() { + return this.#mutationNode.mutatedType; + } + + mutate() { + this.#mutationNode.mutate((member) => { + member.name = applyEnumMemberPipeline(member.name); + }); + super.mutate(); + } +} diff --git a/packages/graphql/src/mutation-engine/mutations/enum.ts b/packages/graphql/src/mutation-engine/mutations/enum.ts new file mode 100644 index 00000000000..95c6bbbc1c1 --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/enum.ts @@ -0,0 +1,76 @@ +import type { Enum, MemberType } from "@typespec/compiler"; +import { + EnumMemberMutationNode, + EnumMutation, + EnumMutationNode, + MutationEngine, + MutationHalfEdge, + type MutationInfo, + type MutationOptions, +} from "@typespec/mutator-framework"; +import { applyTypeNamePipeline } from "../../lib/naming.js"; +import type { GraphQLEnumMemberMutation } from "./enum-member.js"; + +/** + * GraphQL-specific Enum mutation. + */ +export class GraphQLEnumMutation extends EnumMutation> { + #mutationNode: EnumMutationNode; + + constructor( + engine: MutationEngine, + sourceType: Enum, + referenceTypes: MemberType[], + options: MutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + this.#mutationNode = this.engine.getMutationNode(this.sourceType, { + mutationKey: info.mutationKey, + isSynthetic: info.isSynthetic, + }) as EnumMutationNode; + } + + get mutationNode() { + return this.#mutationNode; + } + + get mutatedType() { + return this.#mutationNode.mutatedType; + } + + /** + * Creates a MutationHalfEdge that wraps the node-level edge. + * This ensures proper bidirectional updates when members are renamed. + */ + protected startMemberEdge(): MutationHalfEdge { + return new MutationHalfEdge("member", this, (tail) => { + this.#mutationNode.connectMember(tail.mutationNode as EnumMemberMutationNode); + }); + } + + /** + * Override to pass half-edge for proper bidirectional updates. + */ + protected override mutateMembers() { + for (const member of this.sourceType.members.values()) { + this.members.set( + member.name, + this.engine.mutate(member, this.options, this.startMemberEdge()), + ); + } + } + + mutate() { + this.#mutationNode.mutate((enumType) => { + enumType.name = applyTypeNamePipeline(enumType.name, { + isInput: false, + isInterface: false, + }); + }); + // Handle member mutations with proper edges + this.mutateMembers(); + // Call super to finalize + super.mutate(); + } +} diff --git a/packages/graphql/src/mutation-engine/mutations/index.ts b/packages/graphql/src/mutation-engine/mutations/index.ts new file mode 100644 index 00000000000..580fba1dabe --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/index.ts @@ -0,0 +1,7 @@ +export { GraphQLEnumMemberMutation } from "./enum-member.js"; +export { GraphQLEnumMutation } from "./enum.js"; +export { GraphQLModelPropertyMutation } from "./model-property.js"; +export { GraphQLModelMutation } from "./model.js"; +export { GraphQLOperationMutation } from "./operation.js"; +export { GraphQLScalarMutation } from "./scalar.js"; +export { GraphQLUnionMutation } from "./union.js"; diff --git a/packages/graphql/src/mutation-engine/mutations/model-property.ts b/packages/graphql/src/mutation-engine/mutations/model-property.ts new file mode 100644 index 00000000000..c04dddf3286 --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/model-property.ts @@ -0,0 +1,64 @@ +import { isArrayModelType, type MemberType, type ModelProperty } from "@typespec/compiler"; +import { + SimpleModelPropertyMutation, + type MutationInfo, + type SimpleMutationEngine, + type SimpleMutationOptions, + type SimpleMutations, +} from "@typespec/mutator-framework"; +import { setNullable, setNullableElements } from "../../../generated-defs/TypeSpec.GraphQL.js"; +import { applyFieldNamePipeline } from "../../lib/naming.js"; +import { isNullableUnion, unwrapNullableUnion } from "../../lib/type-utils.js"; + +/** GraphQL-specific ModelProperty mutation. */ +export class GraphQLModelPropertyMutation extends SimpleModelPropertyMutation { + constructor( + engine: SimpleMutationEngine>, + sourceType: ModelProperty, + referenceTypes: MemberType[], + options: SimpleMutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + // Register rename callback before edge connections trigger mutation. + this.mutationNode.whenMutated((property) => { + if (property) { + property.name = applyFieldNamePipeline(property.name); + } + }); + } + + mutate() { + const program = this.engine.$.program; + + // Snapshot nullability from the original type BEFORE mutation replaces it. + // We mark the property (not the inner type) to avoid poisoning shared singletons. + // A `@nullable` / `@nullableElements` applied directly to the source is re-applied + // on the mutated clone during `finishType`, so it needs no explicit propagation here. + const originalType = this.sourceType.type; + + const isInlineNullable = isNullableUnion(originalType); + + // For element nullability, look through an outer `| null` wrapper to find the array. + // e.g. `(string | null)[] | null` → unwrap outer null → check array elements. + const innerType = + originalType.kind === "Union" + ? (unwrapNullableUnion(originalType) ?? originalType) + : originalType; + + const isArrayWithNullableElements = + innerType.kind === "Model" && + isArrayModelType(innerType) && + isNullableUnion(innerType.indexer.value); + + this.mutationNode.mutate(); + super.mutate(); + + if (isInlineNullable) { + setNullable(program, this.mutatedType); + } + if (isArrayWithNullableElements) { + setNullableElements(program, this.mutatedType); + } + } +} diff --git a/packages/graphql/src/mutation-engine/mutations/model.ts b/packages/graphql/src/mutation-engine/mutations/model.ts new file mode 100644 index 00000000000..edf2ee040ae --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/model.ts @@ -0,0 +1,222 @@ +import { + isArrayModelType, + isTemplateInstance, + isType, + walkPropertiesInherited, + type MemberType, + type Model, + type Program, + type Type, + type Value, +} from "@typespec/compiler"; +import { + SimpleModelMutation, + type MutationInfo, + type MutationOptions, + type SimpleMutationEngine, + type SimpleMutationOptions, + type SimpleMutations, +} from "@typespec/mutator-framework"; +import { isInterfaceOnly } from "../../lib/interface.js"; +import { applyTypeNamePipeline } from "../../lib/naming.js"; +import { composeTemplateName } from "../../lib/template-composition.js"; +import { isRecordType } from "../../lib/type-utils.js"; +import { + hasNoVisibleProperties, + isPropertyVisible, + type VisibilityFilter, +} from "../../lib/visibility.js"; +import { GraphQLMutationOptions, GraphQLTypeContext } from "../options.js"; + +/** + * Maps decorator function names to the mutation context their type args + * should be mutated with. When a model is cloned, decorator args that + * reference types need re-mutation — but the context may differ from the + * model's own context (e.g., @compose args are always interfaces regardless + * of whether the model is mutated as Input or Output). + * + * Keyed by function name (not reference) because vitest can load the same + * module from different paths, creating distinct function objects. + */ +const decoratorArgContext = new Map([ + ["$compose", GraphQLTypeContext.Interface], +]); + +/** + * GraphQL-specific Model mutation. + */ +export class GraphQLModelMutation extends SimpleModelMutation { + constructor( + engine: SimpleMutationEngine>, + sourceType: Model, + referenceTypes: MemberType[], + options: SimpleMutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + } + + /** + * The input/output context this model was mutated with, if any. + * Undefined when the model was mutated directly (not through an operation). + */ + get typeContext(): GraphQLTypeContext | undefined { + return this.options instanceof GraphQLMutationOptions ? this.options.typeContext : undefined; + } + + mutate() { + const tk = this.engine.$; + const program = tk.program; + const isInputContext = this.typeContext === GraphQLTypeContext.Input; + const isInterfaceContext = this.typeContext === GraphQLTypeContext.Interface; + + const rawName = isTemplateInstance(this.sourceType) + ? composeTemplateName(this.sourceType) + : this.sourceType.name; + const visibilityFilter = + this.options instanceof GraphQLMutationOptions ? this.options.visibilityFilter : undefined; + const inputQualifier = + this.options instanceof GraphQLMutationOptions ? this.options.inputQualifier : undefined; + + if (this.shouldReplaceWithScalar(program, visibilityFilter)) { + // Record scalars should NOT get Input suffix - they're opaque map types with + // no structural difference between input/output. Visibility-filtered scalars + // (where all properties were removed) keep the Input suffix to distinguish variants. + const isPureRecord = + isRecordType(this.sourceType) && + (walkPropertiesInherited(this.sourceType).next().done ?? false); + const scalarName = applyTypeNamePipeline(rawName, { + isInput: isInputContext && !isPureRecord, + isInterface: false, + inputQualifier: isPureRecord ? undefined : inputQualifier, + }); + this.mutationNode.replace( + program.checker.createType({ + kind: "Scalar", + name: scalarName, + decorators: [], + derivedScalars: [], + constructors: new Map(), + }), + ); + return; + } + + const needsInterfaceSuffix = isInterfaceContext && !isInterfaceOnly(program, this.sourceType); + + this.mutationNode.mutate((model) => { + model.name = applyTypeNamePipeline(rawName, { + isInput: isInputContext, + isInterface: needsInterfaceSuffix, + inputQualifier, + }); + if (isInputContext) { + model.decorators = model.decorators.filter( + (d) => !decoratorArgContext.has(d.decorator.name), + ); + } else { + this.mutateDecoratorTypeArgs(model); + } + }); + super.mutate(); + this.flattenBaseModel(); + } + + protected override mutateProperties(newOptions: MutationOptions = this.options) { + const visibilityFilter = + this.options instanceof GraphQLMutationOptions ? this.options.visibilityFilter : undefined; + + if (!visibilityFilter) { + super.mutateProperties(newOptions); + return; + } + + const program = this.engine.$.program; + + for (const prop of this.sourceType.properties.values()) { + if (!isPropertyVisible(program, prop, visibilityFilter)) { + this.mutationNode.mutatedType.properties.delete(prop.name); + } + } + for (const prop of this.sourceType.properties.values()) { + if (isPropertyVisible(program, prop, visibilityFilter)) { + this.properties.set( + prop.name, + this.engine.mutate(prop, newOptions, this.startPropertyEdge()), + ); + } + } + } + + private flattenBaseModel() { + if (!this.baseModel) return; + const mutated = this.mutationNode.mutatedType; + const baseProps = this.baseModel.mutatedType.properties; + const ownEntries = [...mutated.properties.entries()]; + mutated.properties.clear(); + for (const [name, prop] of baseProps) { + mutated.properties.set(name, prop); + } + for (const [name, prop] of ownEntries) { + mutated.properties.set(name, prop); + } + mutated.baseModel = undefined; + } + + private shouldReplaceWithScalar( + program: Program, + visibilityFilter: VisibilityFilter | undefined, + ): boolean { + if (!this.sourceType.name || isArrayModelType(this.sourceType)) return false; + return this.willHaveNoFields(program, visibilityFilter); + } + + private willHaveNoFields( + program: Program, + visibilityFilter: VisibilityFilter | undefined, + ): boolean { + // Record with no own/inherited properties → opaque map scalar + if (isRecordType(this.sourceType)) + return walkPropertiesInherited(this.sourceType).next().done ?? false; + // Model declared with no properties at all + if (this.sourceType.properties.size === 0) return true; + // All properties removed by visibility filtering (e.g., all @visibility(Lifecycle.Read) in input context) + if (visibilityFilter) return hasNoVisibleProperties(program, this.sourceType, visibilityFilter); + return false; + } + + private mutateDecoratorTypeArgs(model: Model) { + for (let i = 0; i < model.decorators.length; i++) { + const dec = model.decorators[i]; + const argContext = decoratorArgContext.get(dec.decorator.name); + const options = argContext ? new GraphQLMutationOptions(argContext) : this.options; + + let argsChanged = false; + const newArgs = dec.args.map((arg) => { + if (this.isMutableType(arg.value)) { + const mutation = this.engine.mutate(arg.value, options) as { mutatedType: Type }; + argsChanged = true; + return { ...arg, value: mutation.mutatedType, jsValue: mutation.mutatedType }; + } + return arg; + }); + + if (argsChanged) { + model.decorators[i] = { ...dec, args: newArgs }; + } + } + } + + private isMutableType(value: Type | Value): value is Type { + if (!isType(value)) return false; + const kind = value.kind; + return ( + kind === "Model" || + kind === "Union" || + kind === "Scalar" || + kind === "Enum" || + kind === "Interface" || + kind === "Operation" + ); + } +} diff --git a/packages/graphql/src/mutation-engine/mutations/operation.ts b/packages/graphql/src/mutation-engine/mutations/operation.ts new file mode 100644 index 00000000000..7823850607a --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/operation.ts @@ -0,0 +1,104 @@ +import { isArrayModelType, type MemberType, type Operation } from "@typespec/compiler"; +import { + SimpleOperationMutation, + type MutationInfo, + type SimpleMutationEngine, + type SimpleMutationOptions, + type SimpleMutations, +} from "@typespec/mutator-framework"; +import { setNullable, setNullableElements } from "../../../generated-defs/TypeSpec.GraphQL.js"; +import { applyFieldNamePipeline } from "../../lib/naming.js"; +import { getOperationKind } from "../../lib/operation-kind.js"; +import { isNullableUnion, unwrapNullableUnion } from "../../lib/type-utils.js"; +import { createVisibilityFilters } from "../../lib/visibility.js"; +import { GraphQLMutationOptions, GraphQLTypeContext } from "../options.js"; + +/** GraphQL-specific Operation mutation. */ +export class GraphQLOperationMutation extends SimpleOperationMutation { + constructor( + engine: SimpleMutationEngine>, + sourceType: Operation, + referenceTypes: MemberType[], + options: SimpleMutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + } + + /** Mutate parameters with input context and operation-kind-aware visibility. */ + protected override mutateParameters() { + const program = this.engine.$.program; + const kind = getOperationKind(program, this.sourceType); + const filters = createVisibilityFilters(program); + const isQuery = kind === "Query" || kind === "Subscription"; + const visibilityFilter = isQuery ? filters.query : filters.mutation; + const opKind = isQuery ? "query" : "mutation"; + const inputOptions = new GraphQLMutationOptions( + GraphQLTypeContext.Input, + visibilityFilter, + opKind, + ); + this.parameters = this.engine.mutate( + this.sourceType.parameters, + inputOptions, + this.startParametersEdge(), + ); + } + + /** Mutate return type with output context. */ + protected override mutateReturnType() { + const program = this.engine.$.program; + const filters = createVisibilityFilters(program); + const outputOptions = new GraphQLMutationOptions(GraphQLTypeContext.Output, filters.output); + this.returnType = this.engine.mutate( + this.sourceType.returnType, + outputOptions, + this.startReturnTypeEdge(), + ); + } + + mutate() { + const program = this.engine.$.program; + + // Snapshot return-type nullability before mutation replaces it. + // A `@nullable` / `@nullableElements` applied directly to the source operation is + // re-applied on the mutated clone during `finishType`; no explicit propagation needed. + const returnType = this.sourceType.returnType; + const hasNullableReturn = isNullableUnion(returnType); + + // For element nullability, look through an outer `| null` wrapper to find the array. + // e.g. `(string | null)[] | null` → unwrap outer null → check array elements. + const innerReturnType = + returnType.kind === "Union" ? (unwrapNullableUnion(returnType) ?? returnType) : returnType; + + const hasNullableElements = + innerReturnType.kind === "Model" && + isArrayModelType(innerReturnType) && + isNullableUnion(innerReturnType.indexer.value); + + this.mutationNode.mutate((operation) => { + const iface = this.sourceType.interface; + const rawName = iface ? `${iface.name}_${operation.name}` : operation.name; + operation.name = applyFieldNamePipeline(rawName); + }); + super.mutate(); + + // Remove parameters whose type was visibility-filtered to an empty model. + for (const [name, param] of this.mutatedType.parameters.properties) { + if ( + param.type.kind === "Model" && + !isArrayModelType(param.type) && + param.type.properties.size === 0 + ) { + this.mutatedType.parameters.properties.delete(name); + } + } + + if (hasNullableReturn) { + setNullable(program, this.mutatedType); + } + if (hasNullableElements) { + setNullableElements(program, this.mutatedType); + } + } +} diff --git a/packages/graphql/src/mutation-engine/mutations/scalar.ts b/packages/graphql/src/mutation-engine/mutations/scalar.ts new file mode 100644 index 00000000000..ee0bdfb6b90 --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/scalar.ts @@ -0,0 +1,97 @@ +import type { MemberType, Scalar } from "@typespec/compiler"; +import { + SimpleScalarMutation, + type MutationInfo, + type SimpleMutationEngine, + type SimpleMutationOptions, + type SimpleMutations, +} from "@typespec/mutator-framework"; +import { reportDiagnostic } from "../../lib.js"; +import { applyTypeNamePipeline } from "../../lib/naming.js"; +import { getScalarMapping, isStdScalar } from "../../lib/scalar-mappings.js"; +import { getSpecifiedBy, setSpecifiedByUrl } from "../../lib/specified-by.js"; + +/** + * GraphQL built-in scalar type names. + * @see https://spec.graphql.org/September2025/#sec-Scalars.Built-in-Scalars + */ +const GRAPHQL_BUILTIN_SCALARS = new Set(["String", "Int", "Float", "Boolean", "ID"]); + +/** + * Check whether a scalar is the GraphQL library's `ID` scalar, or extends it. + * Walks the baseScalar chain looking for a scalar named "ID" in the + * TypeSpec.GraphQL namespace. + */ +function isGraphQLIdScalar(scalar: Scalar): boolean { + let current: Scalar | undefined = scalar; + while (current) { + if ( + current.name === "ID" && + current.namespace?.name === "GraphQL" && + current.namespace?.namespace?.name === "TypeSpec" + ) { + return true; + } + current = current.baseScalar; + } + return false; +} + +/** GraphQL-specific Scalar mutation */ +export class GraphQLScalarMutation extends SimpleScalarMutation { + constructor( + engine: SimpleMutationEngine>, + sourceType: Scalar, + referenceTypes: MemberType[], + options: SimpleMutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + } + + mutate() { + const tk = this.engine.$; + const program = tk.program; + const mapping = getScalarMapping(program, this.sourceType); + + if (isGraphQLIdScalar(this.sourceType)) { + // GraphQL library scalar ID (or extends it) → built-in GraphQL ID type + this.mutationNode.mutate((scalar) => { + scalar.name = "ID"; + scalar.baseScalar = undefined; + }); + } else { + if (!isStdScalar(tk, this.sourceType)) { + // User-defined custom scalar — sanitize name, strip extends. + // May still have a mapping via extends chain (e.g. scalar MyInt extends int64), + // which is used for @specifiedBy below but not for renaming. + const finalName = applyTypeNamePipeline(this.sourceType.name, { + isInput: false, + isInterface: false, + }); + if (GRAPHQL_BUILTIN_SCALARS.has(finalName)) { + reportDiagnostic(program, { + code: "graphql-builtin-scalar-collision", + target: this.sourceType, + format: { name: this.sourceType.name, builtinName: finalName }, + }); + } + this.mutationNode.mutate((scalar) => { + scalar.name = finalName; + scalar.baseScalar = undefined; + }); + } + // else: Built-in std scalars (string, boolean, int32, etc.) are left untouched — + // they map to GraphQL built-in types and are resolved at emit time. + } + + // Apply @specifiedBy: explicit decorator on source wins, then mapping table + // (mapping may come from an ancestor via the extends chain) + const specUrl = getSpecifiedBy(program, this.sourceType) ?? mapping?.specificationUrl; + if (specUrl) { + setSpecifiedByUrl(program, this.mutatedType, specUrl); + } + + super.mutate(); + } +} diff --git a/packages/graphql/src/mutation-engine/mutations/union.ts b/packages/graphql/src/mutation-engine/mutations/union.ts new file mode 100644 index 00000000000..3a83156c023 --- /dev/null +++ b/packages/graphql/src/mutation-engine/mutations/union.ts @@ -0,0 +1,312 @@ +import { + type MemberType, + type Model, + type Type, + type Union, + getTypeName, +} from "@typespec/compiler"; +import { + MutationEngine, + MutationHalfEdge, + type MutationInfo, + type MutationOptions, + SimpleUnionVariantMutation, + UnionMutation, + UnionMutationNode, + UnionVariantMutationNode, +} from "@typespec/mutator-framework"; +import { setNullable, setOneOf } from "../../../generated-defs/TypeSpec.GraphQL.js"; +import { reportDiagnostic } from "../../lib.js"; +import { + applyBaseNamePipeline, + applyFieldNamePipeline, + applyTypeNamePipeline, +} from "../../lib/naming.js"; +import { getUnionName, stripNullVariants, unwrapNullableUnion } from "../../lib/type-utils.js"; +import { GraphQLMutationOptions, GraphQLTypeContext } from "../options.js"; + +/** Convert a variant name (string or symbol) to a string. */ +function variantNameToString(name: string | symbol): string { + return typeof name === "string" ? name : (name.description ?? ""); +} + +/** + * Resolve the actual mutated type from a mutation result. + * Handles the case where mutationNode.replace() was called — the inherited + * mutatedType getter doesn't reflect replacements, so we check the node directly. + */ +function resolveType(mutation: { + mutationNode: { isReplaced: boolean; replacementNode: any }; + mutatedType: Type; +}): Type { + const node = mutation.mutationNode; + if (node.isReplaced && node.replacementNode) { + return node.replacementNode.mutatedType; + } + return mutation.mutatedType; +} + +/** + * GraphQL-specific Union mutation. + * + * Output context: flattens nested unions, deduplicates, wraps scalar variants. + * Input context: replaces with @oneOf input object (GraphQL unions are output-only). + */ +export class GraphQLUnionMutation extends UnionMutation> { + #mutationNode: UnionMutationNode; + #wrapperModels: Model[] = []; + #flattenedUnion: Union | null = null; + + constructor( + engine: MutationEngine, + sourceType: Union, + referenceTypes: MemberType[], + options: MutationOptions, + info: MutationInfo, + ) { + super(engine, sourceType, referenceTypes, options, info); + this.#mutationNode = this.engine.getMutationNode(this.sourceType, { + mutationKey: info.mutationKey, + isSynthetic: info.isSynthetic, + }) as UnionMutationNode; + } + + /** The input/output context, or undefined if options aren't GraphQLMutationOptions. */ + get typeContext(): GraphQLTypeContext | undefined { + return this.options instanceof GraphQLMutationOptions ? this.options.typeContext : undefined; + } + + get mutationNode() { + return this.#mutationNode; + } + + get mutatedType(): Union | Model { + // In input context, the union node is replaced with a @oneOf Model + if (this.#mutationNode.isReplaced && this.#mutationNode.replacementNode) { + return this.#mutationNode.replacementNode.mutatedType as Model; + } + // Return flattened union if we created one, otherwise use mutation node's type + return this.#flattenedUnion || this.#mutationNode.mutatedType; + } + + /** Synthetic wrapper models for scalar union variants. */ + get wrapperModels() { + return this.#wrapperModels; + } + + /** Creates a half-edge for bidirectional variant mutation updates. */ + protected startVariantEdge(): MutationHalfEdge< + GraphQLUnionMutation, + SimpleUnionVariantMutation + > { + return new MutationHalfEdge("variant", this, (tail) => { + this.#mutationNode.connectVariant(tail.mutationNode as UnionVariantMutationNode); + }); + } + + mutate() { + // T | null is not a real union — replace with the inner type. + // Don't mark the replacement as nullable here; it's a shared singleton. + // Nullability is tracked by the container (ModelProperty or Operation). + const innerType = unwrapNullableUnion(this.sourceType); + if (innerType) { + const innerMutation = this.engine.mutate(innerType, this.options); + this.#mutationNode.replace(resolveType(innerMutation)); + return; + } + + if (this.typeContext === GraphQLTypeContext.Input) { + this.mutateAsOneOfInput(); + return; + } + + this.mutateAsOutputUnion(); + super.mutate(); + } + + /** Flatten nested unions, deduplicate, and wrap scalar variants in synthetic models. */ + private mutateAsOutputUnion() { + const tk = this.engine.$; + const program = tk.program; + + const rawName = getUnionName(this.sourceType, program); + const unionName = applyTypeNamePipeline(rawName, { isInput: false, isInterface: false }); + + const { variants: sourceVariants, isNullable: hasNullVariant } = stripNullVariants( + this.sourceType, + ); + const hasNull = hasNullVariant; + + const flattenedVariants = this.deduplicateVariants(this.flattenVariants(sourceVariants)); + + if (flattenedVariants.length === 0) { + reportDiagnostic(program, { code: "empty-union", target: this.sourceType }); + return; + } + + if (flattenedVariants.length === 1) { + const innerMutation = this.engine.mutate(flattenedVariants[0].type, this.options); + this.#mutationNode.replace(resolveType(innerMutation)); + if (hasNull) { + setNullable(program, this.mutatedType); + } + return; + } + + const needsFlattening = flattenedVariants.length !== sourceVariants.length; + + // Mutate each variant's type so it goes through the full pipeline + const mutatedVariants = flattenedVariants.map((variant) => ({ + name: variant.name, + type: resolveType(this.engine.mutate(variant.type, this.options)), + })); + + // GraphQL unions can only contain object types — wrap scalars in synthetic models + // and substitute the wrapper into the variant so the union is self-contained. + for (const variant of mutatedVariants) { + const isScalar = variant.type.kind === "Scalar" || variant.type.kind === "Intrinsic"; + + if (isScalar) { + const variantName = variantNameToString(variant.name); + const wrapperName = + applyBaseNamePipeline(unionName) + applyBaseNamePipeline(variantName) + "UnionVariant"; + + const valueProp = tk.modelProperty.create({ + name: "value", + type: variant.type, + optional: false, + }); + + const wrapperModel = tk.model.create({ + name: wrapperName, + properties: { value: valueProp }, + }); + + this.#wrapperModels.push(wrapperModel); + variant.type = wrapperModel; + } + } + + if (needsFlattening || hasNull || this.#wrapperModels.length > 0) { + const variantArray = mutatedVariants.map((variant) => { + return tk.unionVariant.create({ + name: variantNameToString(variant.name), + type: variant.type, + }); + }); + + const flattenedUnion = tk.type.clone(this.sourceType); + flattenedUnion.name = unionName; + flattenedUnion.variants.clear(); + for (const variant of variantArray) { + flattenedUnion.variants.set(variant.name, variant); + variant.union = flattenedUnion; + } + tk.type.finishType(flattenedUnion); + + this.#flattenedUnion = flattenedUnion; + } else { + this.#mutationNode.mutate((union) => { + union.name = unionName; + }); + } + + if (hasNull) { + setNullable(program, this.mutatedType); + } + } + + /** + * Replace with a @oneOf input object (GraphQL unions are output-only). + * @see https://spec.graphql.org/September2025/#sec-OneOf-Input-Objects + */ + private mutateAsOneOfInput() { + const tk = this.engine.$; + const program = tk.program; + + const { variants: sourceVariants, isNullable: hasNullVariant } = stripNullVariants( + this.sourceType, + ); + const hasNull = hasNullVariant; + + const flattenedVariants = this.deduplicateVariants(this.flattenVariants(sourceVariants)); + + if (flattenedVariants.length === 0) { + reportDiagnostic(program, { code: "empty-union", target: this.sourceType }); + return; + } + + const properties: Record> = {}; + for (const variant of flattenedVariants) { + const fieldName = applyFieldNamePipeline(variantNameToString(variant.name)); + const mutatedType = resolveType(this.engine.mutate(variant.type, this.options)); + properties[fieldName] = tk.modelProperty.create({ + name: fieldName, + type: mutatedType, + optional: true, // oneOf: exactly one must be provided + }); + } + + const unionName = getUnionName(this.sourceType, program); + const modelName = applyTypeNamePipeline(unionName, { isInput: true, isInterface: false }); + + const oneOfModel = tk.model.create({ + name: modelName, + properties, + }); + + setOneOf(program, oneOfModel); + + if (hasNull) { + setNullable(program, oneOfModel); + } + + this.#mutationNode.replace(oneOfModel); + } + + /** Recursively flatten nested unions (GraphQL doesn't support nesting). */ + private flattenVariants( + variants: readonly { name: string | symbol; type: Type }[], + seen: Set = new Set(), + ): Array<{ name: string | symbol; type: Type }> { + const flattened: Array<{ name: string | symbol; type: Type }> = []; + + for (const variant of variants) { + if (variant.type.kind === "Union") { + const nestedUnion = variant.type as Union; + if (seen.has(nestedUnion)) continue; + seen.add(nestedUnion); + + const { variants: nestedVariants } = stripNullVariants(nestedUnion); + flattened.push(...this.flattenVariants(nestedVariants, seen)); + } else { + flattened.push({ name: variant.name, type: variant.type }); + } + } + + return flattened; + } + + /** Deduplicate variants by type identity; first occurrence wins. */ + private deduplicateVariants( + variants: Array<{ name: string | symbol; type: Type }>, + ): Array<{ name: string | symbol; type: Type }> { + const seen = new Map(); + const result: Array<{ name: string | symbol; type: Type }> = []; + + for (const variant of variants) { + if (seen.has(variant.type)) { + reportDiagnostic(this.engine.$.program, { + code: "duplicate-union-variant", + format: { type: getTypeName(variant.type) }, + target: this.sourceType, + }); + } else { + seen.set(variant.type, variant); + result.push(variant); + } + } + + return result; + } +} diff --git a/packages/graphql/src/mutation-engine/options.ts b/packages/graphql/src/mutation-engine/options.ts new file mode 100644 index 00000000000..e16b48ce20d --- /dev/null +++ b/packages/graphql/src/mutation-engine/options.ts @@ -0,0 +1,53 @@ +import type { VisibilityFilter } from "@typespec/compiler"; +import { SimpleMutationOptions } from "@typespec/mutator-framework"; + +/** + * Context for how a type is used in GraphQL operations. + * Determines whether a model becomes an object type (output) or input type (input). + */ +export enum GraphQLTypeContext { + /** Type reachable from operation parameters */ + Input = "input", + /** Type reachable from operation return types */ + Output = "output", + /** Model marked with @interface — emits as a GraphQL interface declaration */ + Interface = "interface", +} + +/** + * Mutation options that carry input/output context and visibility through the type graph. + * The mutationKey ensures the framework caches variants separately. + * + * @param typeContext - structural context (Input/Output/Interface) + * @param visibilityFilter - which properties to include (from compiler's VisibilityFilter) + * @param inputQualifier - when set, distinguishes cache entries and feeds the naming pipeline + * (e.g., "Query" → UserQueryInput, "Mutation" → UserMutationInput) + */ +export class GraphQLMutationOptions extends SimpleMutationOptions { + readonly typeContext: GraphQLTypeContext; + readonly visibilityFilter?: VisibilityFilter; + /** Cache key discriminator — always set for input variants ("query" or "mutation"). */ + readonly operationKind?: string; + /** Naming qualifier — only set when operation variance requires distinct type names. */ + readonly inputQualifier?: string; + + constructor( + typeContext: GraphQLTypeContext, + visibilityFilter?: VisibilityFilter, + operationKind?: string, + inputQualifier?: string, + ) { + super(); + this.typeContext = typeContext; + this.visibilityFilter = visibilityFilter; + this.operationKind = operationKind; + this.inputQualifier = inputQualifier; + } + + override get mutationKey(): string { + if (this.operationKind) { + return `${this.typeContext}-${this.operationKind}`; + } + return this.typeContext; + } +} diff --git a/packages/graphql/src/mutation-engine/print-type.ts b/packages/graphql/src/mutation-engine/print-type.ts new file mode 100644 index 00000000000..1f2222121f0 --- /dev/null +++ b/packages/graphql/src/mutation-engine/print-type.ts @@ -0,0 +1,32 @@ +import { isArrayModelType, type ModelProperty, type Program } from "@typespec/compiler"; +import { isNullable, isNullableElements } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { resolveGraphQLTypeName } from "../lib/graphql-type-name.js"; + +/** + * Print a mutated type as its GraphQL type string representation. + * Reads the mutation engine's metadata (nullable, nullableElements) + * to produce the correct nullability wrapping. + * + * Examples: + * required string property → "String!" + * optional string property → "String" + * required string[] property → "[String!]!" + * optional (string | null)[] → "[String]" + */ +export function printMutatedType(program: Program, prop: ModelProperty): string { + const propNullable = isNullable(program, prop) || prop.optional; + const elementsNullable = isNullableElements(program, prop); + + const type = prop.type; + + if (type.kind === "Model" && isArrayModelType(type)) { + const elementType = type.indexer.value; + const elementName = resolveGraphQLTypeName(elementType); + const inner = elementsNullable ? elementName : `${elementName}!`; + const list = `[${inner}]`; + return propNullable ? list : `${list}!`; + } + + const name = resolveGraphQLTypeName(type); + return propNullable ? name : `${name}!`; +} diff --git a/packages/graphql/src/mutation-engine/schema-mutator.ts b/packages/graphql/src/mutation-engine/schema-mutator.ts new file mode 100644 index 00000000000..f63db56b3a9 --- /dev/null +++ b/packages/graphql/src/mutation-engine/schema-mutator.ts @@ -0,0 +1,207 @@ +import { + isArrayModelType, + navigateTypesInNamespace, + type Enum, + type Model, + type Namespace, + type Operation, + type Program, + type Scalar, + type Type, + type Union, +} from "@typespec/compiler"; +import { $ } from "@typespec/compiler/typekit"; +import { setInputType } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { reportDiagnostic } from "../lib.js"; +import { isInterface } from "../lib/interface.js"; +import { getOperationFields } from "../lib/operation-fields.js"; +import { isStdScalar } from "../lib/scalar-mappings.js"; +import { createVisibilityFilters } from "../lib/visibility.js"; +import { GraphQLTypeUsage, type TypeUsageResolver } from "../type-usage.js"; +import type { GraphQLMutationEngine } from "./engine.js"; +import type { GraphQLModelMutation } from "./mutations/model.js"; +import { GraphQLTypeContext } from "./options.js"; +import { buildTypeGraph, type TypeGraph } from "./type-graph.js"; + +/** + * Walk every type in the schema namespace, mutate it through the GraphQL + * mutation engine, and package the results into a TypeGraph. + * + * Filtering (unreachable types, array models, nullable unions) happens here + * so the engine only processes types that belong in the schema. + * + * Models used as both input and output get two mutations (Output and Input), + * producing separate entries in the TypeGraph (e.g., `Book` and `BookInput`). + */ +export function mutateSchema( + program: Program, + engine: GraphQLMutationEngine, + schema: Namespace, + typeUsage: TypeUsageResolver, +): TypeGraph { + const tk = $(program); + const mutatedTypes: Type[] = []; + const filters = createVisibilityFilters(program); + + function pushMutatedModel(mutation: GraphQLModelMutation) { + const node = mutation.mutationNode; + if (node.isReplaced && node.replacementNode) { + mutatedTypes.push(node.replacementNode.mutatedType); + } else { + mutatedTypes.push(mutation.mutatedType); + } + } + + navigateTypesInNamespace(schema, { + model: (node: Model) => { + if (isArrayModelType(node)) return; + if (typeUsage.isUnreachable(node)) return; + + const usage = typeUsage.getUsage(node); + const usedAsOutput = usage?.has(GraphQLTypeUsage.Output) ?? false; + const usedAsInput = usage?.has(GraphQLTypeUsage.Input) ?? false; + const isInterfaceModel = isInterface(program, node); + + if (isInterfaceModel) { + const mutation = engine.mutateModel(node, GraphQLTypeContext.Interface); + pushMutatedModel(mutation); + } + if (!isInterfaceModel && (usedAsOutput || !usage)) { + const mutation = engine.mutateModel(node, GraphQLTypeContext.Output, filters.output); + pushMutatedModel(mutation); + } + if (usedAsInput) { + if (getOperationFields(program, node).size > 0) { + reportDiagnostic(program, { + code: "operation-fields-ignored-on-input", + format: { model: node.name }, + target: node, + }); + } + const hasVariance = typeUsage.hasInputOperationVariance(node); + const usedByQuery = usage?.has(GraphQLTypeUsage.InputQuery) ?? false; + const usedByMutation = usage?.has(GraphQLTypeUsage.InputMutation) ?? false; + + if (hasVariance) { + const qm = engine.mutateModel( + node, + GraphQLTypeContext.Input, + filters.query, + "query", + "Query", + ); + const mm = engine.mutateModel( + node, + GraphQLTypeContext.Input, + filters.mutation, + "mutation", + "Mutation", + ); + if (qm.mutatedType.properties.size > 0) { + setInputType(program, qm.mutatedType); + pushMutatedModel(qm); + } + if (mm.mutatedType.properties.size > 0) { + setInputType(program, mm.mutatedType); + pushMutatedModel(mm); + } + } else { + const emitted = usedByMutation + ? engine.mutateModel(node, GraphQLTypeContext.Input, filters.mutation, "mutation") + : engine.mutateModel(node, GraphQLTypeContext.Input, filters.query, "query"); + if (emitted.mutatedType.properties.size > 0) { + setInputType(program, emitted.mutatedType); + pushMutatedModel(emitted); + + if (usedByQuery && usedByMutation) { + setInputType( + program, + engine.mutateModel(node, GraphQLTypeContext.Input, filters.query, "query") + .mutatedType, + ); + } + } + } + } + }, + enum: (node: Enum) => { + if (typeUsage.isUnreachable(node)) return; + + const mutation = engine.mutateEnum(node); + mutatedTypes.push(mutation.mutatedType); + }, + scalar: (node: Scalar) => { + if (typeUsage.isUnreachable(node)) return; + // Skip std library scalars and library scalars (TypeSpec.GraphQL.*) + // Std scalars either map to GraphQL built-ins or are handled via property type references + if (isStdScalar(tk, node) || isLibraryScalar(node)) return; + const mutation = engine.mutateScalar(node); + mutatedTypes.push(mutation.mutatedType); + }, + union: (node: Union) => { + if (typeUsage.isUnreachable(node)) return; + + const usage = typeUsage.getUsage(node); + const usedAsOutput = usage?.has(GraphQLTypeUsage.Output) ?? false; + const usedAsInput = usage?.has(GraphQLTypeUsage.Input) ?? false; + + if (usedAsOutput || !usage) { + const mutation = engine.mutateUnion(node, GraphQLTypeContext.Output); + if (mutation.mutatedType.kind === "Union") { + mutatedTypes.push(mutation.mutatedType); + for (const wrapper of mutation.wrapperModels) { + mutatedTypes.push(wrapper); + } + } + } + + if (usedAsInput) { + const usedByMutation = usage?.has(GraphQLTypeUsage.InputMutation) ?? false; + const filter = usedByMutation ? filters.mutation : filters.query; + const opKind = usedByMutation ? "mutation" : "query"; + const mutation = engine.mutateUnion(node, GraphQLTypeContext.Input, filter, opKind); + const mutated = mutation.mutatedType; + if (mutated.kind === "Model") { + setInputType(program, mutated); + mutatedTypes.push(mutated); + } else if (mutated.kind === "Union") { + mutatedTypes.push(mutated); + } + } + }, + operation: (node: Operation) => { + const mutation = engine.mutateOperation(node); + mutatedTypes.push(mutation.mutatedType); + }, + }); + + const seen = new Map(); + for (const type of mutatedTypes) { + if (!("name" in type) || !type.name) continue; + const name = type.name as string; + if (seen.has(name)) { + reportDiagnostic(program, { + code: "type-name-collision", + format: { name }, + target: type, + }); + } else { + seen.set(name, type); + } + } + + return buildTypeGraph(program, tk, mutatedTypes, { + shouldIncludeRef: (type) => { + if (type.kind === "Scalar") { + return !isStdScalar(tk, type) && !isLibraryScalar(type); + } + return true; + }, + }); +} + +function isLibraryScalar(scalar: { + namespace?: { name: string; namespace?: { name: string } }; +}): boolean { + return scalar.namespace?.name === "GraphQL" && scalar.namespace?.namespace?.name === "TypeSpec"; +} diff --git a/packages/graphql/src/mutation-engine/type-graph.ts b/packages/graphql/src/mutation-engine/type-graph.ts new file mode 100644 index 00000000000..40299d6788d --- /dev/null +++ b/packages/graphql/src/mutation-engine/type-graph.ts @@ -0,0 +1,106 @@ +import { isArrayModelType, type Namespace, type Program, type Type } from "@typespec/compiler"; +import type { Typekit } from "@typespec/compiler/typekit"; + +/** + * A self-contained type world — a namespace containing only the mutated types + * for a given stage or schema. Enables `navigateTypesInNamespace` to walk + * the mutated graph, and serves as the inter-stage / inter-emitter contract. + */ +export interface TypeGraph { + readonly globalNamespace: Namespace; +} + +export interface BuildTypeGraphOptions { + /** + * Filter for transitively-discovered types. Return false to exclude a type + * from the graph. Root types (passed directly) are always included. + * Used by renderers to exclude built-in types they handle implicitly. + */ + shouldIncludeRef?: (type: Type) => boolean; +} + +/** + * Package a set of types into a self-contained TypeGraph. + * Adds the given root types and transitively discovers all types they + * reference (through properties, return types, parameters), producing + * a self-contained graph the renderer can resolve without external lookups. + */ +export function buildTypeGraph( + program: Program, + tk: Typekit, + types: Type[], + options?: BuildTypeGraphOptions, +): TypeGraph { + const globalNamespace = tk.type.clone(program.getGlobalNamespaceType()); + tk.type.finishType(globalNamespace); + + globalNamespace.models = new Map(); + globalNamespace.operations = new Map(); + globalNamespace.enums = new Map(); + globalNamespace.unions = new Map(); + globalNamespace.scalars = new Map(); + globalNamespace.interfaces = new Map(); + globalNamespace.namespaces = new Map(); + + const registered = new Set(); + const shouldIncludeRef = options?.shouldIncludeRef ?? (() => true); + + for (const type of types) { + register(globalNamespace, registered, type); + } + + return { globalNamespace }; + + function register(ns: Namespace, registered: Set, type: Type): void { + if (registered.has(type)) return; + registered.add(type); + type.isFinished = true; + + switch (type.kind) { + case "Model": + if (isArrayModelType(type)) return; + type.namespace = ns; + ns.models.set(type.name, type); + for (const prop of type.properties.values()) { + registerRef(ns, registered, prop.type); + } + break; + case "Operation": + type.namespace = ns; + ns.operations.set(type.name, type); + registerRef(ns, registered, type.returnType); + for (const param of type.parameters.properties.values()) { + registerRef(ns, registered, param.type); + } + break; + case "Enum": + type.namespace = ns; + ns.enums.set(type.name, type); + break; + case "Union": + if (!type.name) return; + type.namespace = ns; + ns.unions.set(type.name, type); + for (const variant of type.variants.values()) { + registerRef(ns, registered, variant.type); + } + break; + case "Scalar": + type.namespace = ns; + ns.scalars.set(type.name, type); + break; + case "Interface": + type.namespace = ns; + ns.interfaces.set(type.name, type); + break; + } + } + + function registerRef(ns: Namespace, registered: Set, type: Type): void { + if (type.kind === "Model" && isArrayModelType(type) && type.indexer?.value) { + registerRef(ns, registered, type.indexer.value); + } else if (shouldIncludeRef(type)) { + register(ns, registered, type); + } + } +} diff --git a/packages/graphql/src/tsp-index.ts b/packages/graphql/src/tsp-index.ts new file mode 100644 index 00000000000..a239a7f71c6 --- /dev/null +++ b/packages/graphql/src/tsp-index.ts @@ -0,0 +1,23 @@ +import type { TypeSpecGraphQLDecorators } from "../generated-defs/TypeSpec.GraphQL.js"; +import { $lib } from "./lib.js"; +import { $compose, $graphqlInterface } from "./lib/interface.js"; +import { $operationFields } from "./lib/operation-fields.js"; +import { $mutation, $query, $subscription } from "./lib/operation-kind.js"; +import { $schema } from "./lib/schema.js"; +import { $specifiedBy } from "./lib/specified-by.js"; +import { $onValidate } from "./validate.js"; + +export { $lib, $onValidate }; + +export const $decorators = { + "TypeSpec.GraphQL": { + compose: $compose, + graphqlInterface: $graphqlInterface, + mutation: $mutation, + operationFields: $operationFields, + query: $query, + schema: $schema, + specifiedBy: $specifiedBy, + subscription: $subscription, + } satisfies TypeSpecGraphQLDecorators, +}; diff --git a/packages/graphql/src/type-usage.ts b/packages/graphql/src/type-usage.ts new file mode 100644 index 00000000000..59c9a155443 --- /dev/null +++ b/packages/graphql/src/type-usage.ts @@ -0,0 +1,183 @@ +import { + isArrayModelType, + navigateTypesInNamespace, + type Namespace, + type Operation, + type Program, + type Type, +} from "@typespec/compiler"; +import { getOperationKind, type GraphQLOperationKind } from "./lib/operation-kind.js"; +import { createVisibilityFilters, isPropertyVisible } from "./lib/visibility.js"; + +/** + * GraphQL-specific flags for type usage tracking (input vs output). + */ +export enum GraphQLTypeUsage { + /** Type is used as an input (operation parameter or nested within one) */ + Input = "Input", + /** Type is used as an input to a @query or @subscription operation */ + InputQuery = "InputQuery", + /** Type is used as an input to a @mutation operation */ + InputMutation = "InputMutation", + /** Type is used as an output (operation return type or nested within one) */ + Output = "Output", +} + +export interface TypeUsageResolver { + getUsage(type: Type): Set | undefined; + isUnreachable(type: Type): boolean; + /** + * Returns true if the model is used by both @query and @mutation operations + * AND the visibility filters produce different property sets for each context. + * When true, two separate input types are needed (e.g., UserQueryInput + UserMutationInput). + */ + hasInputOperationVariance(type: Type): boolean; +} + +export function resolveTypeUsage( + program: Program, + root: Namespace, + omitUnreachableTypes: boolean, +): TypeUsageResolver { + const reachableTypes = new Set(); + const usages = new Map>(); + const inputOperationVariance = new Set(); + + addUsagesInNamespace(program, root, reachableTypes, usages); + + // Pre-compute which models need split input types + const filters = createVisibilityFilters(program); + for (const [type, usage] of usages) { + if ( + type.kind === "Model" && + usage.has(GraphQLTypeUsage.InputQuery) && + usage.has(GraphQLTypeUsage.InputMutation) + ) { + const queryVisible = new Set(); + const mutationVisible = new Set(); + for (const prop of type.properties.values()) { + if (isPropertyVisible(program, prop, filters.query)) queryVisible.add(prop.name); + if (isPropertyVisible(program, prop, filters.mutation)) mutationVisible.add(prop.name); + } + if ( + queryVisible.size !== mutationVisible.size || + ![...queryVisible].every((k) => mutationVisible.has(k)) + ) { + inputOperationVariance.add(type); + } + } + } + + if (!omitUnreachableTypes) { + const markReachable = (type: Type) => { + reachableTypes.add(type); + }; + navigateTypesInNamespace(root, { + model: markReachable, + scalar: markReachable, + enum: markReachable, + union: markReachable, + }); + } + + return { + getUsage: (type: Type) => usages.get(type), + isUnreachable: (type: Type) => !reachableTypes.has(type), + hasInputOperationVariance: (type: Type) => inputOperationVariance.has(type), + }; +} + +function trackUsage( + reachableTypes: Set, + usages: Map>, + type: Type, + usage: GraphQLTypeUsage, +) { + reachableTypes.add(type); + const existing = usages.get(type) ?? new Set(); + existing.add(usage); + usages.set(type, existing); +} + +function addUsagesInNamespace( + program: Program, + namespace: Namespace, + reachableTypes: Set, + usages: Map>, +): void { + for (const subNamespace of namespace.namespaces.values()) { + addUsagesInNamespace(program, subNamespace, reachableTypes, usages); + } + for (const iface of namespace.interfaces.values()) { + for (const operation of iface.operations.values()) { + addUsagesFromOperation(program, operation, reachableTypes, usages); + } + } + for (const operation of namespace.operations.values()) { + addUsagesFromOperation(program, operation, reachableTypes, usages); + } +} + +function inputUsageForKind(kind: GraphQLOperationKind | undefined): GraphQLTypeUsage { + if (kind === "Query" || kind === "Subscription") return GraphQLTypeUsage.InputQuery; + return GraphQLTypeUsage.InputMutation; +} + +function addUsagesFromOperation( + program: Program, + operation: Operation, + reachableTypes: Set, + usages: Map>, +): void { + const kind = getOperationKind(program, operation); + const inputUsage = inputUsageForKind(kind); + for (const param of operation.parameters.properties.values()) { + navigateReferencedTypes(param.type, GraphQLTypeUsage.Input, reachableTypes, usages); + navigateReferencedTypes(param.type, inputUsage, reachableTypes, usages); + } + navigateReferencedTypes(operation.returnType, GraphQLTypeUsage.Output, reachableTypes, usages); +} + +function navigateReferencedTypes( + type: Type, + usage: GraphQLTypeUsage, + reachableTypes: Set, + usages: Map>, + visited: Set = new Set(), +): void { + if (visited.has(type)) return; + visited.add(type); + + switch (type.kind) { + case "Model": + if (isArrayModelType(type)) { + if (type.indexer?.value) { + navigateReferencedTypes(type.indexer.value, usage, reachableTypes, usages, visited); + } + } else { + trackUsage(reachableTypes, usages, type, usage); + for (const prop of type.properties.values()) { + navigateReferencedTypes(prop.type, usage, reachableTypes, usages, visited); + } + if (type.baseModel) { + navigateReferencedTypes(type.baseModel, usage, reachableTypes, usages, visited); + } + } + break; + + case "Union": + trackUsage(reachableTypes, usages, type, usage); + for (const variant of type.variants.values()) { + navigateReferencedTypes(variant.type, usage, reachableTypes, usages, visited); + } + break; + + case "Scalar": + case "Enum": + trackUsage(reachableTypes, usages, type, usage); + break; + + default: + break; + } +} diff --git a/packages/graphql/src/validate.ts b/packages/graphql/src/validate.ts new file mode 100644 index 00000000000..b93f2d35956 --- /dev/null +++ b/packages/graphql/src/validate.ts @@ -0,0 +1,148 @@ +import { + type DiagnosticTarget, + type Enum, + isNullType, + type Model, + type Namespace, + navigateTypesInNamespace, + type Operation, + type Program, + type Union, +} from "@typespec/compiler"; +import { reportDiagnostic } from "./lib.js"; +import { getOperationKind } from "./lib/operation-kind.js"; +import { listSchemas } from "./lib/schema.js"; + +export function $onValidate(program: Program) { + const schemas = listSchemas(program); + + // Only validate if there are explicit @schema decorators + // Tests and other usages without @schema should not trigger validation warnings + if (schemas.length === 0) { + return; + } + + for (const schema of schemas) { + validateSchema(program, schema.type); + } +} + +function validateSchema(program: Program, ns: Namespace) { + let hasGraphQLOps = false; + + navigateTypesInNamespace(ns, { + operation(op) { + if (getOperationKind(program, op) !== undefined) { + hasGraphQLOps = true; + } + validateOperation(program, op); + }, + model(model) { + validateModel(program, model); + }, + enum(enumType) { + validateEnum(program, enumType); + }, + union(unionType) { + validateUnion(program, unionType); + }, + }); + + if (!hasGraphQLOps) { + reportDiagnostic(program, { + code: "empty-schema", + target: ns, + }); + } +} + +/** + * GraphQL spec: Names must not begin with "__" (two underscores). + * https://spec.graphql.org/September2025/#sec-Names.Reserved-Names + */ +function validateReservedName(program: Program, name: string, target: DiagnosticTarget) { + if (name.startsWith("__")) { + reportDiagnostic(program, { + code: "reserved-name", + format: { name }, + target, + }); + } +} + +/** + * Validate model: check type name and property names for reserved prefix. + */ +function validateModel(program: Program, model: Model) { + // Check model name + if (model.name) { + validateReservedName(program, model.name, model); + } + + // Check property names + for (const prop of model.properties.values()) { + validateReservedName(program, prop.name, prop); + } +} + +/** + * Validate operation: check operation name and parameter names for reserved prefix. + */ +function validateOperation(program: Program, op: Operation) { + // Validate operation name (becomes a GraphQL field name on Query/Mutation/Subscription) + validateReservedName(program, op.name, op); + + // Validate parameter names + for (const param of op.parameters.properties.values()) { + validateReservedName(program, param.name, param); + } +} + +/** + * Validate union: check type name for reserved prefix and empty unions. + * https://spec.graphql.org/September2025/#sec-Unions + */ +function validateUnion(program: Program, unionType: Union) { + // Only validate named unions (not anonymous unions like `string | null`) + if (!unionType.name) { + return; + } + + validateReservedName(program, unionType.name, unionType); + + // Check for empty union: no variants, or all variants are null. + // GraphQL unions must have at least one member type. + const nonNullVariants = [...unionType.variants.values()].filter((v) => !isNullType(v.type)); + + if (nonNullVariants.length === 0) { + reportDiagnostic(program, { + code: "empty-union", + target: unionType, + }); + } +} + +/** + * GraphQL spec: Enums must define at least one value. + * https://spec.graphql.org/September2025/#sec-Enums + */ +function validateEnum(program: Program, enumType: Enum) { + // Check enum name + if (enumType.name) { + validateReservedName(program, enumType.name, enumType); + } + + // Check enum member names + for (const member of enumType.members.values()) { + validateReservedName(program, member.name, member); + } + + // Check for empty enum + if (enumType.members.size === 0) { + reportDiagnostic(program, { + code: "empty-enum", + format: { name: enumType.name }, + target: enumType, + }); + } +} diff --git a/packages/graphql/test/components/enum-type.test.tsx b/packages/graphql/test/components/enum-type.test.tsx new file mode 100644 index 00000000000..af996b1fd47 --- /dev/null +++ b/packages/graphql/test/components/enum-type.test.tsx @@ -0,0 +1,98 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { EnumType } from "../../src/components/types/index.js"; +import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; +import { renderToSDL } from "./test-utils.js"; + +describe("EnumType component", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("renders a basic enum", async () => { + const { Color } = await tester.compile(t.code`enum ${t.enum("Color")} { Red, Green, Blue }`); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(Color).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain("enum Color"); + expect(sdl).toContain("RED"); + expect(sdl).toContain("GREEN"); + expect(sdl).toContain("BLUE"); + }); + + it("renders enum with doc comment as description", async () => { + const { Role } = await tester.compile( + t.code` + /** The role a user can have */ + enum ${t.enum("Role")} { Admin, User } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(Role).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain('"The role a user can have"'); + expect(sdl).toContain("enum Role"); + }); + + it("renders enum with member descriptions", async () => { + const { Status } = await tester.compile( + t.code` + enum ${t.enum("Status")} { + /** Currently active */ + Active, + /** No longer active */ + Inactive, + } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(Status).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain('"Currently active"'); + expect(sdl).toContain('"No longer active"'); + }); + + it("renders enum with deprecated members", async () => { + const { Status } = await tester.compile( + t.code` + enum ${t.enum("Status")} { + Active, + #deprecated "use Active instead" + Legacy, + } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(Status).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain("@deprecated"); + expect(sdl).toContain("use Active instead"); + }); + + it("renders enum with mutation-engine-sanitized member names", async () => { + const { E } = await tester.compile(t.code`enum ${t.enum("E")} { \`$val1$\`, \`val-2\` }`); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(E).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + // Mutation engine: sanitize → CONSTANT_CASE + expect(sdl).toContain("_VAL_1"); + expect(sdl).toContain("VAL_2"); + }); +}); diff --git a/packages/graphql/test/components/input-type.test.tsx b/packages/graphql/test/components/input-type.test.tsx new file mode 100644 index 00000000000..923535b0228 --- /dev/null +++ b/packages/graphql/test/components/input-type.test.tsx @@ -0,0 +1,81 @@ +import { type Model } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { InputType } from "../../src/components/types/index.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; +import { renderToSDL } from "./test-utils.js"; + +describe("InputType component", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("renders a basic input object type", async () => { + const { Book } = await tester.compile( + t.code`model ${t.model("Book")} { title: string; year: int32; }`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Book, GraphQLTypeContext.Input).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toMatch(/input BookInput \{/); + expect(sdl).toContain("title: String!"); + expect(sdl).toContain("year: Int!"); + }); + + it("renders input type with doc comment", async () => { + const { Book } = await tester.compile( + t.code` + /** Data for creating a book */ + model ${t.model("Book")} { title: string; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Book, GraphQLTypeContext.Input).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain('"Data for creating a book"'); + expect(sdl).toMatch(/input BookInput \{/); + }); + + it("renders oneOf input type with @oneOf directive", async () => { + const { SearchBy } = await tester.compile( + t.code` + union ${t.union("SearchBy")} { byName: string; byId: int32; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutation = engine.mutateUnion(SearchBy, GraphQLTypeContext.Input); + // In input context, union becomes a @oneOf Model + const mutated = mutation.mutatedType as Model; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toMatch(/input SearchByInput @oneOf \{/); + }); + + it("renders input type with optional fields", async () => { + const { Filter } = await tester.compile( + t.code`model ${t.model("Filter")} { name?: string; limit?: int32; }`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Filter, GraphQLTypeContext.Input).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + // Optional fields are nullable (no !) + expect(sdl).toContain("name: String"); + expect(sdl).not.toContain("name: String!"); + }); +}); diff --git a/packages/graphql/test/components/interface-type.test.tsx b/packages/graphql/test/components/interface-type.test.tsx new file mode 100644 index 00000000000..875191a6165 --- /dev/null +++ b/packages/graphql/test/components/interface-type.test.tsx @@ -0,0 +1,60 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { InterfaceType } from "../../src/components/types/index.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; +import { renderToSDL } from "./test-utils.js"; + +describe("InterfaceType component", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("renders a basic interface type", async () => { + const { Node } = await tester.compile( + t.code`@graphqlInterface model ${t.model("Node")} { id: string; }`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Node, GraphQLTypeContext.Interface).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toMatch(/interface NodeInterface \{/); + expect(sdl).toContain("id: String!"); + }); + + it("renders interfaceOnly interface without suffix", async () => { + const { Node } = await tester.compile( + t.code`@graphqlInterface(#{interfaceOnly: true}) model ${t.model("Node")} { id: string; }`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Node, GraphQLTypeContext.Interface).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toMatch(/interface Node \{/); + expect(sdl).not.toContain("NodeInterface"); + }); + + it("renders interface with doc comment", async () => { + const { Node } = await tester.compile( + t.code` + /** A uniquely identifiable entity */ + @graphqlInterface model ${t.model("Node")} { id: string; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Node, GraphQLTypeContext.Interface).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain('"A uniquely identifiable entity"'); + }); +}); diff --git a/packages/graphql/test/components/object-type.test.tsx b/packages/graphql/test/components/object-type.test.tsx new file mode 100644 index 00000000000..a7f923e04ba --- /dev/null +++ b/packages/graphql/test/components/object-type.test.tsx @@ -0,0 +1,88 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { InterfaceType, ObjectType } from "../../src/components/types/index.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; +import { renderToSDL } from "./test-utils.js"; + +describe("ObjectType component", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("renders a basic object type with fields", async () => { + const { Book } = await tester.compile( + t.code`model ${t.model("Book")} { title: string; year: int32; }`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Book, GraphQLTypeContext.Output).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toMatch(/type Book \{/); + expect(sdl).toContain("title: String!"); + expect(sdl).toContain("year: Int!"); + }); + + it("renders object type with doc comment", async () => { + const { Book } = await tester.compile( + t.code` + /** A published book */ + model ${t.model("Book")} { title: string; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Book, GraphQLTypeContext.Output).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain('"A published book"'); + expect(sdl).toMatch(/type Book \{/); + }); + + it("renders object type with optional fields as nullable", async () => { + const { User } = await tester.compile( + t.code`model ${t.model("User")} { name: string; nickname?: string; }`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(User, GraphQLTypeContext.Output).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain("name: String!"); + expect(sdl).toContain("nickname: String"); + // nickname should NOT have ! (it's optional/nullable) + expect(sdl).not.toContain("nickname: String!"); + }); + + it("renders object type implementing interfaces", async () => { + const { Cat, Animal } = await tester.compile( + t.code` + @graphqlInterface model ${t.model("Animal")} { name: string; } + @compose(Animal) + model ${t.model("Cat")} { name: string; breed: string; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutatedCat = engine.mutateModel(Cat, GraphQLTypeContext.Output).mutatedType; + const mutatedAnimal = engine.mutateModel(Animal, GraphQLTypeContext.Interface).mutatedType; + + const sdl = renderToSDL( + tester.program, + <> + + + , + ); + + expect(sdl).toMatch(/type Cat implements AnimalInterface \{/); + }); +}); diff --git a/packages/graphql/test/components/scalar-type.test.tsx b/packages/graphql/test/components/scalar-type.test.tsx new file mode 100644 index 00000000000..f8db8fa4f9a --- /dev/null +++ b/packages/graphql/test/components/scalar-type.test.tsx @@ -0,0 +1,79 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { ScalarType } from "../../src/components/types/index.js"; +import { getSpecifiedBy } from "../../src/lib/specified-by.js"; +import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; +import { renderToSDL } from "./test-utils.js"; + +describe("ScalarType component", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("renders a custom scalar", async () => { + const { DateTime } = await tester.compile( + t.code`scalar ${t.scalar("DateTime")} extends string;`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateScalar(DateTime).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain("scalar DateTime"); + }); + + it("renders a scalar with doc comment description", async () => { + const { JSON } = await tester.compile( + t.code` + /** Arbitrary JSON blob */ + scalar ${t.scalar("JSON")} extends string; + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateScalar(JSON).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain('"Arbitrary JSON blob"'); + expect(sdl).toContain("scalar JSON"); + }); + + it("renders a scalar with @specifiedBy", async () => { + const { MyScalar } = await tester.compile( + t.code` + @specifiedBy("https://example.com/spec") + scalar ${t.scalar("MyScalar")} extends string; + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateScalar(MyScalar).mutatedType; + const specUrl = getSpecifiedBy(tester.program, mutated); + + const sdl = renderToSDL( + tester.program, + , + ); + + expect(sdl).toContain("@specifiedBy"); + expect(sdl).toContain("https://example.com/spec"); + }); + + it("renders a scalar without @specifiedBy when not present", async () => { + const { MyScalar } = await tester.compile( + t.code`scalar ${t.scalar("MyScalar")} extends string;`, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateScalar(MyScalar).mutatedType; + + const sdl = renderToSDL(tester.program, ); + + expect(sdl).toContain("scalar MyScalar"); + expect(sdl).not.toContain("@specifiedBy"); + }); +}); diff --git a/packages/graphql/test/components/test-utils.tsx b/packages/graphql/test/components/test-utils.tsx new file mode 100644 index 00000000000..d6e1e6e19b1 --- /dev/null +++ b/packages/graphql/test/components/test-utils.tsx @@ -0,0 +1,33 @@ +import { type Children } from "@alloy-js/core"; +import * as gql from "@pinterest/alloy-graphql"; +import { renderSchema } from "@pinterest/alloy-graphql"; +import type { Program } from "@typespec/compiler"; +import { TspContext } from "@typespec/emitter-framework"; +import { printSchema } from "graphql"; +import { GraphQLSchemaContext } from "../../src/context/index.js"; +import type { TypeGraph } from "../../src/mutation-engine/type-graph.js"; + +/** + * Render GraphQL components in isolation and return SDL string. + * Wraps children in required context providers and adds a placeholder Query + * (graphql-js requires at least one query field). + */ +export function renderToSDL(program: Program, children: Children): string { + const typeGraph: TypeGraph = { + globalNamespace: program.getGlobalNamespaceType(), + }; + + const schema = renderSchema( + + + {children} + + + + + , + { namePolicy: null }, + ); + + return printSchema(schema); +} diff --git a/packages/graphql/test/components/union-type.test.tsx b/packages/graphql/test/components/union-type.test.tsx new file mode 100644 index 00000000000..b00c5b373ad --- /dev/null +++ b/packages/graphql/test/components/union-type.test.tsx @@ -0,0 +1,140 @@ +import * as gql from "@pinterest/alloy-graphql"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { UnionType, type GraphQLUnion } from "../../src/components/types/index.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; +import { renderToSDL } from "./test-utils.js"; + +describe("UnionType component", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("renders a union of model types", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + const mutatedUnion = mutation.mutatedType as GraphQLUnion; + + // Union members must be registered for graphql-js to validate the schema + const sdl = renderToSDL( + tester.program, + <> + + + + + + + + , + ); + + expect(sdl).toContain("union Pet = Cat | Dog"); + }); + + it("renders a union with doc comment description", async () => { + const { Result } = await tester.compile( + t.code` + model ${t.model("Success")} { value: string; } + model ${t.model("Failure")} { message: string; } + /** The result of an operation */ + union ${t.union("Result")} { success: Success; failure: Failure; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutation = engine.mutateUnion(Result, GraphQLTypeContext.Output); + const mutatedUnion = mutation.mutatedType as GraphQLUnion; + + const sdl = renderToSDL( + tester.program, + <> + + + + + + + + , + ); + + expect(sdl).toContain('"The result of an operation"'); + expect(sdl).toContain("union Result = Success | Failure"); + }); + + it("references wrapper model names for scalar variants", async () => { + const { Mixed } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Mixed")} { cat: Cat; text: string; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutation = engine.mutateUnion(Mixed, GraphQLTypeContext.Output); + const mutatedUnion = mutation.mutatedType as GraphQLUnion; + + // Register the wrapper model and Cat so graphql-js can validate + const sdl = renderToSDL( + tester.program, + <> + + + + + + + + , + ); + + expect(sdl).toContain("union Mixed = Cat | MixedTextUnionVariant"); + }); + + it("renders a union with three model members", async () => { + const { Shape } = await tester.compile( + t.code` + model ${t.model("Circle")} { radius: float32; } + model ${t.model("Square")} { side: float32; } + model ${t.model("Triangle")} { base: float32; } + union ${t.union("Shape")} { circle: Circle; square: Square; triangle: Triangle; } + `, + ); + + const engine = createGraphQLMutationEngine(tester.program); + const mutation = engine.mutateUnion(Shape, GraphQLTypeContext.Output); + const mutatedUnion = mutation.mutatedType as GraphQLUnion; + + const sdl = renderToSDL( + tester.program, + <> + + + + + + + + + + + , + ); + + expect(sdl).toContain("union Shape = Circle | Square | Triangle"); + }); +}); diff --git a/packages/graphql/test/crash-repro.test.ts b/packages/graphql/test/crash-repro.test.ts new file mode 100644 index 00000000000..2e1c8b9fdd0 --- /dev/null +++ b/packages/graphql/test/crash-repro.test.ts @@ -0,0 +1,148 @@ +import { describe, expect, it } from "vitest"; +import { emitSingleSchemaWithDiagnostics } from "./test-host.js"; + +describe("crash: Record types", () => { + it("Record should emit as scalar", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { + name: string; + metadata: Record; + } + @query op getUser(): User; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("type User"); + }); +}); + +describe("crash: Generics", () => { + it("instantiated generic model should emit", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model PagedResponse { + data: T[]; + totalCount: int32; + hasMore: boolean; + } + model User { name: string; } + @query op getUsers(): PagedResponse; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("type Query"); + }); +}); + +describe("crash: empty input (all fields visibility-filtered)", () => { + it("model with all read-only fields used as mutation input", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model ServerGenerated { + @visibility(Lifecycle.Read) + requestId: string; + @visibility(Lifecycle.Read) + timestamp: string; + } + @query op getInfo(): ServerGenerated; + @mutation op trigger(info: ServerGenerated): boolean; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("type Query"); + }); +}); + +describe("crash: union as input", () => { + it("union used as mutation parameter", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Cat { name: string; } + model Dog { breed: string; } + union Pet { cat: Cat, dog: Dog } + @query op getPets(): Pet[]; + @mutation op adoptPet(pet: Pet): Cat | Dog; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("type Query"); + }); + + it("union as mutation input with visibility-filtered variant types", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Create, Lifecycle.Update) + password: string; + + name: string; + } + model Admin { + @visibility(Lifecycle.Read) + id: string; + + role: string; + } + union Entity { user: User, admin: Admin } + @query op getEntities(): Entity[]; + @mutation op createEntity(input: Entity): Entity; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "union Entity = User | Admin + + type User { + id: String! + name: String! + } + + input UserInput { + password: String! + name: String! + } + + type Admin { + id: String! + role: String! + } + + input AdminInput { + role: String! + } + + input EntityInput @oneOf { + user: UserInput + admin: AdminInput + } + + type Query { + getEntities: [Entity!]! + } + + type Mutation { + createEntity(input: EntityInput!): Entity! + }" + `); + }); +}); + +describe("crash: nested generics", () => { + it("nested generic BatchResult with PagedResponse[]", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model PagedResponse { data: T[]; totalCount: int32; } + model BatchResult { pages: PagedResponse[]; batchId: string; } + model Post { title: string; } + @query op getBatch(): BatchResult; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("PagedResponseOfPost"); + expect(result.graphQLOutput).toContain("BatchResultOfPost"); + }); +}); diff --git a/packages/graphql/test/e2e-manual/TEST_COVERAGE.md b/packages/graphql/test/e2e-manual/TEST_COVERAGE.md new file mode 100644 index 00000000000..239b349ddca --- /dev/null +++ b/packages/graphql/test/e2e-manual/TEST_COVERAGE.md @@ -0,0 +1,161 @@ +# E2E Manual Test Coverage + +Manual validation of the GraphQL emitter against all TypeSpec patterns and GraphQL-specific features. +Each schema is emitted and the SDL output is verified for correctness. + +## Running + +```bash +export PATH="$HOME/.npm-global/bin:$PATH" +cd ~/code/typespec + +# Build (required after code changes) +npx -y node@22 $HOME/.npm-global/bin/pnpm --filter @typespec/graphql run build + +# Run e2e manual tests +npx -y node@22 $HOME/.npm-global/bin/pnpm --filter @typespec/graphql exec vitest run test/e2e-manual/emit.test.ts + +# SDL output files are written to test/e2e-manual/output/ +``` + +## Schema 01-core: Content Platform + +Patterns: operations, models, scalars, enums, interfaces, unions, nullability, spread, extends, deprecation, circular refs, input/output split, Records. + +| # | Pattern | Result | +| --- | --------------------------------------------------------------------------------------------------------- | -------------------------- | +| 1 | `@query`, `@mutation`, `@subscription` | Correct | +| 2 | `@graphqlInterface` (default) → `ReactableInterface` suffix | Correct | +| 3 | `@graphqlInterface(#{interfaceOnly: true})` → no suffix (`Node`, `Connection`) | Correct | +| 4 | `@compose(...)` single + multi (`Article implements Node`, `Review implements Node & ReactableInterface`) | Correct | +| 6 | `@specifiedBy(url)` on scalars | Correct | +| 7 | `GraphQL.ID` → `ID!` | Correct | +| 8 | Model in both input + output (`User` → `type User` + `input UserInput`) | Correct | +| 9 | Input-only model (`CreatePostInput`) | Correct | +| 10 | Nested input models (`CreateArticleInput` → `CreateAuthorInput` → `CreateReviewPolicyInput`) | Correct | +| 11 | Named union (`SearchResult`) | Correct | +| 12 | Scalar variant in union (`NotificationContentMessageUnionVariant`) | Correct | +| 14 | Anonymous union return → auto-named (`GetContentUnion`) | Correct | +| 15 | Anonymous union property → auto-named (`FeedItemContentUnion`) | Correct | +| 19 | `extends` (field flattening) | Correct (fixed in PR #101) | +| 20 | `...spread` (Timestamps/Auditable fields on User) | Correct | +| 21 | `Record` → `scalar RecordOfString` | Correct | +| 22 | `Record` → `scalar RecordOfMetric` | Correct | +| 25 | Alias as union (`Publishable = Post \| Article`) | Correct | +| 26 | Simple enum → CONSTANT_CASE | Correct | +| 27 | Enum with string values (`IMAGE_JPEG`) | Correct | +| 28 | `#deprecated` member → `@deprecated(reason: "...")` | Correct | +| 29 | Custom scalar (`DateTime`, `URL`, `Long`) | Correct | +| 30 | `field: T \| null` → no `!` | Correct | +| 31 | `field?: T` → no `!` | Correct | +| 33 | `T[] \| null` → `[T!]` | Correct | +| 34 | `(T \| null)[]` → `[T]!` | Correct | +| 35 | `(T \| null)[] \| null` → `[T]` | Correct | +| 36 | `field?: T[]` → `[T!]` (no outer `!`) | Correct | +| 37 | TypeSpec `interface` keyword → prefixed ops (`boardOpsGetBoard`) | Correct | +| 39 | Self-reference (`Comment.replies`) | Correct | +| 40 | Mutual reference (`User↔Post`) | Correct | +| 45 | All-optional model (`PostFilter`) | Correct | +| 54 | Deprecated field (`body @deprecated`) | Correct | +| 55 | Deprecated operation (`publishDraft @deprecated`) | Correct | +| 56 | Interface inheritance chain (`PagedConnection implements Connection`) | Correct | +| 59 | extends + spread combined | Correct (fixed in PR #101) | +| 60 | Circular input model (`CreateCommentInput.replies`) | Correct | +| 69 | Single-variant union → unwrapped (`getWrapped: Article!`) | Correct | + +## Schema 02-generics: Template Models + +Patterns: template instantiation, nested generics, recursive generics, generic input. + +| # | Pattern | Result | +| --- | --------------------------------------------------------------------- | ------- | +| 16 | Template model `` → `PagedResponseOfUser` | Correct | +| 17 | Nested generic → `BatchResultOfPost` references `PagedResponseOfPost` | Correct | +| 57 | Generic as input → `CreateInputOfTagInput` | Correct | +| 72 | Recursive generic → `TreeNodeOfPost.children: [TreeNodeOfPost!]!` | Correct | + +## Schema 03-visibility: Visibility Filtering + +Patterns: read-only exclusion, create-only exclusion, default visibility, empty input pruning, query/mutation split. + +| # | Pattern | Result | +| --- | ------------------------------------------------------------------------------------------ | ------- | +| 41 | `@visibility(Lifecycle.Read)` excluded from input (`AccountInput` has no `id`/`createdAt`) | Correct | +| 42 | `@visibility(Lifecycle.Create)` excluded from output (`Account` has no `password`) | Correct | +| 43 | Default (no decorator) → both contexts (`username`, `displayName`) | Correct | +| 44 | All-read-only model as mutation input → param pruned (`triggerJob` has no `info`) | Correct | +| — | Query/Mutation input split → `UserProfileQueryInput` vs `UserProfileMutationInput` | Correct | + +## Schema 04-records: Record Types + +Patterns: Record, Record, Record, Record. + +| # | Pattern | Result | +| --- | -------------------------------------------------------------------------- | ------- | +| 21 | `Record` → `scalar RecordOfString` | Correct | +| 22 | `Record` → `scalar RecordOfMetric` | Correct | +| 23 | `Record` → no fields contributed (StrictConfig has only own fields) | Correct | +| 24 | `Record` nullable → `rawData: RecordOfUnknown` | Correct | + +## Schema 05-union-input: Union as Input + +Patterns: union in mutation parameter → @oneOf input object. + +| # | Pattern | Result | +| ----- | ---------------------------------------------------------------------------------- | ------- | +| 49/67 | Union as mutation param → `input PetInput @oneOf { cat: CatInput, dog: DogInput }` | Correct | + +## Schema 06-descriptions: Documentation and Deprecation + +Patterns: @doc on types/fields/params, #deprecated directive. + +| # | Pattern | Result | +| --- | ----------------------------------------------------- | ------- | +| 52 | `@doc` / `/** */` on fields → field descriptions | Correct | +| 53 | `@doc` on operations → query/mutation descriptions | Correct | +| 54 | `#deprecated` on field → `@deprecated(reason: "...")` | Correct | +| — | `@doc` on parameters → arg descriptions | Correct | + +## Schema 07-opfields: @operationFields with Visibility + +Patterns: operation fields on models, excluded from input types, interaction with visibility and query/mutation split. + +| # | Pattern | Result | +| --- | ----------------------------------------------------------------------- | ------- | +| 5 | `@operationFields(op1, op2)` → fields with args on output type | Correct | +| — | Operation fields excluded from input types | Correct | +| — | Warning emitted when @operationFields model used as input | Correct | +| — | @operationFields + visibility filtering (read-only excluded from input) | Correct | +| — | @operationFields + query/mutation input split | Correct | + +## Schema 08-gaps: Remaining Patterns + +Patterns: optional+nullable, constrained generic. + +| # | Pattern | Result | +| --- | --------------------------------------------------------------- | ------- | +| 18 | Constrained generic `` → resolves to `String` | Correct | +| 32 | `field?: T \| null` → no `!` | Correct | + +## Schema 09-nested-empty: Visibility-Filtered Empty Model + +Edge case: model with property whose type is fully visibility-filtered. + +| # | Pattern | Result | +| --- | -------------------------------------------- | ------------------------------------------------- | +| — | Nested empty model from visibility filtering | Correct — replaced with scalar (fixed in PR #102) | + +## Not Tested + +| # | Pattern | Reason | +| --- | ------------------------- | ----------------------------------------------------- | +| 13 | Union flattening (spread) | TypeSpec union spread `...Union` syntax not supported | +| 38 | Generic interface extends | Not included (low priority) | + +## Known Bugs + +| Ticket | Summary | Status | +| -------- | ------------------------------------------------------------------------------------------------ | --------------- | +| API-5278 | Record scalars duplicated for input/output context (`RecordOfString` + `RecordOfStringInput`) | Open | +| API-5279 | Model `extends` does not flatten base model fields into child type | Fixed (PR #101) | +| API-5280 | Emitter crashes when nested model property type is fully visibility-filtered to empty | Fixed (PR #102) | diff --git a/packages/graphql/test/e2e-manual/emit.test.ts b/packages/graphql/test/e2e-manual/emit.test.ts new file mode 100644 index 00000000000..176ba25005d --- /dev/null +++ b/packages/graphql/test/e2e-manual/emit.test.ts @@ -0,0 +1,550 @@ +import { mkdirSync, writeFileSync } from "fs"; +import { join } from "path"; +import { describe, expect, it } from "vitest"; +import { EmitterTester } from "../test-host.js"; + +const outputDir = join(import.meta.dirname, "output"); +mkdirSync(outputDir, { recursive: true }); + +async function emitSchema(name: string, code: string) { + const [result, diagnostics] = await EmitterTester.compileAndDiagnose(code, { + compilerOptions: { + options: { "@typespec/graphql": { "output-file": "schema.graphql" } }, + }, + }); + const sdl = result.outputs["schema.graphql"] ?? ""; + const errors = diagnostics.filter((d) => d.severity === "error"); + const warnings = diagnostics.filter((d) => d.severity === "warning"); + + writeFileSync(join(outputDir, `${name}.graphql`), sdl); + if (diagnostics.length) { + writeFileSync( + join(outputDir, `${name}.diagnostics.txt`), + diagnostics.map((d) => `${d.severity}: [${d.code}] ${d.message}`).join("\n"), + ); + } + + // eslint-disable-next-line no-console + console.log( + `${name}.graphql: ${sdl.split("\n").length} lines | ${errors.length} errors, ${warnings.length} warnings`, + ); + // eslint-disable-next-line no-console + if (errors.length) console.log(" ERRORS:", errors.map((d) => d.message).join("; ")); + return { sdl, diagnostics, errors, warnings }; +} + +// ============================================================================= +// Schema 1: Core — operations, models, scalars, enums, interfaces, unions +// Patterns: #1-15, #19-20, #25-36, #39-40, #45, #54-55, #59 +// ============================================================================= +describe("schema: core content platform", () => { + it("emits all core patterns", async () => { + const { sdl, errors } = await emitSchema( + "01-core", + ` + @schema(#{ name: "core" }) + namespace Core { + scalar DateTime extends utcDateTime; + @specifiedBy("https://tools.ietf.org/html/rfc3986") + scalar URL extends url; + @specifiedBy("https://spec.graphql.org/draft/#sec-Long") + scalar Long extends int64; + + enum Role { Admin, Moderator, Member, + #deprecated "use Member" + Viewer, + } + enum ContentStatus { Draft, Published, Archived, + #deprecated "use Archived" + SoftDeleted, + } + enum SortOrder { Ascending, Descending } + enum MimeType { ImageJpeg: "image/jpeg", ImagePng: "image/png", ImageWebp: "image/webp" } + + @graphqlInterface(#{interfaceOnly: true}) + model Node { id: GraphQL.ID; } + + @graphqlInterface(#{interfaceOnly: true}) + model Connection { totalCount: int32; hasNextPage: boolean; } + + @graphqlInterface + model Reactable { likeCount: int32; dislikeCount: int32; } + + @compose(Node) + model Article { ...Node; title: string; slug: string; content: string; } + + @compose(Node, Reactable) + model Review { ...Node; ...Reactable; rating: int32; text: string; reviewer: User; } + + @graphqlInterface(#{interfaceOnly: true}) + @compose(Connection) + model PagedConnection { ...Connection; pageSize: int32; currentPage: int32; } + + @compose(PagedConnection) + model ReviewConnection { ...PagedConnection; reviews: Review[]; averageRating: float32; } + + model Timestamps { createdAt: DateTime; updatedAt: DateTime; } + model Auditable { createdBy: string; lastModifiedBy: string; } + + /** A user on the platform */ + model User { + id: GraphQL.ID; + /** Display name */ + name: string; + email: string; + bio?: string; + role: Role; + avatarUrl?: URL; + followers: User[]; + following: User[]; + posts: Post[]; + phoneNumber?: string | null; + previousEmails: string[] | null; + recentSearches: (string | null)[]; + drafts: (Post | null)[] | null; + bookmarkedPostIds?: string[]; + metadata: Record; + ...Timestamps; + ...Auditable; + } + + /** A content post */ + model Post { + id: GraphQL.ID; + title: string; + #deprecated "use contentBody" + body?: string; + contentBody: string; + status: ContentStatus; + publishedAt?: DateTime; + viewCount: Long; + author: Author; + tags: Tag[]; + comments: Comment[]; + media: MediaAttachment[]; + engagement: Record; + ...Timestamps; + } + + model Author { user: User; penName?: string; } + model Comment { id: GraphQL.ID; text: string; author: User; post: Post; replies: Comment[]; parentComment?: Comment; ...Timestamps; } + model Tag { id: GraphQL.ID; name: string; slug: string; postCount: int32; } + model MediaAttachment { id: GraphQL.ID; url: URL; mimeType: MimeType; altText?: string; width?: int32; height?: int32; } + model Metric { count: Long; lastUpdated: DateTime; } + model PostFilter { authorId?: string; status?: ContentStatus; tag?: string; sortOrder?: SortOrder; } + model AuditedComment extends Timestamps { ...Auditable; commentId: GraphQL.ID; action: string; reason?: string; } + model Board { id: GraphQL.ID; name: string; description?: string; posts: Post[]; owner: User; } + + union SearchResult { user: User, post: Post, tag: Tag } + union NotificationContent { post: Post, comment: Comment, message: string } + model FeedItem { content: Article | Post | Review; relevanceScore: float32; reason: string; } + alias Publishable = Post | Article; + union WrappedArticle { article: Article } + + model CreatePostInput { title: string; contentBody: string; status?: ContentStatus; tagIds: string[]; media?: CreateMediaInput[]; } + model CreateArticleInput { title: string; slug: string; content: string; author: CreateAuthorInput; reviewPolicy?: CreateReviewPolicyInput; } + model CreateAuthorInput { userId: GraphQL.ID; penName?: string; } + model CreateReviewPolicyInput { requireApproval: boolean; minReviewers: int32; autoPublish: boolean; } + model CreateMediaInput { url: URL; mimeType: MimeType; altText?: string; } + model UpdatePostInput { title?: string; contentBody?: string; status?: ContentStatus; } + model CreateCommentInput { text: string; replies?: CreateCommentInput[]; } + + /** Fetch a user by ID */ + @query op getUser(id: GraphQL.ID): User; + @query op getUsers(limit?: int32, offset?: int32): User[]; + /** Search content */ + @query op search(query: string, limit?: int32): SearchResult[]; + @query op getPost(id: GraphQL.ID): Post | null; + @query op getFeed(userId: GraphQL.ID, cursor?: string): FeedItem[]; + @query op getContent(id: GraphQL.ID): Article | Post; + @query op getReviews(articleId: GraphQL.ID): ReviewConnection; + @query op listPosts(filter?: PostFilter, sort?: SortOrder): Post[]; + @query op getPublishable(id: GraphQL.ID): Publishable; + @query op getNotification(id: GraphQL.ID): NotificationContent; + @query op getWrapped(): WrappedArticle; + @query op getAuditLog(postId: GraphQL.ID): AuditedComment[]; + + @mutation op createUser(input: User): User; + @mutation op createPost(input: CreatePostInput): Post; + @mutation op createArticle(input: CreateArticleInput): Article; + @mutation op updatePost(id: GraphQL.ID, input: UpdatePostInput): Post; + @mutation op deletePost(id: GraphQL.ID): boolean; + @mutation op addComment(postId: GraphQL.ID, input: CreateCommentInput): Comment; + #deprecated "use createPost" + @mutation op publishDraft(draftId: GraphQL.ID): Post; + + @subscription op onPostPublished(): Post; + @subscription op onNewComment(postId: GraphQL.ID): Comment; + + interface BoardOps { + @query getBoard(id: GraphQL.ID): Board; + @query listBoards(userId: GraphQL.ID): Board[]; + @mutation createBoard(name: string, description?: string): Board; + } + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(sdl).toContain("type Query"); + expect(sdl).toContain("type Mutation"); + expect(sdl).toContain("type Subscription"); + expect(sdl).not.toMatch(/^scalar string$/m); + expect(errors.filter((d) => d.message.includes("collides"))).toHaveLength(0); + }); +}); + +// ============================================================================= +// Schema 2: Generics — template models, nested, constrained, recursive +// Patterns: #16-18, #57, #72 +// ============================================================================= +describe("schema: generics", () => { + it("emits instantiated generics including nested", async () => { + const { sdl, errors } = await emitSchema( + "02-generics", + ` + @schema(#{ name: "generics" }) + namespace Generics { + scalar DateTime extends utcDateTime; + + model PagedResponse { data: T[]; totalCount: int32; hasMore: boolean; cursor?: string; } + model BatchResult { pages: PagedResponse[]; batchId: string; completedAt: DateTime; } + model TreeNode { value: T; children: TreeNode[]; parent?: TreeNode; } + model CreateInput { data: T; clientMutationId?: string; } + + model User { id: string; name: string; } + model Post { id: string; title: string; } + model Tag { id: string; name: string; } + + @query op getUsers(cursor?: string): PagedResponse; + @query op getBatchPosts(): BatchResult; + @query op getTree(rootId: string): TreeNode; + @mutation op batchCreateTags(input: CreateInput): Tag[]; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(sdl).toContain("PagedResponseOfUser"); + expect(sdl).toContain("BatchResultOfPost"); + expect(sdl).toContain("PagedResponseOfPost"); + expect(sdl).toContain("TreeNodeOfPost"); + expect(errors).toHaveLength(0); + }); +}); + +// ============================================================================= +// Schema 3: Visibility — read-only, create-only, query/mutation splitting +// Patterns: #41-44 +// ============================================================================= +describe("schema: visibility", () => { + it("emits visibility-filtered input/output types", async () => { + const { sdl, errors } = await emitSchema( + "03-visibility", + ` + @schema(#{ name: "visibility" }) + namespace Visibility { + scalar DateTime extends utcDateTime; + + model Account { + @visibility(Lifecycle.Read) id: GraphQL.ID; + @visibility(Lifecycle.Read) createdAt: DateTime; + @visibility(Lifecycle.Read) lastLoginAt: DateTime; + @visibility(Lifecycle.Create) password: string; + @visibility(Lifecycle.Create) inviteCode?: string; + username: string; + displayName: string; + isActive: boolean; + } + + @query op getAccount(id: GraphQL.ID): Account; + @mutation op createAccount(input: Account): Account; + + model ServerGenerated { + @visibility(Lifecycle.Read) requestId: string; + @visibility(Lifecycle.Read) timestamp: DateTime; + @visibility(Lifecycle.Read) serverVersion: string; + } + + @query op getServerInfo(): ServerGenerated; + @mutation op triggerJob(info: ServerGenerated): boolean; + + model UserProfile { + @visibility(Lifecycle.Read, Lifecycle.Query) id: GraphQL.ID; + @visibility(Lifecycle.Read, Lifecycle.Query) username: string; + @visibility(Lifecycle.Create, Lifecycle.Update) email: string; + @visibility(Lifecycle.Create, Lifecycle.Update) password: string; + displayName: string; + bio?: string; + } + + @query op findProfiles(filter: UserProfile): UserProfile[]; + @mutation op updateProfile(input: UserProfile): UserProfile; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(sdl).toContain("type Account"); + expect(sdl).toContain("input AccountInput"); + expect(sdl).toMatch(/input AccountInput[^}]*password/s); + expect(sdl).not.toMatch(/input AccountInput[^}]*lastLoginAt/s); + expect(sdl).toContain("UserProfileQueryInput"); + expect(sdl).toContain("UserProfileMutationInput"); + expect(errors).toHaveLength(0); + }); +}); + +// ============================================================================= +// Schema 4: Record types +// Patterns: #21-24 +// ============================================================================= +describe("schema: record types", () => { + it("emits Record as custom scalars", async () => { + const { sdl, errors } = await emitSchema( + "04-records", + ` + @schema(#{ name: "records" }) + namespace Records { + scalar DateTime extends utcDateTime; + model Metric { count: int32; lastUpdated: DateTime; } + + model Config { + labels: Record; + metrics: Record; + rawData: Record | null; + } + + model StrictConfig { + maxItems: int32; + enabled: boolean; + ...Record; + } + + @query op getConfig(): Config; + @query op getStrictConfig(): StrictConfig; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(sdl).toContain("scalar RecordOfString"); + expect(sdl).toContain("scalar RecordOfMetric"); + expect(errors).toHaveLength(0); + }); + + it("emits a single scalar for Record used in both input and output contexts", async () => { + const { sdl, errors } = await emitSchema( + "04b-records-dedup", + ` + @schema(#{ name: "records-dedup" }) + namespace RecordsDedup { + model User { + name: string; + metadata: Record; + } + + @query op getUser(): User; + @mutation op createUser(input: User): User; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(errors).toHaveLength(0); + + // Should have exactly ONE RecordOfString scalar, not two + const matches = sdl!.match(/scalar RecordOfString/g); + expect(matches).toHaveLength(1); + + // Should NOT have RecordOfStringInput + expect(sdl).not.toContain("RecordOfStringInput"); + + // Both type and input should reference the same scalar + expect(sdl).toMatch(/type User \{[\s\S]*?metadata: RecordOfString/); + expect(sdl).toMatch(/input UserInput \{[\s\S]*?metadata: RecordOfString/); + }); +}); + +// ============================================================================= +// Schema 5: Union as input — @oneOf conversion +// Patterns: #49, #67 +// ============================================================================= +describe("schema: union as input", () => { + it("emits @oneOf input for union in mutation param", async () => { + const { sdl } = await emitSchema( + "05-union-input", + ` + @schema(#{ name: "union-input" }) + namespace UnionInput { + model Cat { name: string; indoor: boolean; } + model Dog { name: string; breed: string; } + union Pet { cat: Cat, dog: Dog } + + @query op getPets(): Pet[]; + @mutation op adoptPet(pet: Pet): Cat | Dog; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(sdl).toContain("union Pet"); + expect(sdl).toContain("type Query"); + expect(sdl).toContain("type Mutation"); + }); +}); + +// ============================================================================= +// Schema 6: Descriptions and deprecation +// Patterns: #52-55 +// ============================================================================= +describe("schema: descriptions and deprecation", () => { + it("emits doc comments and @deprecated directives", async () => { + const { sdl } = await emitSchema( + "06-descriptions", + ` + @schema(#{ name: "descriptions" }) + namespace Descriptions { + enum Priority { Low, Medium, High, Critical } + + model Task { + id: string; + /** The task title */ + title: string; + priority: Priority; + #deprecated "use priority field" + oldPriority?: string; + } + + /** Get tasks by priority */ + @query op getTasks(priority?: Priority): Task[]; + @mutation op setTaskPriority(taskId: string, priority: Priority): Task; + /** Get a task by ID */ + @query op getTaskById(/** The unique ID */ id: string): Task | null; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(sdl).toContain('"The task title"'); + expect(sdl).toContain('@deprecated(reason: "use priority field")'); + expect(sdl).toContain('"Get tasks by priority"'); + expect(sdl).toContain('"The unique ID"'); + }); +}); + +// ============================================================================= +// Schema 7: @operationFields with visibility +// Patterns: #5, @operationFields + visibility + query/mutation split +// ============================================================================= +describe("schema: @operationFields with visibility", () => { + it("emits operation fields on output, excludes from input, warns", async () => { + const { sdl, errors, warnings } = await emitSchema( + "07-opfields", + ` + @schema(#{ name: "opfields" }) + namespace OpFields { + model Post { id: GraphQL.ID; title: string; } + + @query op getUser(id: GraphQL.ID): User; + @query op getUserPosts(userId: GraphQL.ID, limit?: int32): Post[]; + @query op getUserFollowers(userId: GraphQL.ID): User[]; + @operationFields(getUser, getUserPosts, getUserFollowers) + model User { + @visibility(Lifecycle.Read) id: GraphQL.ID; + @visibility(Lifecycle.Read, Lifecycle.Query) username: string; + @visibility(Lifecycle.Create, Lifecycle.Update) password: string; + name: string; + email: string; + } + @query op searchUsers(filter: User): User[]; + @mutation op createUser(input: User): User; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(errors).toHaveLength(0); + // Output type has operation fields + expect(sdl).toMatch(/type User \{[^}]*getUser\(/s); + expect(sdl).toMatch(/type User \{[^}]*getUserPosts\(/s); + expect(sdl).toMatch(/type User \{[^}]*getUserFollowers\(/s); + // No input variant has operation fields + expect(sdl).not.toMatch(/input[^}]*getUser\(/s); + // Warning about operation fields ignored on input + expect( + warnings.some((d) => d.code === "@typespec/graphql/operation-fields-ignored-on-input"), + ).toBe(true); + }); +}); + +// ============================================================================= +// Schema 8: Remaining gaps — optional+nullable, constrained generic +// Patterns: #18, #32 +// ============================================================================= +describe("schema: remaining patterns", () => { + it("emits optional+nullable and constrained generic", async () => { + const { sdl, errors } = await emitSchema( + "08-gaps", + ` + @schema(#{ name: "gaps" }) + namespace Gaps { + model Item { bio?: string | null; count?: int32 | null; } + model Labeled { label: L; description: string; } + @query op getItem(): Item; + @query op getLabel(): Labeled<"category">; + } + `, + ); + + expect(sdl).toBeTruthy(); + expect(errors).toHaveLength(0); + // optional + nullable → no ! + expect(sdl).toMatch(/bio: String[^!]/); + expect(sdl).toMatch(/count: Int[^!]/); + // Constrained generic resolves + expect(sdl).toContain("type Labeled"); + expect(sdl).toContain("label: String!"); + }); +}); + +// ============================================================================= +// Schema 9: Edge case — nested empty model from visibility (API-5280) +// ============================================================================= +describe("schema: edge case - nested visibility-filtered empty model", () => { + it("handles model with property whose type is fully visibility-filtered", async () => { + const { sdl, errors } = await emitSchema( + "09-nested-empty", + ` + @schema(#{ name: "nested-empty" }) + namespace NestedEmpty { + model Inner { + @visibility(Lifecycle.Read) id: string; + @visibility(Lifecycle.Read) createdAt: string; + } + + model Outer { + name: string; + inner: Inner; + } + + @query op getOuter(): Outer; + @mutation op createOuter(input: Outer): Outer; + } + `, + ); + + // This is a known edge case from code review Finding 2. + // Inner as input has 0 properties after visibility filtering. + // Expected: either omit 'inner' from OuterInput, or handle gracefully. + // eslint-disable-next-line no-console + console.log(" [Finding 2] SDL:", sdl?.substring(0, 500)); + // eslint-disable-next-line no-console + console.log( + " [Finding 2] Errors:", + errors.map((d) => d.message), + ); + // Don't assert pass/fail — just document current behavior + expect(sdl !== undefined || errors.length > 0).toBe(true); + }); +}); diff --git a/packages/graphql/test/e2e-manual/output/.gitignore b/packages/graphql/test/e2e-manual/output/.gitignore new file mode 100644 index 00000000000..de09f8a5df7 --- /dev/null +++ b/packages/graphql/test/e2e-manual/output/.gitignore @@ -0,0 +1,2 @@ +*.graphql +*.diagnostics.txt diff --git a/packages/graphql/test/e2e.test.ts b/packages/graphql/test/e2e.test.ts new file mode 100644 index 00000000000..594045caaf8 --- /dev/null +++ b/packages/graphql/test/e2e.test.ts @@ -0,0 +1,1074 @@ +import { expectDiagnosticEmpty } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { emitSingleSchemaWithDiagnostics } from "./test-host.js"; + +describe("e2e: operations", () => { + it("renders query with parameters", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { name: string; age: int32; } + @query op getUser(id: string): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + name: String! + age: Int! + } + + type Query { + getUser(id: String!): User! + }" + `); + }); + + it("renders mutation with input parameter model", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { name: string; } + @query op getUsers(): User[]; + @mutation op createUser(input: User): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + name: String! + } + + input UserInput { + name: String! + } + + type Query { + getUsers: [User!]! + } + + type Mutation { + createUser(input: UserInput!): User! + }" + `); + }); + + it("renders subscription", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Message { text: string; } + @query op getMessages(): Message[]; + @subscription op onMessage(): Message; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Message { + text: String! + } + + type Query { + getMessages: [Message!]! + } + + type Subscription { + onMessage: Message! + }" + `); + }); + + it("renders operation with optional parameters as nullable", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { id: string; } + @query op searchUsers(query?: string, limit?: int32): User[]; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + id: String! + } + + type Query { + searchUsers(query: String, limit: Int): [User!]! + }" + `); + }); + + it("renders operation returning nullable type", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { name: string; } + @query op getUser(id: string): User | null; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + name: String! + } + + type Query { + getUser(id: String!): User + }" + `); + }); + + it("renders operation returning list", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Book { title: string; } + @query op getBooks(): Book[]; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Book { + title: String! + } + + type Query { + getBooks: [Book!]! + }" + `); + }); +}); + +describe("e2e: models", () => { + it("renders model with various scalar types", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Thing { + name: string; + count: int32; + price: float64; + active: boolean; + } + @query op getThing(): Thing; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Thing { + name: String! + count: Int! + price: Float! + active: Boolean! + } + + type Query { + getThing: Thing! + }" + `); + }); + + it("renders model with optional fields as nullable", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { name: string; nickname?: string; } + @query op getUser(): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + name: String! + nickname: String + } + + type Query { + getUser: User! + }" + `); + }); + + it("renders model with array fields", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { name: string; tags: string[]; } + @query op getUser(): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + name: String! + tags: [String!]! + } + + type Query { + getUser: User! + }" + `); + }); + + it("renders recursive model", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Person { name: string; friend?: Person; } + @query op getPerson(): Person; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Person { + name: String! + friend: Person + } + + type Query { + getPerson: Person! + }" + `); + }); + + it("renders model with doc description", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + /** A user in the system */ + model User { name: string; } + @query op getUser(): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + """"A user in the system""" + type User { + name: String! + } + + type Query { + getUser: User! + }" + `); + }); +}); + +describe("e2e: enums", () => { + it("renders enum with CONSTANT_CASE members", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + enum Status { Active, Inactive, PendingReview } + model Item { status: Status; } + @query op getItem(): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "enum Status { + ACTIVE + INACTIVE + PENDING_REVIEW + } + + type Item { + status: Status! + } + + type Query { + getItem: Item! + }" + `); + }); + + it("renders enum with deprecated member", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + enum Status { + Active, + #deprecated "use Active" + Legacy, + } + model Item { status: Status; } + @query op getItem(): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "enum Status { + ACTIVE + LEGACY @deprecated(reason: "use Active") + } + + type Item { + status: Status! + } + + type Query { + getItem: Item! + }" + `); + }); +}); + +describe("e2e: scalars", () => { + it("renders custom scalar", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + scalar DateTime extends string; + model Event { when: DateTime; } + @query op getEvent(): Event; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "scalar DateTime + + type Event { + when: DateTime! + } + + type Query { + getEvent: Event! + }" + `); + }); + + it("renders scalar with @specifiedBy", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @specifiedBy("https://example.com/spec") + scalar JSON extends string; + model Data { payload: JSON; } + @query op getData(): Data; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "scalar JSON @specifiedBy(url: "https://example.com/spec") + + type Data { + payload: JSON! + } + + type Query { + getData: Data! + }" + `); + }); +}); + +describe("e2e: unions", () => { + it("renders named union", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Cat { name: string; } + model Dog { breed: string; } + union Pet { cat: Cat, dog: Dog } + @query op getPet(): Pet; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "union Pet = Cat | Dog + + type Cat { + name: String! + } + + type Dog { + breed: String! + } + + type Query { + getPet: Pet! + }" + `); + }); + + it("renders union with scalar variants as wrapper models", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Cat { name: string; } + union SearchResult { cat: Cat, text: string } + @query op search(): SearchResult; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "union SearchResult = Cat | SearchResultTextUnionVariant + + type Cat { + name: String! + } + + type SearchResultTextUnionVariant { + value: String! + } + + type Query { + search: SearchResult! + }" + `); + }); +}); + +describe("e2e: interfaces", () => { + it("renders @interface model as interface with suffix", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @graphqlInterface model Animal { name: string; } + @compose(Animal) + model Cat { name: string; breed: string; } + @query op getCat(): Cat; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "interface AnimalInterface { + name: String! + } + + type Cat implements AnimalInterface { + name: String! + breed: String! + } + + type Query { + getCat: Cat! + }" + `); + }); +}); + +describe("e2e: input/output splitting", () => { + it("model used as both input and output gets two declarations", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Book { title: string; } + @query op getBooks(): Book[]; + @mutation op createBook(input: Book): Book; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Book { + title: String! + } + + input BookInput { + title: String! + } + + type Query { + getBooks: [Book!]! + } + + type Mutation { + createBook(input: BookInput!): Book! + }" + `); + }); + + it("input-only model does not produce output type", async () => { + const result = await emitSingleSchemaWithDiagnostics( + ` + @schema namespace Test { + model Book { title: string; } + model CreatePayload { title: string; year: int32; } + @query op getBooks(): Book[]; + @mutation op createBook(input: CreatePayload): Book; + } + `, + { "omit-unreachable-types": true }, + ); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Book { + title: String! + } + + input CreatePayloadInput { + title: String! + year: Int! + } + + type Query { + getBooks: [Book!]! + } + + type Mutation { + createBook(input: CreatePayloadInput!): Book! + }" + `); + }); +}); + +describe("e2e: nullability combinations", () => { + it("handles nullable array elements (T | null)[]", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Item { tags: (string | null)[]; } + @query op getItem(): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Item { + tags: [String]! + } + + type Query { + getItem: Item! + }" + `); + }); + + it("handles nullable array T[] | null", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Item { tags: string[] | null; } + @query op getItem(): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Item { + tags: [String!] + } + + type Query { + getItem: Item! + }" + `); + }); + + it("handles both nullable: (T | null)[] | null", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Item { tags: (string | null)[] | null; } + @query op getItem(): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Item { + tags: [String] + } + + type Query { + getItem: Item! + }" + `); + }); +}); + +describe("e2e: nullable scalar does not emit built-in scalar declaration", () => { + it("does not emit scalar string for nullable string field", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Foo { + id: GraphQL.ID; + value: string | null; + } + @query op getFoo(id: GraphQL.ID): Foo; + } + `); + expect(result.graphQLOutput).not.toContain("scalar string"); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Foo { + id: ID! + value: String + } + + type Query { + getFoo(id: ID!): Foo! + }" + `); + }); + + it("does not emit scalar int32 for nullable int field", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Bar { + count: int32 | null; + } + @query op getBar(): Bar; + } + `); + expect(result.graphQLOutput).not.toContain("scalar int32"); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Bar { + count: Int + } + + type Query { + getBar: Bar! + }" + `); + }); +}); + +describe("e2e: @operationFields", () => { + it("renders operation as field with arguments on object type", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @query op getUser(id: string): User; + @operationFields(getUser) + model User { id: string; name: string; } + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + id: String! + name: String! + getUser(id: String!): User! + } + + type Query { + getUser(id: String!): User! + }" + `); + }); + + it("renders multiple operation fields", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @query op getUser(id: string): User; + @query op getFriends(id: string): User[]; + @operationFields(getUser, getFriends) + model User { id: string; name: string; } + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + id: String! + name: String! + getUser(id: String!): User! + getFriends(id: String!): [User!]! + } + + type Query { + getFriends(id: String!): [User!]! + getUser(id: String!): User! + }" + `); + }); +}); + +describe("e2e: circular references", () => { + it("handles self-referencing model", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model TreeNode { value: string; children: TreeNode[]; parent?: TreeNode; } + @query op getRoot(): TreeNode; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type TreeNode { + value: String! + children: [TreeNode!]! + parent: TreeNode + } + + type Query { + getRoot: TreeNode! + }" + `); + }); + + it("handles mutual references between models", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Author { name: string; books: Book[]; } + model Book { title: string; author: Author; } + @query op getAuthor(): Author; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Author { + name: String! + books: [Book!]! + } + + type Book { + title: String! + author: Author! + } + + type Query { + getAuthor: Author! + }" + `); + }); +}); + +describe("e2e: anonymous unions", () => { + it("names anonymous return type union from operation", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Cat { name: string; } + model Dog { breed: string; } + @query op getPet(): Cat | Dog; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "union GetPetUnion = Cat | Dog + + type Cat { + name: String! + } + + type Dog { + breed: String! + } + + type Query { + getPet: GetPetUnion! + }" + `); + }); +}); + +describe("e2e: @compose does not produce false incompatible diagnostics", () => { + it("no diagnostics for @compose with spread properties", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @graphqlInterface(#{interfaceOnly: true}) + model Node { id: GraphQL.ID; } + + @compose(Node) + model Article { ...Node; title: string; } + + @query op getArticle(): Article; + } + `); + expectDiagnosticEmpty(result.diagnostics); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "interface Node { + id: ID! + } + + type Article implements Node { + id: ID! + title: String! + } + + type Query { + getArticle: Article! + }" + `); + }); + + it("no diagnostics for @compose with multiple interfaces", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @graphqlInterface(#{interfaceOnly: true}) + model Node { id: GraphQL.ID; } + + @graphqlInterface + model Named { name: string; } + + @compose(Node, Named) + model User { ...Node; ...Named; age: int32; } + + @query op getUser(): User; + } + `); + expectDiagnosticEmpty(result.diagnostics); + }); +}); + +describe("e2e: @operationFields on model used as input warns", () => { + it("warns that operation fields are ignored on input types", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + @query op getUser(id: string): User; + @operationFields(getUser) + model User { id: string; name: string; } + @mutation op createUser(input: User): User; + } + `); + expect(result.graphQLOutput).toContain("getUser(id: String!): User!"); + expect(result.graphQLOutput).not.toMatch(/input UserInput[^}]*getUser/s); + const warnings = result.diagnostics.filter((d) => d.severity === "warning"); + expect(warnings.length).toBeGreaterThan(0); + expect( + warnings.some((d) => d.code === "@typespec/graphql/operation-fields-ignored-on-input"), + ).toBe(true); + }); +}); + +describe("e2e: TypeSpec interface keyword prefixes operations", () => { + it("prefixes operations from interface with interface name", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Board { id: string; name: string; } + + interface BoardOps { + @query getBoard(id: string): Board; + @mutation createBoard(name: string): Board; + } + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Board { + id: String! + name: String! + } + + type Query { + boardOpsGetBoard(id: String!): Board! + } + + type Mutation { + boardOpsCreateBoard(name: String!): Board! + }" + `); + }); +}); + +describe("e2e: visibility filtering", () => { + it("excludes read-only properties from input type", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Board { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Read) + createdAt: string; + + name: string; + description: string; + } + @query op getBoard(id: string): Board; + @mutation op createBoard(input: Board): Board; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Board { + id: String! + createdAt: String! + name: String! + description: String! + } + + input BoardInput { + name: String! + description: String! + } + + type Query { + getBoard(id: String!): Board! + } + + type Mutation { + createBoard(input: BoardInput!): Board! + }" + `); + }); + + it("excludes create-only properties from output type", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Create) + password: string; + + name: string; + } + @query op getUser(id: string): User; + @mutation op createUser(input: User): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + id: String! + name: String! + } + + input UserInput { + password: String! + name: String! + } + + type Query { + getUser(id: String!): User! + } + + type Mutation { + createUser(input: UserInput!): User! + }" + `); + }); + + it("includes all properties when no visibility decorator is set", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Item { + name: string; + count: int32; + } + @query op getItem(): Item; + @mutation op createItem(input: Item): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Item { + name: String! + count: Int! + } + + input ItemInput { + name: String! + count: Int! + } + + type Query { + getItem: Item! + } + + type Mutation { + createItem(input: ItemInput!): Item! + }" + `); + }); + + it("splits input types when query and mutation have different visible properties", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model User { + @visibility(Lifecycle.Read, Lifecycle.Query) + id: string; + + @visibility(Lifecycle.Create, Lifecycle.Update) + password: string; + + name: string; + } + @query op getUser(filter: User): User; + @mutation op createUser(input: User): User; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type User { + id: String! + name: String! + } + + input UserQueryInput { + id: String! + name: String! + } + + input UserMutationInput { + password: String! + name: String! + } + + type Query { + getUser(filter: UserQueryInput!): User! + } + + type Mutation { + createUser(input: UserMutationInput!): User! + }" + `); + }); + + it("does not split input types when visibility produces same properties", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Item { + name: string; + count: int32; + } + @query op searchItems(filter: Item): Item[]; + @mutation op createItem(input: Item): Item; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "type Item { + name: String! + count: Int! + } + + input ItemInput { + name: String! + count: Int! + } + + type Query { + searchItems(filter: ItemInput!): [Item!]! + } + + type Mutation { + createItem(input: ItemInput!): Item! + }" + `); + }); +}); + +describe("e2e: extends flattening", () => { + it("flattens base model fields into child type", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + scalar DateTime extends utcDateTime; + model Timestamps { createdAt: DateTime; updatedAt: DateTime; } + model AuditedComment extends Timestamps { + commentId: string; + action: string; + } + @query op getAudit(): AuditedComment; + } + `); + expect(result.graphQLOutput).toMatchInlineSnapshot(` + "scalar DateTime + + type Timestamps { + createdAt: DateTime! + updatedAt: DateTime! + } + + type AuditedComment { + createdAt: DateTime! + updatedAt: DateTime! + commentId: String! + action: String! + } + + type Query { + getAudit: AuditedComment! + }" + `); + }); + + it("flattens multi-level inheritance", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Base { id: string; } + model Middle extends Base { name: string; } + model Child extends Middle { age: int32; } + @query op getChild(): Child; + } + `); + expect(result.graphQLOutput).toMatch(/type Child \{[^}]*id: String!/s); + expect(result.graphQLOutput).toMatch(/type Child \{[^}]*name: String!/s); + expect(result.graphQLOutput).toMatch(/type Child \{[^}]*age: Int!/s); + }); + + it("flattens base model fields into input type", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Base { id: string; } + model Child extends Base { name: string; } + @query op getChild(): Child; + @mutation op createChild(input: Child): Child; + } + `); + expect(result.graphQLOutput).toMatch(/input ChildInput[^}]*id: String!/s); + expect(result.graphQLOutput).toMatch(/input ChildInput[^}]*name: String!/s); + }); +}); + +describe("e2e: empty model becomes scalar", () => { + it("empty model referenced as property becomes scalar", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Empty {} + model Outer { name: string; inner: Empty; } + @query op getOuter(): Outer; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("scalar Empty"); + expect(result.graphQLOutput).toContain("inner: Empty!"); + }); + + it("visibility-filtered-to-empty model becomes scalar in input", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Inner { + @visibility(Lifecycle.Read) id: string; + @visibility(Lifecycle.Read) createdAt: string; + } + model Outer { name: string; inner: Inner; } + @query op getOuter(): Outer; + @mutation op createOuter(input: Outer): Outer; + } + `); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toContain("scalar InnerInput"); + expect(result.graphQLOutput).toMatch(/input OuterInput[^}]*inner: InnerInput/s); + }); +}); diff --git a/packages/graphql/test/emitter.test.ts b/packages/graphql/test/emitter.test.ts new file mode 100644 index 00000000000..525ab0af832 --- /dev/null +++ b/packages/graphql/test/emitter.test.ts @@ -0,0 +1,74 @@ +import { expectDiagnosticEmpty } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { emitSingleSchemaWithDiagnostics } from "./test-host.js"; + +describe("emitter", () => { + it("emits a schema with query operations", async () => { + const code = ` + @schema + namespace TestNamespace { + model Book { + title: string; + pageCount: int32; + } + @query op getBooks(): Book[]; + } + `; + const result = await emitSingleSchemaWithDiagnostics(code, {}); + expectDiagnosticEmpty(result.diagnostics); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toMatch(/type Query \{/); + expect(result.graphQLOutput).toContain("getBooks"); + expect(result.graphQLOutput).toMatch(/type Book \{/); + expect(result.graphQLOutput).toContain("title: String!"); + expect(result.graphQLOutput).toContain("pageCount: Int!"); + }); + + it("emits mutation and subscription root types", async () => { + const code = ` + @schema + namespace TestNamespace { + model Book { title: string; } + @query op getBooks(): Book[]; + @mutation op createBook(title: string): Book; + @subscription op onBookCreated(): Book; + } + `; + const result = await emitSingleSchemaWithDiagnostics(code, {}); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toMatch(/type Query \{/); + expect(result.graphQLOutput).toMatch(/type Mutation \{/); + expect(result.graphQLOutput).toMatch(/type Subscription \{/); + }); + + it("emits enums and scalars referenced by models", async () => { + const code = ` + @schema + namespace TestNamespace { + enum Status { Active, Inactive } + scalar DateTime extends string; + model Book { title: string; status: Status; created: DateTime; } + @query op getBooks(): Book[]; + } + `; + const result = await emitSingleSchemaWithDiagnostics(code, {}); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toMatch(/enum Status \{/); + expect(result.graphQLOutput).toContain("scalar DateTime"); + }); + + it("emits input types for operation parameters", async () => { + const code = ` + @schema + namespace TestNamespace { + model Book { title: string; } + @query op getBooks(): Book[]; + @mutation op createBook(input: Book): Book; + } + `; + const result = await emitSingleSchemaWithDiagnostics(code, {}); + expect(result.graphQLOutput).toBeDefined(); + expect(result.graphQLOutput).toMatch(/type Book \{/); + expect(result.graphQLOutput).toMatch(/input BookInput \{/); + }); +}); diff --git a/packages/graphql/test/interface.test.ts b/packages/graphql/test/interface.test.ts new file mode 100644 index 00000000000..378ebef67c9 --- /dev/null +++ b/packages/graphql/test/interface.test.ts @@ -0,0 +1,216 @@ +import { + expectDiagnosticEmpty, + expectDiagnostics, + expectTypeEquals, + t, +} from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { getComposition, isInterface } from "../src/lib/interface.js"; +import { Tester } from "./test-host.js"; + +describe("@graphqlInterface", () => { + it("Marks the model as an interface", async () => { + const { TestModel, program } = await Tester.compile(t.code` + @graphqlInterface + model ${t.model("TestModel")} {} + `); + + expect(isInterface(program, TestModel)).toBe(true); + }); +}); + +describe("@compose", () => { + it("Can compose and store the composition", async () => { + const { TestModel, AnInterface, program } = await Tester.compile(t.code` + @graphqlInterface + model ${t.model("AnInterface")} {} + + @compose(AnInterface) + model ${t.model("TestModel")} {} + `); + const composition = getComposition(program, TestModel); + expect(composition).toBeDefined(); + expect(composition).toHaveLength(1); + expectTypeEquals(composition![0], AnInterface); + }); + + it("Can compose multiple interfaces", async () => { + const { TestModel, FirstInterface, SecondInterface, program } = await Tester.compile(t.code` + @graphqlInterface + model ${t.model("FirstInterface")} {} + @graphqlInterface + model ${t.model("SecondInterface")} {} + + @compose(FirstInterface, SecondInterface) + model ${t.model("TestModel")} {} + `); + + const composition = getComposition(program, TestModel); + expect(composition).toBeDefined(); + expect(composition).toHaveLength(2); + expectTypeEquals(composition![0], FirstInterface); + expectTypeEquals(composition![1], SecondInterface); + }); + + it("Can spread properties from the interface", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + @compose(AnInterface) + model TestModel { + ...AnInterface; + } + `); + expectDiagnosticEmpty(diagnostics); + }); + + it("Can extend properties from the interface", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + @compose(AnInterface) + model TestModel extends AnInterface {} + `); + expectDiagnosticEmpty(diagnostics); + }); + + it("Can copy the interface", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + @compose(AnInterface) + model TestModel is AnInterface {} + `); + expectDiagnosticEmpty(diagnostics); + }); + + it("Can receive properties from a template", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + model Template { + prop: string; + extraProp: ExtraProp; + } + + @compose(AnInterface) + model TestModel { + ...Template; + } + `); + expectDiagnosticEmpty(diagnostics); + }); + + it("Requires that an implemented model is an Interface", async () => { + const diagnostics = await Tester.diagnose(` + model NotAnInterface {} + + @compose(NotAnInterface) + @test model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/invalid-interface", + message: + "All models used with `@compose` must be marked with `@graphqlInterface`, but NotAnInterface is not.", + }); + }); + + it("Requires that all implemented models are Interfaces", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface {} + model NotAnInterface {} + + @compose(AnInterface, NotAnInterface) + @test model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/invalid-interface", + message: + "All models used with `@compose` must be marked with `@graphqlInterface`, but NotAnInterface is not.", + }); + }); + + it("Allows Interfaces to implement other Interfaces", async () => { + const { AnInterface, AnotherInterface, program } = await Tester.compile(t.code` + @graphqlInterface + model ${t.model("AnotherInterface")} {} + + @compose(AnotherInterface) + @graphqlInterface + model ${t.model("AnInterface")} {} + `); + + const composition = getComposition(program, AnInterface); + expect(composition).toBeDefined(); + expect(composition).toHaveLength(1); + expectTypeEquals(composition![0], AnotherInterface); + }); + + it("Does not allow an interface to implement itself", async () => { + const diagnostics = await Tester.diagnose(` + @compose(AnInterface) + @graphqlInterface + @test model AnInterface {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/circular-interface", + message: "An interface cannot implement itself.", + }); + }); + + it("Requires that all Interface properties are implemented", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + @compose(AnInterface) + model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/missing-interface-property", + message: + "Model must contain property `prop` from `AnInterface` in order to implement it in GraphQL.", + }); + }); + + it("Requires that all Interface properties are compatible", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + @compose(AnInterface) + model TestModel { + prop: integer; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/incompatible-interface-property", + message: "Property `prop` is incompatible with `AnInterface`.", + }); + }); + + it("Allows additional properties", async () => { + const diagnostics = await Tester.diagnose(` + @graphqlInterface model AnInterface { + prop: string; + } + + @compose(AnInterface) + model TestModel { + prop: string; + anotherProp: integer; + } + `); + expectDiagnosticEmpty(diagnostics); + }); +}); diff --git a/packages/graphql/test/lib/naming.test.ts b/packages/graphql/test/lib/naming.test.ts new file mode 100644 index 00000000000..da718ea0f21 --- /dev/null +++ b/packages/graphql/test/lib/naming.test.ts @@ -0,0 +1,101 @@ +import { describe, expect, it } from "vitest"; +import { + applyEnumMemberPipeline, + applyFieldNamePipeline, + applyTypeNamePipeline, +} from "../../src/lib/naming.js"; + +describe("naming pipelines", () => { + describe("applyTypeNamePipeline", () => { + const noContext = { isInput: false, isInterface: false }; + + it("PascalCases a snake_case name", () => { + expect(applyTypeNamePipeline("ad_account", noContext)).toBe("AdAccount"); + }); + + it("strips namespace prefix", () => { + expect(applyTypeNamePipeline("Pinterest.API.Board", noContext)).toBe("Board"); + }); + + it("prepends underscore for names starting with digit", () => { + expect(applyTypeNamePipeline("123foo", noContext)).toBe("_123foo"); + }); + + it("handles acronyms in mixed-case names", () => { + // Each letter of the acronym becomes its own word → PascalCase capitalizes each + expect(applyTypeNamePipeline("APIResponse", noContext)).toBe("APIResponse"); + }); + + it("replaces array syntax", () => { + expect(applyTypeNamePipeline("Fruit[]", noContext)).toBe("FruitArray"); + }); + + it("replaces non-word characters with underscore", () => { + expect(applyTypeNamePipeline("user-name", noContext)).toBe("UserName"); + }); + + it("appends Input suffix when isInput is true", () => { + expect(applyTypeNamePipeline("User", { isInput: true, isInterface: false })).toBe( + "UserInput", + ); + }); + + it("does not double-append Input suffix", () => { + expect(applyTypeNamePipeline("UserInput", { isInput: true, isInterface: false })).toBe( + "UserInput", + ); + }); + + it("appends Interface suffix when isInterface is true", () => { + expect(applyTypeNamePipeline("Node", { isInput: false, isInterface: true })).toBe( + "NodeInterface", + ); + }); + + it("does not double-append Interface suffix", () => { + expect(applyTypeNamePipeline("NodeInterface", { isInput: false, isInterface: true })).toBe( + "NodeInterface", + ); + }); + + it("preserves all-caps names", () => { + expect(applyTypeNamePipeline("URL", noContext)).toBe("URL"); + }); + }); + + describe("applyFieldNamePipeline", () => { + it("camelCases a snake_case name", () => { + expect(applyFieldNamePipeline("ad_account_id")).toBe("adAccountId"); + }); + + it("camelCases a SCREAMING_SNAKE name", () => { + expect(applyFieldNamePipeline("FIRST_NAME")).toBe("firstName"); + }); + + it("sanitizes dots in field names", () => { + expect(applyFieldNamePipeline("Namespace.fieldName")).toBe("namespaceFieldName"); + }); + + it("preserves prefix underscore for names starting with digit", () => { + expect(applyFieldNamePipeline("123field")).toBe("_123field"); + }); + }); + + describe("applyEnumMemberPipeline", () => { + it("converts camelCase to CONSTANT_CASE", () => { + expect(applyEnumMemberPipeline("myValue")).toBe("MY_VALUE"); + }); + + it("converts camelCase status to CONSTANT_CASE", () => { + expect(applyEnumMemberPipeline("activeStatus")).toBe("ACTIVE_STATUS"); + }); + + it("preserves already CONSTANT_CASE", () => { + expect(applyEnumMemberPipeline("ALREADY_CONSTANT")).toBe("ALREADY_CONSTANT"); + }); + + it("handles names starting with digits", () => { + expect(applyEnumMemberPipeline("123value")).toBe("_123_VALUE"); + }); + }); +}); diff --git a/packages/graphql/test/lib/scalar-mappings.test.ts b/packages/graphql/test/lib/scalar-mappings.test.ts new file mode 100644 index 00000000000..8463d3a199c --- /dev/null +++ b/packages/graphql/test/lib/scalar-mappings.test.ts @@ -0,0 +1,83 @@ +import { describe, expect, it } from "vitest"; +import { resolveScalarToGraphQL } from "../../src/lib/scalar-mappings.js"; + +describe("resolveScalarToGraphQL", () => { + describe("GraphQL built-in scalars", () => { + it.each([ + ["string", "String"], + ["boolean", "Boolean"], + ["int32", "Int"], + ["float32", "Float"], + ["float64", "Float"], + ])("maps %s to %s", (tspScalar, graphqlType) => { + expect(resolveScalarToGraphQL(tspScalar)).toBe(graphqlType); + }); + }); + + describe("integer types that fit in GraphQL Int", () => { + it.each([ + ["int8", "Int"], + ["int16", "Int"], + ["uint8", "Int"], + ["uint16", "Int"], + ])("maps %s to %s", (tspScalar, graphqlType) => { + expect(resolveScalarToGraphQL(tspScalar)).toBe(graphqlType); + }); + }); + + describe("integer types that exceed GraphQL Int range", () => { + it.each([ + ["int64", "String"], + ["uint32", "String"], + ["uint64", "String"], + ["safeint", "String"], + ["integer", "String"], + ])("maps %s to %s", (tspScalar, graphqlType) => { + expect(resolveScalarToGraphQL(tspScalar)).toBe(graphqlType); + }); + }); + + describe("numeric/decimal types", () => { + it.each([ + ["numeric", "String"], + ["float", "Float"], + ["decimal", "String"], + ["decimal128", "String"], + ])("maps %s to %s", (tspScalar, graphqlType) => { + expect(resolveScalarToGraphQL(tspScalar)).toBe(graphqlType); + }); + }); + + describe("date/time types", () => { + it.each([ + ["plainDate", "String"], + ["plainTime", "String"], + ["utcDateTime", "String"], + ["offsetDateTime", "String"], + ["duration", "String"], + ])("maps %s to %s", (tspScalar, graphqlType) => { + expect(resolveScalarToGraphQL(tspScalar)).toBe(graphqlType); + }); + }); + + describe("other types", () => { + it.each([ + ["bytes", "String"], + ["url", "String"], + ])("maps %s to %s", (tspScalar, graphqlType) => { + expect(resolveScalarToGraphQL(tspScalar)).toBe(graphqlType); + }); + }); + + describe("GraphQL library scalar", () => { + it("maps ID to ID", () => { + expect(resolveScalarToGraphQL("ID")).toBe("ID"); + }); + }); + + describe("user-defined scalars", () => { + it("returns unknown scalar names unchanged", () => { + expect(resolveScalarToGraphQL("MyCustomScalar")).toBe("MyCustomScalar"); + }); + }); +}); diff --git a/packages/graphql/test/lib/template-composition.test.ts b/packages/graphql/test/lib/template-composition.test.ts new file mode 100644 index 00000000000..7d601b22e61 --- /dev/null +++ b/packages/graphql/test/lib/template-composition.test.ts @@ -0,0 +1,107 @@ +import { resolvePath, type Model } from "@typespec/compiler"; +import { createTester, t } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { composeTemplateName } from "../../src/lib/template-composition.js"; + +const Tester = createTester(resolvePath(import.meta.dirname, "../.."), { + libraries: [], +}); + +function getReturnType(ns: Record, opName: string): Model { + return ns.operations.get(opName)!.returnType as Model; +} + +describe("composeTemplateName", () => { + it("composes single arg: PaginatedModel → PaginatedModelOfAdAccount", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model AdAccount { id: string; } + model PaginatedModel { items: T[]; } + op get(): PaginatedModel; + } + `); + + const instance = getReturnType(TestNs, "get"); + expect(composeTemplateName(instance)).toBe("PaginatedModelOfAdAccount"); + }); + + it("composes multiple args joined with And: MyMap → MyMapOfStringAndInt32", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model MyMap { key: K; value: V; } + op get(): MyMap; + } + `); + + const instance = getReturnType(TestNs, "get"); + expect(composeTemplateName(instance)).toBe("MyMapOfStringAndInt32"); + }); + + it("handles array arg: GetResponse → GetResponseOfFruitArray", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Fruit { name: string; } + model GetResponse { data: T; } + op get(): GetResponse; + } + `); + + const instance = getReturnType(TestNs, "get"); + expect(composeTemplateName(instance)).toBe("GetResponseOfFruitArray"); + }); + + it("handles nested template: Wrapper> → WrapperOfPaginatedModelOfBoard", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Board { id: string; } + model PaginatedModel { items: T[]; } + model Wrapper { data: T; } + op get(): Wrapper>; + } + `); + + const instance = getReturnType(TestNs, "get"); + expect(composeTemplateName(instance)).toBe("WrapperOfPaginatedModelOfBoard"); + }); + + it("handles deeply nested: A>> → AOfBOfCOfD", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model D { id: string; } + model C { c: T; } + model B { b: T; } + model A { a: T; } + op get(): A>>; + } + `); + + const instance = getReturnType(TestNs, "get"); + expect(composeTemplateName(instance)).toBe("AOfBOfCOfD"); + }); + + it("strips namespace from args: Response → ResponseOfUser", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace Pinterest.API { + model User { id: string; } + } + namespace ${t.namespace("TestNs")} { + model Response { data: T; } + op get(): Response; + } + `); + + const instance = getReturnType(TestNs, "get"); + expect(composeTemplateName(instance)).toBe("ResponseOfUser"); + }); + + it("returns raw name for non-template types", async () => { + const { TestNs } = await Tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model PlainModel { id: string; } + } + `); + + const model = TestNs.models.get("PlainModel")!; + expect(composeTemplateName(model)).toBe("PlainModel"); + }); +}); diff --git a/packages/graphql/test/lib/type-utils.test.ts b/packages/graphql/test/lib/type-utils.test.ts new file mode 100644 index 00000000000..492c5c2e69d --- /dev/null +++ b/packages/graphql/test/lib/type-utils.test.ts @@ -0,0 +1,129 @@ +import { describe, expect, it } from "vitest"; +import { + getSingleNameWithNamespace, + sanitizeNameForGraphQL, + toEnumMemberName, + toFieldName, + toTypeName, +} from "../../src/lib/type-utils.js"; + +describe("type-utils", () => { + describe("sanitizeNameForGraphQL", () => { + it("replaces special characters with underscores", () => { + expect(sanitizeNameForGraphQL("$Money$")).toBe("_Money_"); + expect(sanitizeNameForGraphQL("My-Name")).toBe("My_Name"); + expect(sanitizeNameForGraphQL("Hello.World")).toBe("Hello_World"); + }); + + it("replaces [] with Array", () => { + expect(sanitizeNameForGraphQL("Item[]")).toBe("ItemArray"); + }); + + it("leaves valid names unchanged", () => { + expect(sanitizeNameForGraphQL("ValidName")).toBe("ValidName"); + expect(sanitizeNameForGraphQL("_underscore")).toBe("_underscore"); + expect(sanitizeNameForGraphQL("name123")).toBe("name123"); + }); + + it("adds prefix for names starting with numbers", () => { + expect(sanitizeNameForGraphQL("123Name")).toBe("_123Name"); + expect(sanitizeNameForGraphQL("1")).toBe("_1"); + }); + + it("handles multiple special characters", () => { + expect(sanitizeNameForGraphQL("$My-Special.Name$")).toBe("_My_Special_Name_"); + }); + + it("handles empty prefix parameter", () => { + expect(sanitizeNameForGraphQL("123Name", "")).toBe("_123Name"); + }); + + it("uses custom prefix for invalid starting character", () => { + expect(sanitizeNameForGraphQL("123Name", "Num")).toBe("Num_123Name"); + }); + }); + + describe("toTypeName", () => { + it("converts to PascalCase", () => { + expect(toTypeName("my_name")).toBe("MyName"); + expect(toTypeName("some-value")).toBe("SomeValue"); + expect(toTypeName("hello_world")).toBe("HelloWorld"); + }); + + it("preserves all-caps acronyms", () => { + expect(toTypeName("API")).toBe("API"); + expect(toTypeName("APIResponse")).toBe("APIResponse"); + expect(toTypeName("myAPIKey")).toBe("MyAPIKey"); + expect(toTypeName("HTTPResponse")).toBe("HTTPResponse"); + }); + + it("handles namespaced names by using only the last part", () => { + expect(toTypeName("MyNamespace.MyType")).toBe("MyType"); + expect(toTypeName("A.B.C.MyType")).toBe("MyType"); + }); + + it("sanitizes and converts special characters", () => { + // Special chars become underscores, then PascalCase removes them + expect(toTypeName("my-special$name")).toBe("MySpecialName"); + expect(toTypeName("$invalid")).toBe("Invalid"); + }); + }); + + describe("toEnumMemberName", () => { + it("converts to CONSTANT_CASE", () => { + expect(toEnumMemberName("MyEnum", "myValue")).toBe("MY_VALUE"); + expect(toEnumMemberName("Status", "inProgress")).toBe("IN_PROGRESS"); + }); + + it("handles already uppercase names", () => { + expect(toEnumMemberName("MyEnum", "ACTIVE")).toBe("ACTIVE"); + }); + + it("uses enum name as prefix for invalid starting characters", () => { + expect(toEnumMemberName("Priority", "1High")).toBe("PRIORITY_1_HIGH"); + }); + + it("handles special characters", () => { + expect(toEnumMemberName("MyEnum", "value-with-dashes")).toBe("VALUE_WITH_DASHES"); + }); + + it("separates numbers", () => { + expect(toEnumMemberName("MyEnum", "value123")).toBe("VALUE_123"); + }); + }); + + describe("toFieldName", () => { + it("converts to camelCase", () => { + expect(toFieldName("MyField")).toBe("myField"); + expect(toFieldName("SOME_VALUE")).toBe("someValue"); + }); + + it("handles snake_case", () => { + expect(toFieldName("my_field_name")).toBe("myFieldName"); + }); + + it("handles special characters", () => { + expect(toFieldName("my-field")).toBe("myField"); + expect(toFieldName("$special")).toBe("_special"); + }); + + it("preserves leading underscores", () => { + expect(toFieldName("_private")).toBe("_private"); + expect(toFieldName("__internal")).toBe("__internal"); + }); + }); + + describe("getSingleNameWithNamespace", () => { + it("replaces dots with underscores", () => { + expect(getSingleNameWithNamespace("My.Namespace.Type")).toBe("My_Namespace_Type"); + }); + + it("trims whitespace", () => { + expect(getSingleNameWithNamespace(" My.Type ")).toBe("My_Type"); + }); + + it("handles names without namespace", () => { + expect(getSingleNameWithNamespace("MyType")).toBe("MyType"); + }); + }); +}); diff --git a/packages/graphql/test/main.tsp b/packages/graphql/test/main.tsp new file mode 100644 index 00000000000..ea4ae208f92 --- /dev/null +++ b/packages/graphql/test/main.tsp @@ -0,0 +1,27 @@ +import "@typespec/graphql"; +using GraphQL; + +@schema(#{ name: "library-schema" }) +namespace MyLibrary { + model Book { + id: string; + title: string; + publicationDate: string; + author: Author; + } + + model Author { + id: string; + name: string; + bio?: string; + books: Book[]; + friend: Author; + } + + enum Genre { + Fiction, + NonFiction, + Mystery, + Fantasy, + } +} diff --git a/packages/graphql/test/mutation-engine/context.test.ts b/packages/graphql/test/mutation-engine/context.test.ts new file mode 100644 index 00000000000..8048feb63ea --- /dev/null +++ b/packages/graphql/test/mutation-engine/context.test.ts @@ -0,0 +1,184 @@ +import type { Model } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { isOneOf } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Input/Output Context", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("produces separate mutations for input and output contexts", async () => { + const { Book } = await tester.compile(t.code`model ${t.model("Book")} { title: string; }`); + + const engine = createTestEngine(tester.program); + const inputMutation = engine.mutateModel(Book, GraphQLTypeContext.Input); + const outputMutation = engine.mutateModel(Book, GraphQLTypeContext.Output); + + // Different mutation objects (different cache entries) + expect(inputMutation).not.toBe(outputMutation); + // Both produce valid mutated types + expect(inputMutation.mutatedType.name).toBe("BookInput"); + expect(outputMutation.mutatedType.name).toBe("Book"); + }); + + it("returns cached mutation for same type and context", async () => { + const { Book } = await tester.compile(t.code`model ${t.model("Book")} { title: string; }`); + + const engine = createTestEngine(tester.program); + const first = engine.mutateModel(Book, GraphQLTypeContext.Input); + const second = engine.mutateModel(Book, GraphQLTypeContext.Input); + + expect(first).toBe(second); + }); + + it("exposes typeContext on the mutation", async () => { + const { Book } = await tester.compile(t.code`model ${t.model("Book")} { title: string; }`); + + const engine = createTestEngine(tester.program); + const inputMutation = engine.mutateModel(Book, GraphQLTypeContext.Input); + const outputMutation = engine.mutateModel(Book, GraphQLTypeContext.Output); + + expect(inputMutation.typeContext).toBe(GraphQLTypeContext.Input); + expect(outputMutation.typeContext).toBe(GraphQLTypeContext.Output); + }); +}); + +describe("GraphQL Mutation Engine - Operation Context Propagation", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("mutates operation parameters with input context", async () => { + const { Book, createBook } = await tester.compile( + t.code` + model ${t.model("Book")} { title: string; } + op ${t.op("createBook")}(input: Book): void; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(createBook); + + // The model should now be cached under the input key + const inputMutation = engine.mutateModel(Book, GraphQLTypeContext.Input); + expect(inputMutation.typeContext).toBe(GraphQLTypeContext.Input); + }); + + it("mutates operation return type with output context", async () => { + const { Book, getBook } = await tester.compile( + t.code` + model ${t.model("Book")} { title: string; } + op ${t.op("getBook")}(): Book; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(getBook); + + // The model should now be cached under the output key + const outputMutation = engine.mutateModel(Book, GraphQLTypeContext.Output); + expect(outputMutation.typeContext).toBe(GraphQLTypeContext.Output); + }); + + it("creates separate variants when model is used as both param and return", async () => { + const { Book, createBook } = await tester.compile( + t.code` + model ${t.model("Book")} { title: string; } + op ${t.op("createBook")}(input: Book): Book; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(createBook); + + const inputMutation = engine.mutateModel(Book, GraphQLTypeContext.Input); + const outputMutation = engine.mutateModel(Book, GraphQLTypeContext.Output); + + expect(inputMutation).not.toBe(outputMutation); + expect(inputMutation.typeContext).toBe(GraphQLTypeContext.Input); + expect(outputMutation.typeContext).toBe(GraphQLTypeContext.Output); + }); + + it("propagates input context to nested models", async () => { + const { Author, createBook } = await tester.compile( + t.code` + model ${t.model("Author")} { name: string; } + model ${t.model("Book")} { title: string; author: Author; } + op ${t.op("createBook")}(input: Book): void; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(createBook); + + // Author should also be cached under input context via Book's property + const authorInput = engine.mutateModel(Author, GraphQLTypeContext.Input); + expect(authorInput.typeContext).toBe(GraphQLTypeContext.Input); + }); + + it("propagates output context to nested models", async () => { + const { Author, getBook } = await tester.compile( + t.code` + model ${t.model("Author")} { name: string; } + model ${t.model("Book")} { title: string; author: Author; } + op ${t.op("getBook")}(): Book; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(getBook); + + const authorOutput = engine.mutateModel(Author, GraphQLTypeContext.Output); + expect(authorOutput.typeContext).toBe(GraphQLTypeContext.Output); + }); + + it("replaces union parameter with oneOf model via operation mutation", async () => { + const { Pet, createPet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + op ${t.op("createPet")}(input: Pet): void; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(createPet); + + // The union should be cached under input context and replaced with a oneOf model + const unionMutation = engine.mutateUnion(Pet, GraphQLTypeContext.Input); + expect(unionMutation.mutatedType.kind).toBe("Model"); + expect(unionMutation.mutatedType.name).toBe("PetInput"); + expect(isOneOf(tester.program, unionMutation.mutatedType as Model)).toBe(true); + }); + + it("keeps union return type as union via operation mutation", async () => { + const { Pet, getPet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + op ${t.op("getPet")}(): Pet; + `, + ); + + const engine = createTestEngine(tester.program); + engine.mutateOperation(getPet); + + // The union in output context stays a union (not replaced) + const unionMutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + expect(unionMutation.mutatedType.kind).toBe("Union"); + }); +}); diff --git a/packages/graphql/test/mutation-engine/enums.test.ts b/packages/graphql/test/mutation-engine/enums.test.ts new file mode 100644 index 00000000000..615948dbd35 --- /dev/null +++ b/packages/graphql/test/mutation-engine/enums.test.ts @@ -0,0 +1,94 @@ +import type { EnumMember } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Enums", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("leaves valid enum names alone", async () => { + const { ValidEnum } = await tester.compile( + t.code`enum ${t.enum("ValidEnum")} { + Value + }`, + ); + + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(ValidEnum).mutatedType; + + expect(mutated.name).toBe("ValidEnum"); + }); + + it("renames invalid enum names", async () => { + await tester.compile(` + enum \`$Invalid$\` { + Value + } + `); + + const InvalidEnum = tester.program.getGlobalNamespaceType().enums.get("$Invalid$")!; + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(InvalidEnum).mutatedType; + + expect(mutated.name).toBe("_Invalid"); + }); + + it("processes enum members through sanitization", async () => { + const { MyEnum } = await tester.compile( + t.code`enum ${t.enum("MyEnum")} { + ValidMember + }`, + ); + + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(MyEnum).mutatedType; + + expect(mutated.name).toBe("MyEnum"); + expect(mutated.members.has("VALID_MEMBER")).toBe(true); + }); +}); + +describe("GraphQL Mutation Engine - Enum Members", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("leaves valid enum member names alone", async () => { + const { MyEnum } = await tester.compile( + t.code`enum ${t.enum("MyEnum")} { + ${t.enumMember("ValidMember")} + }`, + ); + + // Mutate the enum and check the member via the enum's mutation + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(MyEnum).mutatedType; + const member = mutated.members.get("VALID_MEMBER"); + + expect(member?.name).toBe("VALID_MEMBER"); + }); + + it("renames invalid enum member names", async () => { + const { MyEnum } = await tester.compile( + t.code`enum ${t.enum("MyEnum")} { + \`$Value$\` + }`, + ); + + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(MyEnum).mutatedType; + + // Check that the member was renamed in the mutated enum + const member = Array.from(mutated.members.values())[0] as EnumMember; + expect(member.name).toBe("_VALUE"); + }); +}); diff --git a/packages/graphql/test/mutation-engine/models.test.ts b/packages/graphql/test/mutation-engine/models.test.ts new file mode 100644 index 00000000000..5f418682cd8 --- /dev/null +++ b/packages/graphql/test/mutation-engine/models.test.ts @@ -0,0 +1,255 @@ +import { isArrayModelType, type Model } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Models", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("leaves valid model names alone", async () => { + const { ValidModel } = await tester.compile(t.code`model ${t.model("ValidModel")} { }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(ValidModel, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.name).toBe("ValidModel"); + }); + + it("renames invalid model names", async () => { + await tester.compile(`model \`$Invalid$\` { x: string; }`); + + const InvalidModel = tester.program.getGlobalNamespaceType().models.get("$Invalid$")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(InvalidModel, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.name).toBe("_Invalid"); + }); + + it("processes model properties through sanitization", async () => { + const { TestModel } = await tester.compile( + t.code`model ${t.model("TestModel")} { validProp: string }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(TestModel, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.name).toBe("TestModel"); + expect(mutation.mutatedType.properties.has("validProp")).toBe(true); + }); +}); + +describe("GraphQL Mutation Engine - Record-to-Scalar", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("replaces named Record model with a scalar", async () => { + const { Metadata } = await tester.compile( + t.code`model ${t.model("Metadata")} is Record;`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Metadata, GraphQLTypeContext.Output); + + expect(mutation.mutationNode.isReplaced).toBe(true); + const resolved = mutation.mutationNode.replacementNode!.mutatedType; + expect(resolved).toHaveProperty("kind", "Scalar"); + expect(resolved).toHaveProperty("name", "Metadata"); + }); + + it("produces same scalar name for Record in both input and output contexts", async () => { + const { Metadata } = await tester.compile( + t.code`model ${t.model("Metadata")} is Record;`, + ); + + const engine = createTestEngine(tester.program); + const outputMutation = engine.mutateModel(Metadata, GraphQLTypeContext.Output); + const inputMutation = engine.mutateModel(Metadata, GraphQLTypeContext.Input); + + const outputScalar = outputMutation.mutationNode.replacementNode!.mutatedType; + const inputScalar = inputMutation.mutationNode.replacementNode!.mutatedType; + + // Both should produce the same scalar name - no Input suffix for Records + expect(outputScalar).toHaveProperty("name", "Metadata"); + expect(inputScalar).toHaveProperty("name", "Metadata"); + }); + + it("replaces Record model with scalar even through T | null unwrap", async () => { + const { Foo } = await tester.compile( + t.code` + model ${t.model("Metadata")} is Record; + model ${t.model("Foo")} { data: Metadata | null; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const dataProp = mutation.mutatedType.properties.get("data")!; + // After T|null unwrap + Record mutation, should be a Scalar + expect(dataProp.type).toHaveProperty("kind", "Scalar"); + expect(dataProp.type).toHaveProperty("name", "Metadata"); + }); + + it("does not replace Record model that has named properties", async () => { + const { Config } = await tester.compile( + t.code`model ${t.model("Config")} { debug: boolean; ...Record; }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Config, GraphQLTypeContext.Output); + + expect(mutation.mutationNode.isReplaced).toBe(false); + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("Config"); + }); +}); + +describe("GraphQL Mutation Engine - Inner Nullable Array Fix", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("unwraps inner nullable union in array element for (T | null)[] | null", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: (string | null)[] | null; }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const tagsProp = mutation.mutatedType.properties.get("tags")!; + expect(tagsProp.type.kind).toBe("Model"); + // The array's indexer value should be the unwrapped scalar, not a T | null union + const arrayModel = tagsProp.type as Model; + expect(isArrayModelType(arrayModel)).toBe(true); + expect(arrayModel.indexer!.value.kind).toBe("Scalar"); + }); +}); + +describe("GraphQL Mutation Engine - Model Properties", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("leaves valid property names alone", async () => { + const { M } = await tester.compile( + t.code`model ${t.model("M")} { ${t.modelProperty("prop")}: string }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(M, GraphQLTypeContext.Output); + const prop = mutation.mutatedType.properties.get("prop"); + + expect(prop?.name).toBe("prop"); + }); + + it("renames invalid property names", async () => { + const { M } = await tester.compile(t.code`model ${t.model("M")} { \`$prop$\`: string }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(M, GraphQLTypeContext.Output); + + // Check that the property was renamed in the mutated model + expect(mutation.mutatedType.properties.has("_prop")).toBe(true); + expect(mutation.mutatedType.properties.has("$prop$")).toBe(false); + }); +}); + +describe("GraphQL Mutation Engine - Edge Cases", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("handles model with multiple invalid properties", async () => { + const { M } = await tester.compile( + t.code`model ${t.model("M")} { + \`$prop1$\`: string; + \`prop-2\`: int32; + \`prop.3\`: boolean; + }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(M, GraphQLTypeContext.Output); + const mutated = mutation.mutatedType; + + expect(mutated.properties.has("_prop1")).toBe(true); + expect(mutated.properties.has("prop_2")).toBe(true); + expect(mutated.properties.has("prop_3")).toBe(true); + expect(mutated.properties.has("$prop1$")).toBe(false); + expect(mutated.properties.has("prop-2")).toBe(false); + expect(mutated.properties.has("prop.3")).toBe(false); + }); + + it("handles enum with multiple invalid members", async () => { + const { E } = await tester.compile( + t.code`enum ${t.enum("E")} { + \`$val1$\`, + \`val-2\`, + \`val.3\` + }`, + ); + + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(E).mutatedType; + + expect(mutated.members.has("_VAL_1")).toBe(true); + expect(mutated.members.has("VAL_2")).toBe(true); + expect(mutated.members.has("VAL_3")).toBe(true); + }); + + it("preserves valid underscore-prefixed names", async () => { + const { _ValidName } = await tester.compile(t.code`model ${t.model("_ValidName")} { }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(_ValidName, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.name).toBe("_ValidName"); + }); + + it("preserves names with numbers in the middle", async () => { + const { Model123 } = await tester.compile(t.code`model ${t.model("Model123")} { }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Model123, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.name).toBe("Model123"); + }); + + it("handles property names starting with numbers", async () => { + const { M } = await tester.compile(t.code`model ${t.model("M")} { \`123prop\`: string; }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(M, GraphQLTypeContext.Output); + const mutated = mutation.mutatedType; + + expect(mutated.properties.has("_123prop")).toBe(true); + expect(mutated.properties.has("123prop")).toBe(false); + }); + + it("handles enum member names starting with numbers", async () => { + const { E } = await tester.compile(t.code`enum ${t.enum("E")} { \`123value\` }`); + + const engine = createTestEngine(tester.program); + const mutated = engine.mutateEnum(E).mutatedType; + + expect(mutated.members.has("_123_VALUE")).toBe(true); + expect(mutated.members.has("123value")).toBe(false); + }); +}); diff --git a/packages/graphql/test/mutation-engine/naming-integration.test.ts b/packages/graphql/test/mutation-engine/naming-integration.test.ts new file mode 100644 index 00000000000..f9346f6adae --- /dev/null +++ b/packages/graphql/test/mutation-engine/naming-integration.test.ts @@ -0,0 +1,121 @@ +import type { Model } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +describe("Mutation Engine - Naming Pipelines", () => { + let tester: TesterInstance; + + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + describe("Model naming", () => { + it("PascalCases model names", async () => { + await tester.compile(`model ad_account { id: string; }`); + const model = tester.program.getGlobalNamespaceType().models.get("ad_account")!; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(model, GraphQLTypeContext.Output); + + expect(mutated.mutatedType.name).toBe("AdAccount"); + }); + + it("appends Input suffix for input context", async () => { + await tester.compile(`model User { id: string; }`); + const model = tester.program.getGlobalNamespaceType().models.get("User")!; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(model, GraphQLTypeContext.Input); + + expect(mutated.mutatedType.name).toBe("UserInput"); + }); + + it("PascalCases before appending Input suffix", async () => { + await tester.compile(`model ad_account { id: string; }`); + const model = tester.program.getGlobalNamespaceType().models.get("ad_account")!; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(model, GraphQLTypeContext.Input); + + expect(mutated.mutatedType.name).toBe("AdAccountInput"); + }); + + it("composes template names", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Board { id: string; } + model PaginatedModel { items: T[]; } + op get(): PaginatedModel; + } + `); + + const op = TestNs.operations.get("get")!; + const templateInstance = op.returnType as Model; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(templateInstance, GraphQLTypeContext.Output); + + expect(mutated.mutatedType.name).toBe("PaginatedModelOfBoard"); + }); + }); + + describe("ModelProperty naming", () => { + it("camelCases property names", async () => { + await tester.compile(`model Foo { ad_account_id: string; }`); + const model = tester.program.getGlobalNamespaceType().models.get("Foo")!; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(model, GraphQLTypeContext.Output); + + const propNames = Array.from(mutated.mutatedType.properties.values()).map((p) => p.name); + expect(propNames).toContain("adAccountId"); + }); + }); + + describe("Enum naming", () => { + it("PascalCases enum names", async () => { + await tester.compile(`enum my_status { Active }`); + const enumType = tester.program.getGlobalNamespaceType().enums.get("my_status")!; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(enumType); + + expect(mutated.mutatedType.name).toBe("MyStatus"); + }); + }); + + describe("EnumMember naming", () => { + it("CONSTANT_CASEs enum member names", async () => { + await tester.compile(`enum Status { activeStatus, inactiveStatus }`); + const enumType = tester.program.getGlobalNamespaceType().enums.get("Status")!; + + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateEnum(enumType); + + const memberNames = Array.from(mutated.mutatedType.members.values()).map((m) => m.name); + expect(memberNames).toContain("ACTIVE_STATUS"); + expect(memberNames).toContain("INACTIVE_STATUS"); + }); + }); + + describe("Operation naming", () => { + it("camelCases operation names", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + op get_user(): string; + } + `); + + const op = TestNs.operations.get("get_user")!; + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateOperation(op); + + expect(mutated.mutatedType.name).toBe("getUser"); + }); + }); +}); diff --git a/packages/graphql/test/mutation-engine/operations.test.ts b/packages/graphql/test/mutation-engine/operations.test.ts new file mode 100644 index 00000000000..7c8f3bf46d3 --- /dev/null +++ b/packages/graphql/test/mutation-engine/operations.test.ts @@ -0,0 +1,77 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { isNullable } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Operations", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("leaves valid operation names alone", async () => { + const { ValidOp } = await tester.compile(t.code`op ${t.op("ValidOp")}(): void;`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateOperation(ValidOp); + + expect(mutation.mutatedType.name).toBe("validOp"); + }); + + it("renames invalid operation names", async () => { + await tester.compile(`op \`$Do$\`(): void;`); + + const DoOp = tester.program.getGlobalNamespaceType().operations.get("$Do$")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateOperation(DoOp); + + expect(mutation.mutatedType.name).toBe("_do"); + }); + + it("renames operation names with hyphens", async () => { + await tester.compile(`op \`get-data\`(): void;`); + + const GetDataOp = tester.program.getGlobalNamespaceType().operations.get("get-data")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateOperation(GetDataOp); + + expect(mutation.mutatedType.name).toBe("getData"); + }); + + it("marks operation as nullable when return type is T | null", async () => { + const { getUser } = await tester.compile( + t.code` + model ${t.model("User")} { name: string; } + op ${t.op("getUser")}(): User | null; + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateOperation(getUser); + + // The return type should be unwrapped to the inner type + expect(mutation.mutatedType.returnType.kind).toBe("Model"); + // The operation itself should be marked nullable + expect(isNullable(tester.program, mutation.mutatedType)).toBe(true); + }); + + it("does not mark operation as nullable when return type is non-null", async () => { + const { getUser } = await tester.compile( + t.code` + model ${t.model("User")} { name: string; } + op ${t.op("getUser")}(): User; + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateOperation(getUser); + + expect(mutation.mutatedType.returnType.kind).toBe("Model"); + expect(isNullable(tester.program, mutation.mutatedType)).toBe(false); + }); +}); diff --git a/packages/graphql/test/mutation-engine/print-type.test.ts b/packages/graphql/test/mutation-engine/print-type.test.ts new file mode 100644 index 00000000000..b641f815e63 --- /dev/null +++ b/packages/graphql/test/mutation-engine/print-type.test.ts @@ -0,0 +1,107 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { printMutatedType } from "../../src/mutation-engine/print-type.js"; +import { Tester } from "../test-host.js"; + +describe("printMutatedType", () => { + let tester: TesterInstance; + + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("required string → String!", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { name: string; }`); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("name")!; + expect(printMutatedType(tester.program, prop)).toBe("String!"); + }); + + it("optional string → String", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { name?: string; }`); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("name")!; + expect(printMutatedType(tester.program, prop)).toBe("String"); + }); + + it("string | null → String", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { name: string | null; }`); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("name")!; + expect(printMutatedType(tester.program, prop)).toBe("String"); + }); + + it("required string[] → [String!]!", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { tags: string[]; }`); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, prop)).toBe("[String!]!"); + }); + + it("optional string[] → [String!]", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { tags?: string[]; }`); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, prop)).toBe("[String!]"); + }); + + it("(string | null)[] → [String]!", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: (string | null)[]; }`, + ); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, prop)).toBe("[String]!"); + }); + + it("string[] | null → [String!]", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: string[] | null; }`, + ); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, prop)).toBe("[String!]"); + }); + + it("(string | null)[] | null → [String]", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: (string | null)[] | null; }`, + ); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, prop)).toBe("[String]"); + }); + + it("required model type → ModelName!", async () => { + const { Foo } = await tester.compile( + t.code` + model ${t.model("Bar")} { id: string; } + model ${t.model("Foo")} { bar: Bar; } + `, + ); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("bar")!; + expect(printMutatedType(tester.program, prop)).toBe("Bar!"); + }); + + it("required int32 → Int!", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { count: int32; }`); + const engine = createGraphQLMutationEngine(tester.program); + const mutated = engine.mutateModel(Foo, GraphQLTypeContext.Output); + const prop = mutated.mutatedType.properties.get("count")!; + expect(printMutatedType(tester.program, prop)).toBe("Int!"); + }); +}); diff --git a/packages/graphql/test/mutation-engine/scalars.test.ts b/packages/graphql/test/mutation-engine/scalars.test.ts new file mode 100644 index 00000000000..bf4b0e0d19c --- /dev/null +++ b/packages/graphql/test/mutation-engine/scalars.test.ts @@ -0,0 +1,194 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { getSpecifiedBy } from "../../src/lib/specified-by.js"; +import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Scalars", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("leaves valid scalar names alone", async () => { + const { ValidScalar } = await tester.compile( + t.code`scalar ${t.scalar("ValidScalar")} extends string;`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(ValidScalar); + + expect(mutation.mutatedType.name).toBe("ValidScalar"); + }); + + it("renames invalid scalar names", async () => { + await tester.compile(t.code`scalar ${t.scalar("$Invalid$")} extends string;`); + + const InvalidScalar = tester.program.getGlobalNamespaceType().scalars.get("$Invalid$")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(InvalidScalar); + + expect(mutation.mutatedType.name).toBe("_Invalid"); + }); + + it("has no @specifiedBy when decorator is not applied", async () => { + const { MyScalar } = await tester.compile( + t.code`scalar ${t.scalar("MyScalar")} extends string;`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(MyScalar); + + expect(getSpecifiedBy(tester.program, mutation.mutatedType)).toBeUndefined(); + }); + + it("applies @specifiedBy from decorator to mutated scalar", async () => { + const { MyScalar } = await tester.compile( + t.code` + @specifiedBy("https://example.com/my-scalar-spec") + scalar ${t.scalar("MyScalar")} extends string; + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(MyScalar); + + expect(getSpecifiedBy(tester.program, mutation.mutatedType)).toBe( + "https://example.com/my-scalar-spec", + ); + }); + + it("inherits @specifiedBy from mapped ancestor via extends chain", async () => { + const { MyDate } = await tester.compile( + t.code` + @encode("rfc3339") + scalar ${t.scalar("MyDate")} extends utcDateTime; + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(MyDate); + + // User-defined name is preserved (sanitized), not replaced with mapping's graphqlName + expect(mutation.mutatedType.name).toBe("MyDate"); + // @specifiedBy inherited from utcDateTime's rfc3339 mapping + expect(getSpecifiedBy(tester.program, mutation.mutatedType)).toBe( + "https://scalars.graphql.org/chillicream/date-time.html", + ); + }); + + it("strips baseScalar from user-defined scalars", async () => { + const { MyScalar } = await tester.compile( + t.code`scalar ${t.scalar("MyScalar")} extends string;`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(MyScalar); + + expect(mutation.mutatedType.baseScalar).toBeUndefined(); + }); + + it("explicit @specifiedBy wins over inherited mapping", async () => { + const { MyDate } = await tester.compile( + t.code` + @encode("rfc3339") + @specifiedBy("https://example.com/custom-spec") + scalar ${t.scalar("MyDate")} extends utcDateTime; + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(MyDate); + + expect(getSpecifiedBy(tester.program, mutation.mutatedType)).toBe( + "https://example.com/custom-spec", + ); + }); + + it("maps scalar extending GraphQL.ID to built-in ID type", async () => { + const { MyId } = await tester.compile(t.code`scalar ${t.scalar("MyId")} extends GraphQL.ID;`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(MyId); + + expect(mutation.mutatedType.name).toBe("ID"); + }); + + it("maps multi-hop extends chain through GraphQL.ID to built-in ID type", async () => { + const { SubId } = await tester.compile( + t.code` + scalar MyId extends GraphQL.ID; + scalar ${t.scalar("SubId")} extends MyId; + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateScalar(SubId); + + expect(mutation.mutatedType.name).toBe("ID"); + }); + + it("does not rename builtin std scalars even when they inherit a mapping", async () => { + // float32 inherits a mapping via float → numeric → "Numeric", but it's a + // GraphQL builtin (maps to Float) and must never be renamed. + const { M } = await tester.compile(t.code`model ${t.model("M")} { value: float32; }`); + + const engine = createTestEngine(tester.program); + const float32Scalar = M.properties.get("value")!.type; + expect(float32Scalar.kind).toBe("Scalar"); + const mutation = engine.mutateScalar(float32Scalar as any); + + expect(mutation.mutatedType.name).toBe("float32"); + }); + + it("does not rename float64 builtin scalar", async () => { + const { M } = await tester.compile(t.code`model ${t.model("M")} { value: float64; }`); + + const engine = createTestEngine(tester.program); + const float64Scalar = M.properties.get("value")!.type; + expect(float64Scalar.kind).toBe("Scalar"); + const mutation = engine.mutateScalar(float64Scalar as any); + + expect(mutation.mutatedType.name).toBe("float64"); + }); + + it("does not rename int32 builtin scalar", async () => { + const { M } = await tester.compile(t.code`model ${t.model("M")} { count: int32; }`); + + const engine = createTestEngine(tester.program); + const int32Scalar = M.properties.get("count")!.type; + expect(int32Scalar.kind).toBe("Scalar"); + const mutation = engine.mutateScalar(int32Scalar as any); + + expect(mutation.mutatedType.name).toBe("int32"); + }); + + it("does not rename std scalars like int64 - fallback mapping is applied at print time", async () => { + const { M } = await tester.compile(t.code`model ${t.model("M")} { big: int64; }`); + + const engine = createTestEngine(tester.program); + const int64Scalar = M.properties.get("big")!.type; + expect(int64Scalar.kind).toBe("Scalar"); + const mutation = engine.mutateScalar(int64Scalar as any); + + // Std scalars keep their original name; fallback mapping (int64 → String) is applied in resolveGraphQLTypeName + expect(mutation.mutatedType.name).toBe("int64"); + }); + + it("warns when user-defined scalar collides with GraphQL built-in name", async () => { + const { Float } = await tester.compile(t.code`scalar ${t.scalar("Float")} extends string;`); + + const engine = createTestEngine(tester.program); + engine.mutateScalar(Float); + + const warnings = tester.program.diagnostics.filter( + (d) => d.code === "@typespec/graphql/graphql-builtin-scalar-collision", + ); + expect(warnings.length).toBe(1); + expect(warnings[0].message).toContain("Float"); + }); +}); diff --git a/packages/graphql/test/mutation-engine/schema-mutator.test.ts b/packages/graphql/test/mutation-engine/schema-mutator.test.ts new file mode 100644 index 00000000000..2e2b166c15c --- /dev/null +++ b/packages/graphql/test/mutation-engine/schema-mutator.test.ts @@ -0,0 +1,291 @@ +import type { Model } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { isInputType } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js"; +import { mutateSchema } from "../../src/mutation-engine/schema-mutator.js"; +import { resolveTypeUsage } from "../../src/type-usage.js"; +import { Tester } from "../test-host.js"; + +describe("mutateSchema", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("produces a TypeGraph with mutated models", async () => { + await tester.compile(` + model ad_account { id: int32; } + op getAccount(): ad_account; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.models.has("AdAccount")).toBe(true); + }); + + it("produces a TypeGraph with mutated operations", async () => { + await tester.compile(` + op get_items(): string; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.operations.has("getItems")).toBe(true); + }); + + it("produces a TypeGraph with mutated enums", async () => { + await tester.compile(` + enum status { active, inactive } + model Foo { s: status; } + op getFoo(): Foo; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.enums.has("Status")).toBe(true); + }); + + it("produces a TypeGraph with mutated unions", async () => { + await tester.compile(` + model Cat { name: string; } + model Dog { breed: string; } + union Pet { cat: Cat; dog: Dog; } + op getPet(): Pet; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.unions.has("Pet")).toBe(true); + }); + + it("skips unreachable types when omitUnreachableTypes is true", async () => { + await tester.compile(` + model Reachable { x: int32; } + model Unreachable { y: string; } + op getReachable(): Reachable; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, true); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.models.has("Reachable")).toBe(true); + expect(typeGraph.globalNamespace.models.has("Unreachable")).toBe(false); + }); + + it("includes all declared types when omitUnreachableTypes is false", async () => { + await tester.compile(` + model Reachable { x: int32; } + model Unreachable { y: string; } + op getReachable(): Reachable; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.models.has("Reachable")).toBe(true); + expect(typeGraph.globalNamespace.models.has("Unreachable")).toBe(true); + }); + + it("T | null unions do not appear in the TypeGraph (engine replaces with inner type)", async () => { + await tester.compile(` + union MaybeString { string, null } + model Foo { x: int32; } + op getFoo(): Foo; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + // MaybeString is T | null — should NOT appear as a union in the TypeGraph + expect(typeGraph.globalNamespace.unions.has("MaybeString")).toBe(false); + }); + + it("includes wrapper models from union scalar variants", async () => { + await tester.compile(` + model Cat { name: string; } + union Mixed { cat: Cat; text: string; num: int32; } + op getMixed(): Mixed; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + // Scalar variants get wrapper models registered in the TypeGraph + expect(typeGraph.globalNamespace.models.has("MixedTextUnionVariant")).toBe(true); + expect(typeGraph.globalNamespace.models.has("MixedNumUnionVariant")).toBe(true); + }); + + it("produces Input variant for models used as operation parameters", async () => { + await tester.compile(` + model Book { title: string; } + op getBooks(): Book[]; + op createBook(input: Book): Book; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + // Book is used as both output (return) and input (parameter), + // so both variants should appear in the TypeGraph + expect(typeGraph.globalNamespace.models.has("Book")).toBe(true); + expect(typeGraph.globalNamespace.models.has("BookInput")).toBe(true); + }); + + it("does not produce Input variant for output-only models", async () => { + await tester.compile(` + model Book { title: string; } + op getBooks(): Book[]; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + expect(typeGraph.globalNamespace.models.has("Book")).toBe(true); + expect(typeGraph.globalNamespace.models.has("BookInput")).toBe(false); + }); + + it("does not produce Output variant for input-only models", async () => { + await tester.compile(` + model Book { title: string; } + model Payload { title: string; } + op getBooks(): Book[]; + op createBook(input: Payload): Book; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, true); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + // Payload is only used as input — should only appear as Input variant (PayloadInput) + expect(typeGraph.globalNamespace.models.has("PayloadInput")).toBe(true); + // Should NOT have an Output variant + expect(typeGraph.globalNamespace.models.has("Payload")).toBe(false); + }); + + it("marks input models with isInputType decorator", async () => { + await tester.compile(` + model Book { title: string; } + op getBooks(): Book[]; + op createBook(input: Book): Book; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + const bookOutput = typeGraph.globalNamespace.models.get("Book")!; + const bookInput = typeGraph.globalNamespace.models.get("BookInput")!; + + expect(isInputType(tester.program, bookOutput)).toBe(false); + expect(isInputType(tester.program, bookInput)).toBe(true); + }); + + it("mutateDecoratorTypeArgs does not corrupt source type decorator args", async () => { + const { Cat } = await tester.compile( + t.code` + @graphqlInterface model Animal { name: string; } + @compose(Animal) + model ${t.model("Cat")} { name: string; breed: string; } + op getCat(): Cat; + op createCat(input: Cat): Cat; + `, + ); + + const sourceComposeArg = (Cat as Model).decorators.find((d) => d.decorator.name === "$compose") + ?.args[0]; + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, true); + const engine = createGraphQLMutationEngine(tester.program); + mutateSchema(tester.program, engine, ns, typeUsage); + + // Source type's decorator args must not be modified by mutation + expect((sourceComposeArg!.value as any).name).toBe("Animal"); + }); + + it("interfaceOnly @graphqlInterface model used as output does not produce name collision", async () => { + await tester.compile(` + @graphqlInterface(#{interfaceOnly: true}) model Node { id: string; } + op getNode(): Node; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, true); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + // Exclusive interface: only Interface variant emitted (no suffix → "Node") + // Should NOT also emit an Output variant (which would also be "Node" → collision) + expect(typeGraph.globalNamespace.models.has("Node")).toBe(true); + const collisions = tester.program.diagnostics.filter( + (d) => d.code === "@typespec/graphql/type-name-collision", + ); + expect(collisions.length).toBe(0); + }); + + it("reports diagnostic when two types produce the same GraphQL name", async () => { + await tester.compileAndDiagnose(` + model BookInput { x: int32; } + model Book { title: string; } + op getBooks(): Book[]; + op createBook(input: Book): Book; + `); + + // Book used as input → Input mutation → "BookInput" + // BookInput declared explicitly → Output mutation → "BookInput" + // This should produce a collision diagnostic + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + mutateSchema(tester.program, engine, ns, typeUsage); + + const collisions = tester.program.diagnostics.filter( + (d) => d.code === "@typespec/graphql/type-name-collision", + ); + expect(collisions.length).toBeGreaterThan(0); + }); + + it("skips array models (they are list types, not object types)", async () => { + await tester.compile(` + model Item { name: string; } + op getItems(): Item[]; + `); + + const ns = tester.program.getGlobalNamespaceType(); + const typeUsage = resolveTypeUsage(tester.program, ns, false); + const engine = createGraphQLMutationEngine(tester.program); + const typeGraph = mutateSchema(tester.program, engine, ns, typeUsage); + + // Item should be in the graph, but the Array model should NOT + expect(typeGraph.globalNamespace.models.has("Item")).toBe(true); + const modelNames = [...typeGraph.globalNamespace.models.keys()]; + expect(modelNames.every((n) => !n.includes("Array"))).toBe(true); + }); +}); diff --git a/packages/graphql/test/mutation-engine/type-graph.test.ts b/packages/graphql/test/mutation-engine/type-graph.test.ts new file mode 100644 index 00000000000..0f8a28dc8dc --- /dev/null +++ b/packages/graphql/test/mutation-engine/type-graph.test.ts @@ -0,0 +1,200 @@ +import { navigateTypesInNamespace, resolvePath } from "@typespec/compiler"; +import { createTester, t, type TesterInstance } from "@typespec/compiler/testing"; +import { $ } from "@typespec/compiler/typekit"; +import { beforeEach, describe, expect, it } from "vitest"; +import { buildTypeGraph } from "../../src/mutation-engine/type-graph.js"; + +const Tester = createTester(resolvePath(import.meta.dirname, "../.."), { + libraries: [], +}); + +describe("buildTypeGraph", () => { + let tester: TesterInstance; + + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("produces a namespace containing the given types", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + } + `); + + const tk = $(tester.program); + const foo = TestNs.models.get("Foo")!; + const graph = buildTypeGraph(tester.program, tk, [foo]); + + expect(graph.globalNamespace.models.get("Foo")).toBe(foo); + }); + + it("sets .namespace on all types to the new namespace", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + model Bar { value: int32; } + } + `); + + const tk = $(tester.program); + const foo = TestNs.models.get("Foo")!; + const bar = TestNs.models.get("Bar")!; + const graph = buildTypeGraph(tester.program, tk, [foo, bar]); + + expect(foo.namespace).toBe(graph.globalNamespace); + expect(bar.namespace).toBe(graph.globalNamespace); + }); + + it("works with navigateTypesInNamespace", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + model Bar { value: int32; } + } + `); + + const tk = $(tester.program); + const foo = TestNs.models.get("Foo")!; + const bar = TestNs.models.get("Bar")!; + const graph = buildTypeGraph(tester.program, tk, [foo, bar]); + + const visitedModels: string[] = []; + navigateTypesInNamespace(graph.globalNamespace, { + model: (m) => visitedModels.push(m.name), + }); + + expect(visitedModels).toContain("Foo"); + expect(visitedModels).toContain("Bar"); + }); + + it("includes mutated types in the output", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + } + `); + + const tk = $(tester.program); + const originalFoo = TestNs.models.get("Foo")!; + + const mutatedFoo = tk.type.clone(originalFoo); + mutatedFoo.name = "FooRenamed"; + + const graph = buildTypeGraph(tester.program, tk, [mutatedFoo]); + + expect(graph.globalNamespace.models.get("FooRenamed")).toBe(mutatedFoo); + expect(mutatedFoo.namespace).toBe(graph.globalNamespace); + }); + + it("excludes types not in the output list", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + model Bar { value: int32; } + } + `); + + const tk = $(tester.program); + const bar = TestNs.models.get("Bar")!; + + const graph = buildTypeGraph(tester.program, tk, [bar]); + + expect(graph.globalNamespace.models.has("Foo")).toBe(false); + expect(graph.globalNamespace.models.has("Bar")).toBe(true); + }); + + it("handles all type kinds", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + enum Status { Active, Inactive } + union Pet { cat: string, dog: string } + scalar MyId extends string; + op doSomething(): void; + } + `); + + const tk = $(tester.program); + const foo = TestNs.models.get("Foo")!; + const status = TestNs.enums.get("Status")!; + const pet = TestNs.unions.get("Pet")!; + const myId = TestNs.scalars.get("MyId")!; + const doSomething = TestNs.operations.get("doSomething")!; + + const graph = buildTypeGraph(tester.program, tk, [foo, status, pet, myId, doSomething]); + + expect(graph.globalNamespace.models.has("Foo")).toBe(true); + expect(graph.globalNamespace.enums.has("Status")).toBe(true); + expect(graph.globalNamespace.unions.has("Pet")).toBe(true); + expect(graph.globalNamespace.scalars.has("MyId")).toBe(true); + expect(graph.globalNamespace.operations.has("doSomething")).toBe(true); + }); + + it("preserves decorators on types", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + @doc("A foo model") + model Foo { name: string; } + } + `); + + const tk = $(tester.program); + const foo = TestNs.models.get("Foo")!; + const graph = buildTypeGraph(tester.program, tk, [foo]); + + const outputFoo = graph.globalNamespace.models.get("Foo")!; + expect(outputFoo.decorators.length).toBeGreaterThan(0); + }); + + it("transitively registers union variant types", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Cat { meow: string; } + model Dog { bark: string; } + union Pet { cat: Cat, dog: Dog } + } + `); + + const tk = $(tester.program); + const pet = TestNs.unions.get("Pet")!; + + // Only pass the union, not the variant types directly + const graph = buildTypeGraph(tester.program, tk, [pet]); + + // Union should be registered + expect(graph.globalNamespace.unions.has("Pet")).toBe(true); + // Variant types should be transitively registered + expect(graph.globalNamespace.models.has("Cat")).toBe(true); + expect(graph.globalNamespace.models.has("Dog")).toBe(true); + }); + + it("supports chained stages", async () => { + const { TestNs } = await tester.compile(t.code` + namespace ${t.namespace("TestNs")} { + model Foo { name: string; } + } + `); + + const tk = $(tester.program); + const originalFoo = TestNs.models.get("Foo")!; + + const fooV1 = tk.type.clone(originalFoo); + fooV1.name = "FooV1"; + const graph1 = buildTypeGraph(tester.program, tk, [fooV1]); + + const stage2Input = graph1.globalNamespace.models.get("FooV1")!; + const fooV2 = tk.type.clone(stage2Input); + fooV2.name = "FooV2"; + const graph2 = buildTypeGraph(tester.program, tk, [fooV2]); + + expect(graph2.globalNamespace.models.has("FooV2")).toBe(true); + expect(graph2.globalNamespace).not.toBe(graph1.globalNamespace); + + const visited: string[] = []; + navigateTypesInNamespace(graph2.globalNamespace, { + model: (m) => visited.push(m.name), + }); + expect(visited).toContain("FooV2"); + }); +}); diff --git a/packages/graphql/test/mutation-engine/unions.test.ts b/packages/graphql/test/mutation-engine/unions.test.ts new file mode 100644 index 00000000000..2873818c00a --- /dev/null +++ b/packages/graphql/test/mutation-engine/unions.test.ts @@ -0,0 +1,579 @@ +import { getDoc, type Model, type Union } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { isNullable, isOneOf } from "../../generated-defs/TypeSpec.GraphQL.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { printMutatedType } from "../../src/mutation-engine/print-type.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Unions", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("replaces nullable scalar union with inner type", async () => { + const { NullableString } = await tester.compile( + t.code`union ${t.union("NullableString")} { string, null }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(NullableString, GraphQLTypeContext.Output); + + // T | null is replaced with the inner type (string scalar) + expect(mutation.mutatedType.kind).toBe("Scalar"); + expect(mutation.wrapperModels).toHaveLength(0); + // The replacement type is NOT marked nullable — nullability for inline T | null + // is tracked on the model property, not the shared scalar singleton. + expect(isNullable(tester.program, mutation.mutatedType)).toBe(false); + }); + + it("replaces nullable model union with inner type", async () => { + const { MaybeDog } = await tester.compile( + t.code` + model ${t.model("Dog")} { breed: string; } + union ${t.union("MaybeDog")} { Dog, null } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(MaybeDog, GraphQLTypeContext.Output); + + // Dog | null is replaced with the inner type (Dog model) + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.wrapperModels).toHaveLength(0); + // The replacement type is NOT marked nullable — nullability for inline T | null + // is tracked on the model property, not the shared type. + expect(isNullable(tester.program, mutation.mutatedType)).toBe(false); + }); + + it("creates wrapper models for scalar variants", async () => { + const { Mixed } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Mixed")} { cat: Cat; text: string; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Mixed, GraphQLTypeContext.Output); + + // Only the scalar variant (string) should get a wrapper + expect(mutation.wrapperModels).toHaveLength(1); + expect(mutation.wrapperModels[0].name).toBe("MixedTextUnionVariant"); + }); + + it("substitutes wrapper models into union variant types", async () => { + const { Mixed } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Mixed")} { cat: Cat; text: string; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Mixed, GraphQLTypeContext.Output); + const mutatedUnion = mutation.mutatedType as Union; + + const variants = [...mutatedUnion.variants.values()]; + expect(variants).toHaveLength(2); + + // Model variant points to the mutated model + const catVariant = variants.find((v) => v.name === "cat")!; + expect(catVariant.type.kind).toBe("Model"); + expect((catVariant.type as Model).name).toBe("Cat"); + + // Scalar variant points to the wrapper model, not the raw scalar + const textVariant = variants.find((v) => v.name === "text")!; + expect(textVariant.type.kind).toBe("Model"); + expect((textVariant.type as Model).name).toBe("MixedTextUnionVariant"); + }); + + it("does not create wrappers for model-only unions", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + + expect(mutation.wrapperModels).toHaveLength(0); + }); + + it("collapses single-scalar-variant union to the scalar type", async () => { + const { Data } = await tester.compile(t.code`union ${t.union("Data")} { text: string; }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Data, GraphQLTypeContext.Output); + + // Single variant → collapsed to the scalar directly (no union or wrapper) + expect(mutation.mutatedType.kind).toBe("Scalar"); + expect(mutation.wrapperModels).toHaveLength(0); + }); + + it("creates wrappers for multiple scalar variants", async () => { + const { Mixed } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Mixed")} { cat: Cat; text: string; count: int32; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Mixed, GraphQLTypeContext.Output); + + expect(mutation.wrapperModels).toHaveLength(2); + const names = mutation.wrapperModels.map((m) => m.name).sort(); + expect(names).toEqual(["MixedCountUnionVariant", "MixedTextUnionVariant"]); + + // All union variants point to Models (originals or wrappers) + const mutatedUnion = mutation.mutatedType as Union; + const variants = [...mutatedUnion.variants.values()]; + for (const variant of variants) { + expect(variant.type.kind).toBe("Model"); + } + }); + + it("names anonymous return type union as OperationUnion", async () => { + await tester.compile(` + model Foo { x: int32; } + model Bar { y: string; } + op getBaz(): Foo | Bar; + `); + + const getBaz = tester.program.getGlobalNamespaceType().operations.get("getBaz")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(getBaz.returnType as Union, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.kind).toBe("Union"); + expect((mutation.mutatedType as Union).name).toBe("GetBazUnion"); + }); + + it("names anonymous union on model property as ModelPropertyUnion", async () => { + const { Foo } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + model ${t.model("Foo")} { pet: Cat | Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const petProp = mutation.mutatedType.properties.get("pet")!; + expect(petProp.type.kind).toBe("Union"); + expect((petProp.type as Union).name).toBe("FooPetUnion"); + }); + + it("collapses union to single type after flattening deduplicates to one variant", async () => { + const { Outer } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Inner")} { a: Cat; } + union ${t.union("Outer")} { inner: Inner; cat: Cat; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Outer, GraphQLTypeContext.Output); + + // Inner flattens to Cat, Outer's cat is also Cat → dedup → 1 variant → collapse + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("Cat"); + }); + + it("flattened union variant types get their mutation pipeline applied", async () => { + await tester.compile(` + model ad_account { id: int32; } + model board { title: string; } + union Mixed { a: ad_account; b: board; null; } + `); + + const Mixed = tester.program.getGlobalNamespaceType().unions.get("Mixed")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Mixed, GraphQLTypeContext.Output); + + // After null-strip + flattening, variants should have mutated names + const mutatedUnion = mutation.mutatedType as Union; + const variantNames = [...mutatedUnion.variants.values()] + .map((v) => ("name" in v.type ? v.type.name : v.type.kind)) + .sort(); + expect(variantNames).toEqual(["AdAccount", "Board"]); + }); + + it("preserves decorator state (e.g. @doc) on flattened unions", async () => { + const { MaybePet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + /** A pet or nothing */ + union ${t.union("MaybePet")} { cat: Cat; dog: Dog; null; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(MaybePet, GraphQLTypeContext.Output); + + expect(getDoc(tester.program, mutation.mutatedType)).toBe("A pet or nothing"); + }); + + it("T | null replacement gets its mutation pipeline applied", async () => { + await tester.compile(` + model ad_account { id: int32; } + union MaybeAccount { ad_account, null } + `); + + const MaybeAccount = tester.program.getGlobalNamespaceType().unions.get("MaybeAccount")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(MaybeAccount, GraphQLTypeContext.Output); + + // T | null unwraps to ad_account → mutation renames to AdAccount + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("AdAccount"); + }); + + it("collapsed type gets its mutation pipeline applied (e.g. naming)", async () => { + await tester.compile(` + model ad_account { id: int32; } + union Inner { a: ad_account; } + union Outer { inner: Inner; dup: ad_account; } + `); + + const Outer = tester.program.getGlobalNamespaceType().unions.get("Outer")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Outer, GraphQLTypeContext.Output); + + // Flattens to one unique type (ad_account) → collapses → mutation renames to AdAccount + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("AdAccount"); + }); + + it("collapses nullable multi-variant union when only one variant remains after null strip", async () => { + const { Things } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Things")} { cat: Cat; dup: Cat; null; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Things, GraphQLTypeContext.Output); + + // Strip null → Cat, Cat → dedup → 1 variant → collapse + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("Cat"); + expect(isNullable(tester.program, mutation.mutatedType)).toBe(true); + }); + + it("handles circular type references without infinite recursion", async () => { + const { Tree } = await tester.compile( + t.code` + model ${t.model("Leaf")} { value: int32; } + model ${t.model("Tree")} { children: Tree | Leaf | null; } + `, + ); + + const engine = createTestEngine(tester.program); + // Should complete without stack overflow + const mutation = engine.mutateModel(Tree, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("Tree"); + }); + + it("sanitizes union name in mutated type", async () => { + const { ValidUnion } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("ValidUnion")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(ValidUnion, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.name).toBe("ValidUnion"); + }); + + it("string | null property → String (nullable)", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { name: string | null; }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const nameProp = mutation.mutatedType.properties.get("name")!; + expect(nameProp.type.kind).toBe("Scalar"); + expect(printMutatedType(tester.program, nameProp)).toBe("String"); + }); + + it("string[] property → [String!]!", async () => { + const { Foo } = await tester.compile(t.code`model ${t.model("Foo")} { tags: string[]; }`); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const tagsProp = mutation.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, tagsProp)).toBe("[String!]!"); + }); + + it("(string | null)[] property → [String]!", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: (string | null)[]; }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const tagsProp = mutation.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, tagsProp)).toBe("[String]!"); + }); + + it("string[] | null property → [String!]", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: string[] | null; }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const tagsProp = mutation.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, tagsProp)).toBe("[String!]"); + }); + + it("(string | null)[] | null property → [String]", async () => { + const { Foo } = await tester.compile( + t.code`model ${t.model("Foo")} { tags: (string | null)[] | null; }`, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateModel(Foo, GraphQLTypeContext.Output); + + const tagsProp = mutation.mutatedType.properties.get("tags")!; + expect(printMutatedType(tester.program, tagsProp)).toBe("[String]"); + }); +}); + +describe("GraphQL Mutation Engine - oneOf Input Objects", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + it("replaces union with oneOf model in input context", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Input); + + // Union is replaced with a Model in the type graph + expect(mutation.mutatedType.kind).toBe("Model"); + expect(mutation.mutatedType.name).toBe("PetInput"); + expect(isOneOf(tester.program, mutation.mutatedType as Model)).toBe(true); + }); + + it("PascalCases oneOf model name for snake_case unions", async () => { + await tester.compile(` + model Cat { name: string; } + model Dog { breed: string; } + union pet_type { cat: Cat; dog: Dog; } + `); + + const petType = tester.program.getGlobalNamespaceType().unions.get("pet_type")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(petType, GraphQLTypeContext.Input); + + expect(mutation.mutatedType.name).toBe("PetTypeInput"); + }); + + it("camelCases oneOf field names for snake_case variants", async () => { + await tester.compile(` + model Cat { name: string; } + model Dog { breed: string; } + union Pet { my_cat: Cat; my_dog: Dog; } + `); + + const Pet = tester.program.getGlobalNamespaceType().unions.get("Pet")!; + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Input); + const model = mutation.mutatedType as Model; + + const fieldNames = Array.from(model.properties.values()).map((p) => p.name); + expect(fieldNames).toContain("myCat"); + expect(fieldNames).toContain("myDog"); + }); + + it("oneOf model has one field per variant, all optional", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Input); + const model = mutation.mutatedType as Model; + + expect(model.properties.size).toBe(2); + expect(model.properties.has("cat")).toBe(true); + expect(model.properties.has("dog")).toBe(true); + // All fields are optional (oneOf semantics) + expect(model.properties.get("cat")!.optional).toBe(true); + expect(model.properties.get("dog")!.optional).toBe(true); + }); + + it("keeps union in output context (no replacement)", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + + expect(mutation.mutatedType.kind).toBe("Union"); + }); + + it("oneOf model handles scalar variants", async () => { + const { Data } = await tester.compile( + t.code` + model ${t.model("Foo")} { x: int32; } + union ${t.union("Data")} { text: string; num: int32; foo: Foo; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Data, GraphQLTypeContext.Input); + const model = mutation.mutatedType as Model; + + // All variants become fields — no wrapper models needed for oneOf + expect(model.properties.size).toBe(3); + expect(model.properties.has("text")).toBe(true); + expect(model.properties.has("num")).toBe(true); + expect(model.properties.has("foo")).toBe(true); + // No wrapper models created in input context + expect(mutation.wrapperModels).toHaveLength(0); + }); + + it("oneOf model flattens and deduplicates nested unions", async () => { + const { Outer } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + model ${t.model("Bird")} { wingspan: int32; } + union ${t.union("Inner")} { cat: Cat; dog: Dog; } + union ${t.union("Outer")} { inner: Inner; bird: Bird; dog2: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Outer, GraphQLTypeContext.Input); + const model = mutation.mutatedType as Model; + + // Inner is flattened: Cat + Dog from Inner, Bird from Outer + // Dog appears twice (from Inner and as dog2) — deduplicated to one + expect(model.properties.size).toBe(3); + expect(model.properties.has("cat")).toBe(true); + expect(model.properties.has("dog")).toBe(true); + expect(model.properties.has("bird")).toBe(true); + }); + + it("strips null from multi-variant union in output context", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; null; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + + // Null should be stripped — only Cat and Dog remain + const mutatedUnion = mutation.mutatedType as Union; + expect(mutatedUnion.kind).toBe("Union"); + expect(mutatedUnion.variants.size).toBe(2); + + // The result should be marked as nullable + expect(isNullable(tester.program, mutatedUnion)).toBe(true); + }); + + it("strips null from multi-variant union in input context", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; null; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Input); + + // Should become a @oneOf model with 2 fields (null stripped) + const model = mutation.mutatedType as Model; + expect(model.kind).toBe("Model"); + expect(model.properties.size).toBe(2); + expect(model.properties.has("cat")).toBe(true); + expect(model.properties.has("dog")).toBe(true); + + // Should be marked as both @oneOf and nullable + expect(isOneOf(tester.program, model)).toBe(true); + expect(isNullable(tester.program, model)).toBe(true); + }); + + it("non-nullable union is not marked as nullable", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + `, + ); + + const engine = createTestEngine(tester.program); + const mutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + + expect(isNullable(tester.program, mutation.mutatedType)).toBe(false); + }); + + it("exposes typeContext on union mutation", async () => { + const { Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + union ${t.union("Pet")} { cat: Cat; } + `, + ); + + const engine = createTestEngine(tester.program); + const inputMutation = engine.mutateUnion(Pet, GraphQLTypeContext.Input); + const outputMutation = engine.mutateUnion(Pet, GraphQLTypeContext.Output); + + expect(inputMutation.typeContext).toBe(GraphQLTypeContext.Input); + expect(outputMutation.typeContext).toBe(GraphQLTypeContext.Output); + }); +}); diff --git a/packages/graphql/test/mutation-engine/visibility.test.ts b/packages/graphql/test/mutation-engine/visibility.test.ts new file mode 100644 index 00000000000..9b883b324f0 --- /dev/null +++ b/packages/graphql/test/mutation-engine/visibility.test.ts @@ -0,0 +1,276 @@ +import type { Model } from "@typespec/compiler"; +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { createVisibilityFilters } from "../../src/lib/visibility.js"; +import { + createGraphQLMutationEngine, + GraphQLTypeContext, +} from "../../src/mutation-engine/index.js"; +import { Tester } from "../test-host.js"; + +function createTestEngine(program: Parameters[0]) { + return createGraphQLMutationEngine(program); +} + +describe("GraphQL Mutation Engine - Visibility Filtering", () => { + let tester: TesterInstance; + let filters: ReturnType; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + function mutateAsInput(engine: ReturnType, model: Model) { + filters = createVisibilityFilters(tester.program); + return engine.mutateModel(model, GraphQLTypeContext.Input, filters.mutation); + } + + function mutateAsOutput(engine: ReturnType, model: Model) { + filters = createVisibilityFilters(tester.program); + return engine.mutateModel(model, GraphQLTypeContext.Output, filters.output); + } + + describe("Input context", () => { + it("excludes read-only properties from input mutation", async () => { + const { Board } = await tester.compile(t.code` + model ${t.model("Board")} { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Read) + created_at: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsInput(engine, Board); + + expect(mutation.mutatedType.properties.has("name")).toBe(true); + expect(mutation.mutatedType.properties.has("id")).toBe(false); + expect(mutation.mutatedType.properties.has("created_at")).toBe(false); + }); + + it("includes create-visible properties in input mutation", async () => { + const { User } = await tester.compile(t.code` + model ${t.model("User")} { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Create, Lifecycle.Read) + email: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsInput(engine, User); + + expect(mutation.mutatedType.properties.has("name")).toBe(true); + expect(mutation.mutatedType.properties.has("email")).toBe(true); + expect(mutation.mutatedType.properties.has("id")).toBe(false); + }); + + it("includes properties with no visibility decorator in input mutation", async () => { + const { Item } = await tester.compile(t.code` + model ${t.model("Item")} { + name: string; + description: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsInput(engine, Item); + + expect(mutation.mutatedType.properties.has("name")).toBe(true); + expect(mutation.mutatedType.properties.has("description")).toBe(true); + }); + }); + + describe("Output context", () => { + it("includes read-only properties in output mutation", async () => { + const { Board } = await tester.compile(t.code` + model ${t.model("Board")} { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Read) + createdAt: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsOutput(engine, Board); + + expect(mutation.mutatedType.properties.has("id")).toBe(true); + expect(mutation.mutatedType.properties.has("createdAt")).toBe(true); + expect(mutation.mutatedType.properties.has("name")).toBe(true); + }); + + it("excludes create-only properties from output mutation", async () => { + const { User } = await tester.compile(t.code` + model ${t.model("User")} { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Create) + password: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsOutput(engine, User); + + expect(mutation.mutatedType.properties.has("id")).toBe(true); + expect(mutation.mutatedType.properties.has("name")).toBe(true); + expect(mutation.mutatedType.properties.has("password")).toBe(false); + }); + + it("includes properties with no visibility decorator in output mutation", async () => { + const { Item } = await tester.compile(t.code` + model ${t.model("Item")} { + name: string; + description: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsOutput(engine, Item); + + expect(mutation.mutatedType.properties.has("name")).toBe(true); + expect(mutation.mutatedType.properties.has("description")).toBe(true); + }); + }); + + describe("Edge cases", () => { + it("does not filter properties when no type context is provided", async () => { + const { Board } = await tester.compile(t.code` + model ${t.model("Board")} { + @visibility(Lifecycle.Read) + id: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + // Mutate without context (e.g., type not reachable from an operation) + const mutation = mutateAsOutput(engine, Board); + + // Both should be present since Output includes Read-visible properties + expect(mutation.mutatedType.properties.has("id")).toBe(true); + expect(mutation.mutatedType.properties.has("name")).toBe(true); + }); + + it("replaces with scalar when all properties are read-only in input context", async () => { + const { ReadOnlyModel } = await tester.compile(t.code` + model ${t.model("ReadOnlyModel")} { + @visibility(Lifecycle.Read) + id: string; + + @visibility(Lifecycle.Read) + status: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsInput(engine, ReadOnlyModel); + + expect(mutation.mutationNode.isReplaced).toBe(true); + const replacement = mutation.mutationNode.replacementNode!.mutatedType; + expect(replacement.kind).toBe("Scalar"); + if (replacement.kind === "Scalar") { + expect(replacement.name).toBe("ReadOnlyModelInput"); + } + }); + + it("strips @compose from input variants to avoid spurious validation", async () => { + const { User } = await tester.compile(t.code` + @graphqlInterface(#{interfaceOnly: true}) + model Node { + @visibility(Lifecycle.Read) + id: string; + } + + @compose(Node) + model ${t.model("User")} { + @visibility(Lifecycle.Read) + id: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + const mutation = mutateAsInput(engine, User); + + expect(mutation.mutatedType.properties.has("id")).toBe(false); + expect(mutation.mutatedType.properties.has("name")).toBe(true); + const hasCompose = mutation.mutatedType.decorators.some( + (d) => d.decorator.name === "$compose", + ); + expect(hasCompose).toBe(false); + }); + + it("excludes @invisible properties from both input and output", async () => { + const { Secret } = await tester.compile(t.code` + model ${t.model("Secret")} { + @invisible(Lifecycle) + internal: string; + + name: string; + } + `); + + const engine = createTestEngine(tester.program); + const inputMutation = mutateAsInput(engine, Secret); + const outputMutation = mutateAsOutput(engine, Secret); + + expect(inputMutation.mutatedType.properties.has("internal")).toBe(false); + expect(inputMutation.mutatedType.properties.has("name")).toBe(true); + expect(outputMutation.mutatedType.properties.has("internal")).toBe(false); + expect(outputMutation.mutatedType.properties.has("name")).toBe(true); + }); + + it("properties are finalized with mutated names after mutateModel returns", async () => { + const { User } = await tester.compile(t.code` + model ${t.model("User")} { + @visibility(Lifecycle.Read, Lifecycle.Query) + user_id: string; + + @visibility(Lifecycle.Create, Lifecycle.Update) + pass_word: string; + + display_name: string; + } + `); + + filters = createVisibilityFilters(tester.program); + const engine = createTestEngine(tester.program); + const queryMutation = engine.mutateModel( + User, + GraphQLTypeContext.Input, + filters.query, + "Query", + ); + const mutMutation = engine.mutateModel( + User, + GraphQLTypeContext.Input, + filters.mutation, + "Mutation", + ); + + const queryKeys = [...queryMutation.mutatedType.properties.keys()].sort(); + const mutKeys = [...mutMutation.mutatedType.properties.keys()].sort(); + + expect(queryKeys).toEqual(["displayName", "userId"]); + expect(mutKeys).toEqual(["displayName", "passWord"]); + expect(queryKeys.join(",")).not.toBe(mutKeys.join(",")); + }); + }); +}); diff --git a/packages/graphql/test/operation-fields.test.ts b/packages/graphql/test/operation-fields.test.ts new file mode 100644 index 00000000000..ac518164d58 --- /dev/null +++ b/packages/graphql/test/operation-fields.test.ts @@ -0,0 +1,170 @@ +import { expectDiagnosticEmpty, expectDiagnostics, t } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { getOperationFields } from "../src/lib/operation-fields.js"; +import { Tester } from "./test-host.js"; + +describe("@operationFields", () => { + it("can add an operation to the model", async () => { + const { program, TestModel, testOperation } = await Tester.compile(t.code` + @test op ${t.op("testOperation")}(): void; + + @operationFields(testOperation) + @test model ${t.model("TestModel")} {} + `); + + expect(getOperationFields(program, TestModel)).toContain(testOperation); + }); + + it("can add an interface to the model", async () => { + const { program, TestModel, testOperation } = await Tester.compile(t.code` + interface TestInterface { + @test op ${t.op("testOperation")}(): void; + } + + @operationFields(TestInterface) + @test model ${t.model("TestModel")} {} + `); + + expect(getOperationFields(program, TestModel)).toContain(testOperation); + }); + + it("can add an multiple operations to the model", async () => { + const { program, TestModel, testOperation1, testOperation2, testOperation3 } = + await Tester.compile(t.code` + interface TestInterface { + @test op ${t.op("testOperation1")}(): void; + @test op ${t.op("testOperation2")}(): void; + } + + @test op ${t.op("testOperation3")}(): void; + + @operationFields(TestInterface, testOperation3) + @test model ${t.model("TestModel")} {} + `); + + expect(getOperationFields(program, TestModel)).toContain(testOperation1); + expect(getOperationFields(program, TestModel)).toContain(testOperation2); + expect(getOperationFields(program, TestModel)).toContain(testOperation3); + }); + + it("will add duplicate operations with a warning", async () => { + const [{ program, TestModel, testOperation }, diagnostics] = + await Tester.compileAndDiagnose(t.code` + interface TestInterface { + @test op ${t.op("testOperation")}(): void; + } + + @operationFields(TestInterface, TestInterface.testOperation) + @test model ${t.model("TestModel")} {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/operation-field-duplicate", + message: "Operation `testOperation` is defined multiple times on `TestModel`.", + }); + + expect(getOperationFields(program, TestModel)).toContain(testOperation); + }); + + describe("conflicts", () => { + it("does not allow adding operations that conflict with a field", async () => { + const diagnostics = await Tester.diagnose(` + op foo(): void; + + @operationFields(foo) + model TestModel { + foo: string; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/operation-field-conflict", + message: "Operation `foo` conflicts with an existing property on model `TestModel`.", + }); + }); + + it("does not allow adding operations that conflict with another operation in return type", async () => { + const diagnostics = await Tester.diagnose(` + op testOperation(): string; + + interface TestInterface { + op testOperation(): void; + } + + @operationFields(testOperation, TestInterface.testOperation) + model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/operation-field-conflict", + message: + "Operation `testOperation` conflicts with an existing operation on model `TestModel`.", + }); + }); + + it("does not allow adding operations that conflict with another operation in number of arguments", async () => { + const diagnostics = await Tester.diagnose(` + op testOperation(a: string, b: integer): void; + + interface TestInterface { + op testOperation(a: string): void; + } + + @operationFields(testOperation, TestInterface.testOperation) + model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/operation-field-conflict", + message: + "Operation `testOperation` conflicts with an existing operation on model `TestModel`.", + }); + }); + + it("does not allow adding operations that conflict with another operation in argument type", async () => { + const diagnostics = await Tester.diagnose(` + op testOperation(a: string): void; + + interface TestInterface { + op testOperation(a: integer): void; + } + + @operationFields(testOperation, TestInterface.testOperation) + model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/operation-field-conflict", + message: + "Operation `testOperation` conflicts with an existing operation on model `TestModel`.", + }); + }); + + it("does not allow adding operations that conflict with another operation in argument name", async () => { + const diagnostics = await Tester.diagnose(` + op testOperation(a: string): void; + + interface TestInterface { + op testOperation(b: string): void; + } + + @operationFields(testOperation, TestInterface.testOperation) + model TestModel {} + `); + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/operation-field-conflict", + message: + "Operation `testOperation` conflicts with an existing operation on model `TestModel`.", + }); + }); + + it("allows adding operations with a different argument order", async () => { + const diagnostics = await Tester.diagnose(` + op testOperation(a: string, b: integer): void; + + interface TestInterface { + op testOperation(b: integer, a: string): void; + } + + @operationFields(testOperation, TestInterface.testOperation) + model TestModel {} + `); + expectDiagnosticEmpty(diagnostics); + }); + }); +}); diff --git a/packages/graphql/test/operation-kind.test.ts b/packages/graphql/test/operation-kind.test.ts new file mode 100644 index 00000000000..b9dd05937a0 --- /dev/null +++ b/packages/graphql/test/operation-kind.test.ts @@ -0,0 +1,45 @@ +import { expectDiagnostics, t } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { getOperationKind } from "../src/lib/operation-kind.js"; +import { Tester } from "./test-host.js"; + +describe("Operation kinds", () => { + it("declares a Mutation", async () => { + const { program, testOperation } = await Tester.compile(t.code` + @mutation @test op ${t.op("testOperation")}(): string; + `); + const operationKind = getOperationKind(program, testOperation); + expect(operationKind).toBe("Mutation"); + }); + it("declares a Query", async () => { + const { program, testOperation } = await Tester.compile(t.code` + @query @test op ${t.op("testOperation")}(): string; + `); + const operationKind = getOperationKind(program, testOperation); + expect(operationKind).toBe("Query"); + }); + it("declares a Subscription", async () => { + const { program, testOperation } = await Tester.compile(t.code` + @subscription @test op ${t.op("testOperation")}(): string; + `); + const operationKind = getOperationKind(program, testOperation); + expect(operationKind).toBe("Subscription"); + }); + it("does not allow to declare multiple operation kinds to the same type.", async () => { + const [{ program, testOperation }, diagnostics] = await Tester.compileAndDiagnose(t.code` + @query @mutation @test op ${t.op("testOperation")}(): string; + `); + expectDiagnostics(diagnostics, [ + { + code: "@typespec/graphql/graphql-operation-kind-duplicate", + message: "GraphQL Operation Kind already applied to `testOperation`.", + }, + { + code: "@typespec/graphql/graphql-operation-kind-duplicate", + message: "GraphQL Operation Kind already applied to `testOperation`.", + }, + ]); + const operationKind = getOperationKind(program, testOperation); + expect(operationKind).toBeUndefined(); + }); +}); diff --git a/packages/graphql/test/schema.test.ts b/packages/graphql/test/schema.test.ts new file mode 100644 index 00000000000..8b6b7785234 --- /dev/null +++ b/packages/graphql/test/schema.test.ts @@ -0,0 +1,34 @@ +import { t } from "@typespec/compiler/testing"; +import { describe, expect, it } from "vitest"; +import { getSchema } from "../src/lib/schema.js"; +import { Tester } from "./test-host.js"; + +describe("@schema", () => { + it("Creates a schema with no name", async () => { + const { program, TestNamespace } = await Tester.compile(t.code` + @schema + @test namespace ${t.namespace("TestNamespace")} { + @query op health(): string; + } + `); + + const schema = getSchema(program, TestNamespace); + + expect(schema?.type).toBe(TestNamespace); + expect(schema?.name).toBeUndefined(); + }); + + it("Creates a schema with a specified name", async () => { + const { program, TestNamespace } = await Tester.compile(t.code` + @schema(#{name: "MySchema"}) + @test namespace ${t.namespace("TestNamespace")} { + @query op health(): string; + } + `); + + const schema = getSchema(program, TestNamespace); + + expect(schema?.type).toBe(TestNamespace); + expect(schema?.name).toBe("MySchema"); + }); +}); diff --git a/packages/graphql/test/test-host.ts b/packages/graphql/test/test-host.ts new file mode 100644 index 00000000000..f9ad2855673 --- /dev/null +++ b/packages/graphql/test/test-host.ts @@ -0,0 +1,71 @@ +import { type Diagnostic, resolvePath } from "@typespec/compiler"; +import { createTester, expectDiagnosticEmpty } from "@typespec/compiler/testing"; +import { ok } from "assert"; +import type { GraphQLSchema } from "graphql"; +import { buildSchema } from "graphql"; +import { expect } from "vitest"; +import type { GraphQLEmitterOptions } from "../src/lib.js"; + +const outputFileName = "schema.graphql"; + +export const Tester = createTester(resolvePath(import.meta.dirname, ".."), { + libraries: ["@typespec/graphql"], +}) + .importLibraries() + .using("TypeSpec.GraphQL"); + +export const EmitterTester = Tester.emit("@typespec/graphql"); + +export interface GraphQLTestResult { + readonly graphQLSchema?: GraphQLSchema; + readonly graphQLOutput?: string; + readonly diagnostics: readonly Diagnostic[]; +} + +export async function emitWithDiagnostics( + code: string, + options: GraphQLEmitterOptions = {}, +): Promise { + const [result, diagnostics] = await EmitterTester.compileAndDiagnose(code, { + compilerOptions: { + options: { + "@typespec/graphql": { ...options, "output-file": outputFileName }, + }, + }, + }); + + const content = result.outputs[outputFileName]; + const schema = content + ? buildSchema(content, { + assumeValidSDL: true, + noLocation: true, + }) + : undefined; + + return [ + { + graphQLSchema: schema, + graphQLOutput: content, + diagnostics, + }, + ]; +} + +export async function emitSingleSchemaWithDiagnostics( + code: string, + options: GraphQLEmitterOptions = {}, +): Promise { + const schemaRecords = await emitWithDiagnostics(code, options); + expect(schemaRecords.length).toBe(1); + return schemaRecords[0]; +} + +export async function emitSingleSchema( + code: string, + options: GraphQLEmitterOptions = {}, +): Promise { + const schemaRecord = await emitSingleSchemaWithDiagnostics(code, options); + expectDiagnosticEmpty(schemaRecord.diagnostics); + ok(schemaRecord.graphQLOutput, "Expected to have found graphql output"); + return schemaRecord.graphQLOutput; +} diff --git a/packages/graphql/test/type-usage.test.ts b/packages/graphql/test/type-usage.test.ts new file mode 100644 index 00000000000..43a7ff9e2b0 --- /dev/null +++ b/packages/graphql/test/type-usage.test.ts @@ -0,0 +1,253 @@ +import { t, type TesterInstance } from "@typespec/compiler/testing"; +import { beforeEach, describe, expect, it } from "vitest"; +import { GraphQLTypeUsage, resolveTypeUsage } from "../src/type-usage.js"; +import { Tester } from "./test-host.js"; + +describe("type-usage", () => { + let tester: TesterInstance; + beforeEach(async () => { + tester = await Tester.createInstance(); + }); + + function resolve(omitUnreachableTypes = true) { + return resolveTypeUsage( + tester.program, + tester.program.getGlobalNamespaceType(), + omitUnreachableTypes, + ); + } + + describe("basic output reachability", () => { + it("marks return type model as Output", async () => { + const { User } = await tester.compile( + t.code` + model ${t.model("User")} { id: string; } + @query op getUser(): User; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(User)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.getUsage(User)?.has(GraphQLTypeUsage.Input)).toBeFalsy(); + expect(resolver.isUnreachable(User)).toBe(false); + }); + }); + + describe("basic input reachability", () => { + it("marks parameter type model as Input", async () => { + const { UserInput } = await tester.compile( + t.code` + model ${t.model("UserInput")} { name: string; } + @query op createUser(input: UserInput): void; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(UserInput)?.has(GraphQLTypeUsage.Input)).toBe(true); + expect(resolver.getUsage(UserInput)?.has(GraphQLTypeUsage.Output)).toBeFalsy(); + expect(resolver.isUnreachable(UserInput)).toBe(false); + }); + }); + + describe("nested reachability", () => { + it("tracks models referenced indirectly via properties", async () => { + const { Address } = await tester.compile( + t.code` + model ${t.model("Address")} { street: string; } + model User { id: string; address: Address; } + @query op getUser(): User; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(Address)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.isUnreachable(Address)).toBe(false); + }); + }); + + describe("dual usage", () => { + it("model used as both parameter and return gets both flags", async () => { + const { Book } = await tester.compile( + t.code` + model ${t.model("Book")} { title: string; } + @query op getBook(): Book; + @mutation op updateBook(input: Book): void; + `, + ); + + const resolver = resolve(); + const usage = resolver.getUsage(Book); + expect(usage?.has(GraphQLTypeUsage.Input)).toBe(true); + expect(usage?.has(GraphQLTypeUsage.Output)).toBe(true); + }); + + it("nested model shared across input and output in a single operation gets both flags", async () => { + const { Shared } = await tester.compile( + t.code` + model ${t.model("Shared")} { id: string; } + model InputData { shared: Shared; } + model OutputData { shared: Shared; } + @query op transform(input: InputData): OutputData; + `, + ); + + const resolver = resolve(); + const usage = resolver.getUsage(Shared); + expect(usage?.has(GraphQLTypeUsage.Input)).toBe(true); + expect(usage?.has(GraphQLTypeUsage.Output)).toBe(true); + }); + }); + + describe("unreachable types", () => { + it("marks unreferenced type as unreachable when omitUnreachableTypes=true", async () => { + const { Orphan } = await tester.compile( + t.code` + model ${t.model("Orphan")} { value: int32; } + model Used { id: string; } + @query op getUsed(): Used; + `, + ); + + const resolver = resolve(true); + expect(resolver.isUnreachable(Orphan)).toBe(true); + expect(resolver.getUsage(Orphan)).toBeUndefined(); + }); + + it("marks unreferenced type as reachable when omitUnreachableTypes=false", async () => { + const { Orphan } = await tester.compile( + t.code` + model ${t.model("Orphan")} { value: int32; } + model Used { id: string; } + @query op getUsed(): Used; + `, + ); + + const resolver = resolve(false); + expect(resolver.isUnreachable(Orphan)).toBe(false); + // Reachable but no usage flags — it wasn't actually referenced by any operation + expect(resolver.getUsage(Orphan)).toBeUndefined(); + }); + + it("preserves usage flags for referenced types when omitUnreachableTypes=false", async () => { + const { Used } = await tester.compile( + t.code` + model ${t.model("Used")} { id: string; } + @query op getUsed(): Used; + `, + ); + + const resolver = resolve(false); + expect(resolver.isUnreachable(Used)).toBe(false); + expect(resolver.getUsage(Used)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.getUsage(Used)?.has(GraphQLTypeUsage.Input)).toBeFalsy(); + }); + }); + + describe("circular references", () => { + it("handles self-referencing model without infinite loop", async () => { + const { TreeNode } = await tester.compile( + t.code` + model ${t.model("TreeNode")} { id: string; children: TreeNode[]; } + @query op getRoot(): TreeNode; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(TreeNode)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.isUnreachable(TreeNode)).toBe(false); + }); + }); + + describe("union variant reachability", () => { + it("tracks types inside a union used in an operation", async () => { + const { Cat, Dog, Pet } = await tester.compile( + t.code` + model ${t.model("Cat")} { name: string; } + model ${t.model("Dog")} { breed: string; } + union ${t.union("Pet")} { cat: Cat; dog: Dog; } + @query op getPet(): Pet; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(Pet)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.getUsage(Cat)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.getUsage(Dog)?.has(GraphQLTypeUsage.Output)).toBe(true); + }); + }); + + describe("array element reachability", () => { + it("marks element type of array return as Output", async () => { + const { User } = await tester.compile( + t.code` + model ${t.model("User")} { id: string; } + @query op listUsers(): User[]; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(User)?.has(GraphQLTypeUsage.Output)).toBe(true); + }); + }); + + describe("base model reachability", () => { + it("tracks parent model when child is reachable", async () => { + const { Parent } = await tester.compile( + t.code` + model ${t.model("Parent")} { id: string; } + model Child extends Parent { extra: string; } + @query op getChild(): Child; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(Parent)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.isUnreachable(Parent)).toBe(false); + }); + }); + + describe("enum and scalar reachability", () => { + it("tracks enum types referenced from operations", async () => { + const { Status } = await tester.compile( + t.code` + enum ${t.enum("Status")} { Active; Inactive; } + model User { id: string; status: Status; } + @query op getUser(): User; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(Status)?.has(GraphQLTypeUsage.Output)).toBe(true); + }); + + it("tracks scalar types referenced from operations", async () => { + const { MyId } = await tester.compile( + t.code` + scalar ${t.scalar("MyId")} extends string; + model User { id: MyId; } + @query op getUser(): User; + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(MyId)?.has(GraphQLTypeUsage.Output)).toBe(true); + }); + }); + + describe("interface operations", () => { + it("walks operations inside interface blocks", async () => { + const { User } = await tester.compile( + t.code` + model ${t.model("User")} { id: string; } + interface UserService { + @query getUser(): User; + } + `, + ); + + const resolver = resolve(); + expect(resolver.getUsage(User)?.has(GraphQLTypeUsage.Output)).toBe(true); + expect(resolver.isUnreachable(User)).toBe(false); + }); + }); +}); diff --git a/packages/graphql/test/unsupported-types.test.ts b/packages/graphql/test/unsupported-types.test.ts new file mode 100644 index 00000000000..9737078dda9 --- /dev/null +++ b/packages/graphql/test/unsupported-types.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from "vitest"; +import { emitSingleSchemaWithDiagnostics } from "./test-host.js"; + +describe("unsupported types", () => { + it("emits warning and falls back to String for numeric literals", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Test { + a: 42; + } + @query op getTest(): Test; + } + `); + + expect(result.graphQLOutput).toContain("a: String!"); + const warnings = result.diagnostics.filter( + (d) => d.code === "@typespec/graphql/unsupported-type", + ); + expect(warnings.length).toBe(1); + expect(warnings[0].message).toContain("Number"); + }); + + it("emits warning and falls back to String for string literals", async () => { + const result = await emitSingleSchemaWithDiagnostics(` + @schema namespace Test { + model Test { + a: "foo"; + } + @query op getTest(): Test; + } + `); + + expect(result.graphQLOutput).toContain("a: String!"); + const warnings = result.diagnostics.filter( + (d) => d.code === "@typespec/graphql/unsupported-type", + ); + expect(warnings.length).toBe(1); + expect(warnings[0].message).toContain("String"); + }); +}); diff --git a/packages/graphql/test/validate.test.ts b/packages/graphql/test/validate.test.ts new file mode 100644 index 00000000000..a1277d0fc76 --- /dev/null +++ b/packages/graphql/test/validate.test.ts @@ -0,0 +1,306 @@ +import { expectDiagnosticEmpty, expectDiagnostics, t } from "@typespec/compiler/testing"; +import { describe, it } from "vitest"; +import { Tester } from "./test-host.js"; + +describe("$onValidate", () => { + describe("empty-schema", () => { + it("reports empty-schema when no GraphQL operations exist", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + @test namespace ${t.namespace("TestNamespace")} { + model Book { title: string; } + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/empty-schema", + severity: "warning", + message: "GraphQL schema has no operations. At minimum a Query root type is required.", + }); + }); + + it("does not report empty-schema when no @schema decorator", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + model Book { title: string; } + `); + + expectDiagnosticEmpty(diagnostics); + }); + + it("does not report empty-schema when @query operation exists", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + @test namespace ${t.namespace("TestNamespace")} { + model Book { title: string; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + + it("does not report empty-schema when @mutation operation exists", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + @test namespace ${t.namespace("TestNamespace")} { + model Book { title: string; } + @mutation op createBook(title: string): Book; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + + it("does not report empty-schema when @subscription operation exists", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + @test namespace ${t.namespace("TestNamespace")} { + model Book { title: string; } + @subscription op onBookCreated(): Book; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + }); + + describe("empty-enum", () => { + it("reports error for enum with no values", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + enum Status {} + model Book { status: Status; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/empty-enum", + severity: "error", + message: 'Enum "Status" must define at least one value. GraphQL enums cannot be empty.', + }); + }); + + it("does not report error for enum with values", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + enum Status { Active, Inactive } + model Book { status: Status; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + }); + + describe("reserved-name", () => { + it("reports error for model name starting with __", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model __Reserved { title: string; } + @query op get(): __Reserved; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/reserved-name", + severity: "error", + message: + 'Name "__Reserved" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.', + }); + }); + + it("reports error for property name starting with __", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model Book { __internal: string; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/reserved-name", + severity: "error", + message: + 'Name "__internal" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.', + }); + }); + + it("reports error for operation parameter starting with __", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model Book { title: string; } + @query op getBook(__id: string): Book; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/reserved-name", + severity: "error", + message: + 'Name "__id" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.', + }); + }); + + it("reports error for enum name starting with __", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + enum __Status { Active } + model Book { status: __Status; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/reserved-name", + severity: "error", + message: + 'Name "__Status" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.', + }); + }); + + it("reports error for enum member starting with __", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + enum Status { __Internal, Active } + model Book { status: Status; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/reserved-name", + severity: "error", + message: + 'Name "__Internal" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.', + }); + }); + + it("reports error for union name starting with __", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model Cat { meow: string; } + model Dog { bark: string; } + union __Pet { cat: Cat, dog: Dog } + @query op getPet(): __Pet; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/reserved-name", + severity: "error", + message: + 'Name "__Pet" must not begin with "__" (two underscores), which is reserved by GraphQL for introspection.', + }); + }); + + it("does not report error for names with single underscore prefix", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model _Book { _title: string; } + @query op _getBooks(_filter: string): _Book[]; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + + it("does not report error for names with underscore in middle", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model My__Book { my__title: string; } + @query op get__Books(): My__Book[]; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + }); + + describe("empty-union", () => { + it("reports error for union with no variants", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + union Empty {} + @query op get(): Empty; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/empty-union", + severity: "error", + message: + "Union has no non-null variants. A GraphQL union must contain at least one member type.", + }); + }); + + it("reports error for union with only null variant", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + union MaybeNothing { nothing: null } + @query op get(): MaybeNothing; + } + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/graphql/empty-union", + severity: "error", + message: + "Union has no non-null variants. A GraphQL union must contain at least one member type.", + }); + }); + + it("does not report error for union with non-null variants", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model Cat { meow: string; } + model Dog { bark: string; } + union Pet { cat: Cat, dog: Dog } + @query op getPet(): Pet; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + + it("does not report error for union with null and non-null variants", async () => { + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model Cat { meow: string; } + union MaybeCat { cat: Cat, none: null } + @query op getCat(): MaybeCat; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + + it("does not validate anonymous unions", async () => { + // Anonymous unions like `string | null` are handled differently + const [_, diagnostics] = await Tester.compileAndDiagnose(t.code` + @schema + namespace TestNamespace { + model Book { title: string | null; } + @query op getBooks(): Book[]; + } + `); + + expectDiagnosticEmpty(diagnostics); + }); + }); +}); diff --git a/packages/graphql/tsconfig.build.json b/packages/graphql/tsconfig.build.json new file mode 100644 index 00000000000..3a17934a606 --- /dev/null +++ b/packages/graphql/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["**/*.test.*"], + "references": [ + { "path": "../compiler/tsconfig.build.json" }, + { "path": "../http/tsconfig.build.json" } + ] +} diff --git a/packages/graphql/tsconfig.json b/packages/graphql/tsconfig.json new file mode 100644 index 00000000000..9a6bdaa9fe7 --- /dev/null +++ b/packages/graphql/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../tsconfig.base.json", + "references": [{ "path": "../compiler/tsconfig.json" }, { "path": "../http/tsconfig.json" }], + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "es2022", + "skipLibCheck": true, + "isolatedModules": true, + "verbatimModuleSyntax": true, + "jsx": "preserve", + "jsxImportSource": "@alloy-js/core", + "emitDeclarationOnly": true, + "rootDir": ".", + "outDir": "dist" + }, + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + "test/**/*.ts", + "test/**/*.tsx", + "generated-defs/**/*.ts" + ], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/graphql/tspconfig.yaml b/packages/graphql/tspconfig.yaml new file mode 100644 index 00000000000..be1576f644f --- /dev/null +++ b/packages/graphql/tspconfig.yaml @@ -0,0 +1,7 @@ +# Opt this library into the experimental `auto-decorators` feature so that +# `@nullable` / `@nullableElements` (declared as `auto dec` in lib/nullable.tsp) +# are permitted in this library's own source. Per-package feature enablement is +# resolved from the owning package's config, so consumers do not need to enable it. +kind: project +features: + - auto-decorators diff --git a/packages/graphql/vitest.config.ts b/packages/graphql/vitest.config.ts new file mode 100644 index 00000000000..38c877eff3c --- /dev/null +++ b/packages/graphql/vitest.config.ts @@ -0,0 +1,20 @@ +import alloyPlugin from "@alloy-js/rollup-plugin"; +import { defineConfig, mergeConfig } from "vitest/config"; +import { defaultTypeSpecVitestConfig } from "../../vitest.config.js"; + +export default mergeConfig( + defaultTypeSpecVitestConfig, + defineConfig({ + esbuild: { + jsx: "preserve", + sourcemap: "both", + }, + // Disable oxc transform to use babel (via alloyPlugin) for JSX + oxc: false, + plugins: [alloyPlugin()], + resolve: { + conditions: ["development"], + dedupe: ["@alloy-js/core", "graphql"], + }, + }), +); diff --git a/packages/playground-website/package.json b/packages/playground-website/package.json index bf89badef65..d20cc1969d1 100644 --- a/packages/playground-website/package.json +++ b/packages/playground-website/package.json @@ -64,6 +64,7 @@ "@typespec/json-schema": "workspace:^", "@typespec/openapi": "workspace:^", "@typespec/openapi3": "workspace:^", + "@typespec/graphql": "workspace:^", "@typespec/pack": "workspace:~", "@typespec/playground": "workspace:^", "@typespec/protobuf": "workspace:^", diff --git a/packages/playground-website/samples/build.js b/packages/playground-website/samples/build.js index 82c345d40b3..db15eb986cc 100644 --- a/packages/playground-website/samples/build.js +++ b/packages/playground-website/samples/build.js @@ -39,4 +39,9 @@ await buildSamples_experimental(packageRoot, resolve(__dirname, "dist/samples.ts preferredEmitter: "@typespec/json-schema", description: "Emit JSON Schema from TypeSpec type definitions.", }, + GraphQL: { + filename: "samples/graphql.tsp", + preferredEmitter: "@typespec/graphql", + description: "Generate GraphQL schemas with queries, mutations, and types.", + }, }); diff --git a/packages/playground-website/samples/graphql.tsp b/packages/playground-website/samples/graphql.tsp new file mode 100644 index 00000000000..1e91f9a8db9 --- /dev/null +++ b/packages/playground-website/samples/graphql.tsp @@ -0,0 +1,36 @@ +import "@typespec/graphql"; + +using GraphQL; + +@schema +namespace PetStore; + +/** A pet in the store */ +model Pet { + id: string; + name: string; + tag?: string; + status: PetStatus; +} + +/** Pet status in the store */ +enum PetStatus { + Available, + Pending, + Sold, +} + +/** A toy that belongs to a pet */ +model Toy { + id: string; + name: string; + pet: Pet; +} + +@query op getPet(id: string): Pet | null; +@query op listPets(status?: PetStatus, limit?: int32): Pet[]; +@query op getPetToys(petId: string): Toy[]; + +@mutation op createPet(name: string, tag: string, status: PetStatus): Pet; +@mutation op updatePet(id: string, name?: string, status?: PetStatus): Pet | null; +@mutation op deletePet(id: string): boolean; diff --git a/packages/playground-website/src/config.ts b/packages/playground-website/src/config.ts index c925e85c745..852af378663 100644 --- a/packages/playground-website/src/config.ts +++ b/packages/playground-website/src/config.ts @@ -10,6 +10,7 @@ export const TypeSpecPlaygroundConfig = { "@typespec/versioning", "@typespec/openapi3", "@typespec/json-schema", + "@typespec/graphql", "@typespec/protobuf", "@typespec/streams", "@typespec/events", diff --git a/packages/playground-website/tsconfig.json b/packages/playground-website/tsconfig.json index 4fd21b6512e..8fbcdf1aae4 100644 --- a/packages/playground-website/tsconfig.json +++ b/packages/playground-website/tsconfig.json @@ -4,7 +4,8 @@ { "path": "../compiler/tsconfig.json" }, { "path": "../rest/tsconfig.json" }, { "path": "../openapi/tsconfig.json" }, - { "path": "../openapi3/tsconfig.json" } + { "path": "../openapi3/tsconfig.json" }, + { "path": "../graphql/tsconfig.json" } ], "compilerOptions": { "outDir": "dist-dev", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5c3765a928..89d3f8a9467 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -102,6 +102,9 @@ catalogs: '@octokit/plugin-rest-endpoint-methods': specifier: ^17.0.0 version: 17.0.0 + '@pinterest/alloy-graphql': + specifier: ^1.1.0 + version: 1.1.0 '@playwright/test': specifier: ^1.60.0 version: 1.61.0 @@ -294,6 +297,9 @@ catalogs: fast-xml-parser: specifier: ^5.7.0 version: 5.9.3 + graphql: + specifier: ^17.0.0-alpha.9 + version: 17.0.2 happy-dom: specifier: ^20.9.0 version: 20.10.6 @@ -949,6 +955,61 @@ importers: specifier: 'catalog:' version: 4.1.9(@types/node@26.0.0)(@vitest/coverage-v8@4.1.9)(@vitest/ui@4.1.9)(happy-dom@20.10.6)(jsdom@25.0.1)(vite@8.0.16(@types/node@26.0.0)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0)) + packages/graphql: + dependencies: + '@alloy-js/core': + specifier: 'catalog:' + version: 0.24.1 + '@alloy-js/typescript': + specifier: 'catalog:' + version: 0.24.0 + '@pinterest/alloy-graphql': + specifier: 'catalog:' + version: 1.1.0 + change-case: + specifier: 'catalog:' + version: 5.4.4 + graphql: + specifier: 'catalog:' + version: 17.0.2 + devDependencies: + '@alloy-js/cli': + specifier: 'catalog:' + version: 0.24.0 + '@alloy-js/rollup-plugin': + specifier: 'catalog:' + version: 0.1.2(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@4.62.2) + '@types/node': + specifier: 'catalog:' + version: 26.0.0 + '@typespec/compiler': + specifier: workspace:~ + version: link:../compiler + '@typespec/emitter-framework': + specifier: workspace:~ + version: link:../emitter-framework + '@typespec/http': + specifier: workspace:~ + version: link:../http + '@typespec/mutator-framework': + specifier: workspace:~ + version: link:../mutator-framework + '@typespec/tspd': + specifier: workspace:~ + version: link:../tspd + rimraf: + specifier: 'catalog:' + version: 6.1.3 + source-map-support: + specifier: 'catalog:' + version: 0.5.21 + typescript: + specifier: 'catalog:' + version: 6.0.3 + vitest: + specifier: 'catalog:' + version: 4.1.9(@types/node@26.0.0)(@vitest/coverage-v8@4.1.9)(@vitest/ui@4.1.9)(happy-dom@20.10.6)(jsdom@25.0.1)(vite@8.0.16(@types/node@26.0.0)(esbuild@0.28.1)(tsx@4.22.4)(yaml@2.9.0)) + packages/html-program-viewer: dependencies: '@fluentui/react-components': @@ -1929,6 +1990,9 @@ importers: '@typespec/events': specifier: workspace:^ version: link:../events + '@typespec/graphql': + specifier: workspace:^ + version: link:../graphql '@typespec/html-program-viewer': specifier: workspace:^ version: link:../html-program-viewer @@ -5886,6 +5950,9 @@ packages: cpu: [x64] os: [win32] + '@pinterest/alloy-graphql@1.1.0': + resolution: {integrity: sha512-4HDWyHC51xl3FguYJSzwda3Lr/JxjxDM9Hr62OZ4JEQ3o/bYXd3blfbvvDtTcEvi6u23qYocgFR1jQLpvIwy2A==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -9748,6 +9815,10 @@ packages: grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + graphql@17.0.2: + resolution: {integrity: sha512-FRWbddMxfkjiB7z+aQDWIR+E34xo9I8c9mtK2RPv8PmMzKRvrdsreHL/Ui/TmwHJfhHChEtsFPyMHKI+xuarQQ==} + engines: {node: ^22.0.0 || ^24.0.0 || ^25.0.0 || >=26.0.0} + gray-matter@4.0.3: resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} engines: {node: '>=6.0'} @@ -17520,6 +17591,16 @@ snapshots: '@pagefind/windows-x64@1.5.2': optional: true + '@pinterest/alloy-graphql@1.1.0': + dependencies: + '@alloy-js/core': 0.24.1 + graphql: 17.0.2 + pathe: 2.0.3 + pluralize: 8.0.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + '@pkgjs/parseargs@0.11.0': optional: true @@ -22480,6 +22561,8 @@ snapshots: grapheme-splitter@1.0.4: {} + graphql@17.0.2: {} + gray-matter@4.0.3: dependencies: js-yaml: 3.14.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 36676a3ec27..842d2f5847a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -40,6 +40,7 @@ catalog: "@octokit/plugin-paginate-graphql": ^6.0.0 "@octokit/plugin-rest-endpoint-methods": ^17.0.0 "@playwright/test": ^1.60.0 + "@pinterest/alloy-graphql": ^1.1.0 "@pnpm/workspace.find-packages": ^1000.0.65 "@scalar/json-magic": ^0.12.15 "@scalar/openapi-parser": ^0.28.6 @@ -103,6 +104,7 @@ catalog: execa: ^9.6.1 express: ^5.2.1 fast-xml-parser: ^5.7.0 + graphql: ^17.0.0-alpha.9 happy-dom: ^20.9.0 is-unicode-supported: ^2.1.0 log-symbols: ^7.0.1 @@ -178,6 +180,7 @@ minimumReleaseAge: 2880 minimumReleaseAgeExclude: - "@alloy-js/*" + - "@pinterest/alloy-graphql" overrides: cross-spawn@>=7.0.0 <7.0.5: ">=7.0.5" diff --git a/website/src/content/current-sidebar.ts b/website/src/content/current-sidebar.ts index b6e8393692f..70e65cac054 100644 --- a/website/src/content/current-sidebar.ts +++ b/website/src/content/current-sidebar.ts @@ -177,6 +177,13 @@ const sidebar: SidebarItem[] = [ ["emitters/protobuf/guide"], "preview", ), + createLibraryReferenceStructure( + "emitters/graphql", + "GraphQL", + false, + ["emitters/graphql/guide"], + "preview", + ), { label: "Clients", items: [ diff --git a/website/src/content/docs/docs/emitters/graphql/guide.md b/website/src/content/docs/docs/emitters/graphql/guide.md new file mode 100644 index 00000000000..ddae8573ba7 --- /dev/null +++ b/website/src/content/docs/docs/emitters/graphql/guide.md @@ -0,0 +1,238 @@ +--- +title: Guide +--- + +The GraphQL emitter (`@typespec/graphql`) generates GraphQL Schema Definition Language (SDL) from TypeSpec sources. The generated schemas can be used with any GraphQL server implementation. + +## Fundamental Concepts + +The GraphQL emitter transforms TypeSpec models, operations, and enums into their GraphQL equivalents. To generate a valid GraphQL schema, your TypeSpec must follow certain conventions. + +### Schemas + +A GraphQL schema is defined by applying the [`@schema`](../reference/decorators#@TypeSpec.GraphQL.schema) decorator to a TypeSpec namespace. All types and operations within the namespace will be emitted to a single GraphQL schema file. + +```typespec +import "@typespec/graphql"; + +using GraphQL; + +@schema +namespace MyService { +// Types and operations go here + +} +``` + +You can optionally specify a name for the schema, which will be used in the output filename: + +```typespec +@schema(#{ name: "petstore" }) +namespace PetStore { +// ... + +} +``` + +This will generate a file named `petstore.graphql`. + +### Object Types + +TypeSpec models are transformed into GraphQL object types. For example: + +```typespec +model Pet { + id: string; + name: string; + age: int32; +} +``` + +Becomes: + +```graphql +type Pet { + id: String! + name: String! + age: Int! +} +``` + +Note that all fields are non-nullable (`!`) by default in GraphQL. See [Nullability](#nullability) for how to make fields nullable. + +### Operations + +GraphQL supports three operation types: queries, mutations, and subscriptions. Use the corresponding decorators to specify the operation kind: + +```typespec +@query op getPet(id: string): Pet; +@query op listPets(): Pet[]; + +@mutation op createPet(name: string, age: int32): Pet; +@mutation op deletePet(id: string): boolean; + +@subscription op onPetCreated(): Pet; +``` + +This generates: + +```graphql +type Query { + getPet(id: String!): Pet! + listPets: [Pet!]! +} + +type Mutation { + createPet(name: String!, age: Int!): Pet! + deletePet(id: String!): Boolean! +} + +type Subscription { + onPetCreated: Pet! +} +``` + +### Input Types + +When a model is used as an operation parameter (mutation input), the emitter automatically generates a corresponding GraphQL input type with an `Input` suffix: + +```typespec +model Pet { + name: string; + age: int32; +} + +@mutation op createPet(input: Pet): Pet; +``` + +Generates: + +```graphql +input PetInput { + name: String! + age: Int! +} + +type Mutation { + createPet(input: PetInput!): Pet! +} +``` + +### Enums + +TypeSpec enums map to GraphQL enums with member names converted to `CONSTANT_CASE`: + +```typespec +enum PetStatus { + Available, + Pending, + Sold, +} +``` + +Becomes: + +```graphql +enum PetStatus { + AVAILABLE + PENDING + SOLD +} +``` + +### Nullability + +By default, all GraphQL types are non-nullable. To make a field or return type nullable, use TypeSpec's union with `null`: + +```typespec +model Pet { + id: string; + nickname: string | null; // Nullable field +} + +@query op findPet(id: string): Pet | null; // Nullable return +``` + +Generates: + +```graphql +type Pet { + id: String! + nickname: String # No ! means nullable +} + +type Query { + findPet(id: String!): Pet # Nullable return +} +``` + +For nullable array elements, the emitter handles `Array` patterns: + +```typespec +model SearchResult { + pets: (Pet | null)[]; # Array with nullable elements +} +``` + +Generates: + +```graphql +type SearchResult { + pets: [Pet]! # Non-null array, nullable elements +} +``` + +### Interfaces + +GraphQL interfaces allow you to define a common set of fields that multiple types can implement. Use the [`@graphqlInterface`](../reference/decorators#@TypeSpec.GraphQL.graphqlInterface) decorator: + +```typespec +@graphqlInterface(#{ interfaceOnly: true }) +model Node { + id: string; +} + +@compose(Node) +model Pet { + ...Node; + name: string; +} +``` + +Generates: + +```graphql +interface Node { + id: String! +} + +type Pet implements Node { + id: String! + name: String! +} +``` + +The `interfaceOnly` option prevents the model from also being emitted as an object type (useful for abstract interfaces like `Node`). + +## Type Mappings + +| TypeSpec Type | GraphQL Type | +| -------------------- | -------------- | +| `string` | `String` | +| `boolean` | `Boolean` | +| `int32` | `Int` | +| `float32`, `float64` | `Float` | +| `GraphQL.ID` | `ID` | +| `T[]` | `[T!]!` | +| `T \| null` | `T` (nullable) | + +## Example Configuration + +To use the GraphQL emitter, add it to your `tspconfig.yaml`: + +```yaml +emit: + - "@typespec/graphql" +``` + +The emitter will generate `.graphql` files in your output directory. diff --git a/website/src/content/docs/docs/emitters/graphql/reference/data-types.md b/website/src/content/docs/docs/emitters/graphql/reference/data-types.md new file mode 100644 index 00000000000..693a6f780f4 --- /dev/null +++ b/website/src/content/docs/docs/emitters/graphql/reference/data-types.md @@ -0,0 +1,39 @@ +--- +title: "Data types" +description: "Data types exported by @typespec/graphql" +--- + +## TypeSpec.GraphQL + +### `ID` {#TypeSpec.GraphQL.ID} + +Represents a GraphQL ID scalar — a unique identifier serialized as a string. + +```typespec +scalar TypeSpec.GraphQL.ID +``` + +#### Examples + +```typespec +model User { + id: GraphQL.ID; + name: string; +} +``` + +## TypeSpec.GraphQL.Schema + +### `SchemaOptions` {#TypeSpec.GraphQL.Schema.SchemaOptions} + +Options for configuring a GraphQL schema. + +```typespec +model TypeSpec.GraphQL.Schema.SchemaOptions +``` + +#### Properties + +| Name | Type | Description | +| ----- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| name? | `string` | The name of the GraphQL schema. Used in the output filename when emitting
multiple schemas (e.g., `{name}.graphql`). Defaults to `"schema"`. | diff --git a/website/src/content/docs/docs/emitters/graphql/reference/decorators.md b/website/src/content/docs/docs/emitters/graphql/reference/decorators.md new file mode 100644 index 00000000000..fab456d9212 --- /dev/null +++ b/website/src/content/docs/docs/emitters/graphql/reference/decorators.md @@ -0,0 +1,235 @@ +--- +title: "Decorators" +description: "Decorators exported by @typespec/graphql" +toc_min_heading_level: 2 +toc_max_heading_level: 3 +--- + +## TypeSpec.GraphQL + +### `@compose` {#@TypeSpec.GraphQL.compose} + +Specify the GraphQL interfaces that should be implemented by a model. +The interfaces must be decorated with the `@graphqlInterface` decorator, +and all of the interfaces' properties must be present and compatible. + +```typespec +@TypeSpec.GraphQL.compose(...interfaces: Model[]) +``` + +#### Target + +`Model` + +#### Parameters + +| Name | Type | Description | +| ---------- | --------- | ----------- | +| interfaces | `Model[]` | | + +#### Examples + +```typespec +@graphqlInterface(#{ interfaceOnly: true }) +model Node { + id: string; +} + +@compose(Node) +model User { + ...Node; + name: string; +} +``` + +### `@graphqlInterface` {#@TypeSpec.GraphQL.graphqlInterface} + +Mark this model as a GraphQL Interface. Interfaces can be implemented by other models +using the `@compose` decorator. + +```typespec +@TypeSpec.GraphQL.graphqlInterface(options?: valueof { interfaceOnly: boolean }) +``` + +#### Target + +`Model` + +#### Parameters + +| Name | Type | Description | +| ------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| options | `valueof {...}` | .interfaceOnly When true, the model will only be emitted as an interface
(no "Interface" suffix is added to the name). Use this for abstract interfaces that
will never be used directly as output/input types (e.g., Node, Connection). Defaults to false. | + +#### Examples + +```typespec +@graphqlInterface(#{ interfaceOnly: true }) +model Node { + id: string; +} + +@compose(Node) +model User { + ...Node; + name: string; +} +// Emits: interface Node { id: String! } +// type User implements Node { id: String!; name: String! } +``` + +### `@mutation` {#@TypeSpec.GraphQL.mutation} + +Specify the GraphQL Operation kind for the target operation to be `MUTATION`. + +```typespec +@TypeSpec.GraphQL.mutation +``` + +#### Target + +`Operation` + +#### Parameters + +None + +#### Examples + +```typespec +@mutation op createUser(name: string): User; +``` + +### `@operationFields` {#@TypeSpec.GraphQL.operationFields} + +Assign one or more operations or interfaces to act as fields with arguments on a model. +The operations become fields on the GraphQL type with their parameters as arguments. + +```typespec +@TypeSpec.GraphQL.operationFields(...operations: Operation | Interface[]) +``` + +#### Target + +`Model` + +#### Parameters + +| Name | Type | Description | +| ---------- | -------------------------- | ----------- | +| operations | `Operation \| Interface[]` | | + +#### Examples + +```typespec +op followers(query: string): Person[]; + +@operationFields(followers) +model Person { + name: string; +} +// Emits: type Person { name: String!; followers(query: String!): [Person!]! } +``` + +### `@query` {#@TypeSpec.GraphQL.query} + +Specify the GraphQL Operation kind for the target operation to be `QUERY`. + +```typespec +@TypeSpec.GraphQL.query +``` + +#### Target + +`Operation` + +#### Parameters + +None + +#### Examples + +```typespec +@query op getUser(id: string): User; +``` + +### `@schema` {#@TypeSpec.GraphQL.schema} + +Mark this namespace as describing a GraphQL schema and configure schema properties. +All types and operations within the namespace will be emitted to a single GraphQL schema file. + +```typespec +@TypeSpec.GraphQL.schema(options?: valueof TypeSpec.GraphQL.Schema.SchemaOptions) +``` + +#### Target + +`Namespace` + +#### Parameters + +| Name | Type | Description | +| ------- | -------------------------------------------------------------------------------- | ----------- | +| options | [valueof `SchemaOptions`](./data-types.md#TypeSpec.GraphQL.Schema.SchemaOptions) | | + +#### Examples + +```typespec +@schema(#{ name: "MyAPI" }) +namespace MyAPI { + model User { + id: string; + name: string; + } + @query op getUser(id: string): User; +} +// Emits: MyAPI.graphql +``` + +### `@specifiedBy` {#@TypeSpec.GraphQL.specifiedBy} + +Provide a specification URL for a custom GraphQL scalar type. +This maps to the `@specifiedBy` directive in the emitted GraphQL schema. + +```typespec +@TypeSpec.GraphQL.specifiedBy(url: valueof url) +``` + +#### Target + +`Scalar` + +#### Parameters + +| Name | Type | Description | +| ---- | ------------- | ------------------------------------ | +| url | `valueof url` | URL to the scalar type specification | + +#### Examples + +```typespec +@specifiedBy("https://scalars.graphql.org/andimarek/date-time") +scalar DateTime extends utcDateTime; +``` + +### `@subscription` {#@TypeSpec.GraphQL.subscription} + +Specify the GraphQL Operation kind for the target operation to be `SUBSCRIPTION`. + +```typespec +@TypeSpec.GraphQL.subscription +``` + +#### Target + +`Operation` + +#### Parameters + +None + +#### Examples + +```typespec +@subscription op onUserCreated(): User; +``` diff --git a/website/src/content/docs/docs/emitters/graphql/reference/emitter.md b/website/src/content/docs/docs/emitters/graphql/reference/emitter.md new file mode 100644 index 00000000000..a4acbe399e7 --- /dev/null +++ b/website/src/content/docs/docs/emitters/graphql/reference/emitter.md @@ -0,0 +1,73 @@ +--- +title: "Emitter usage" +--- + +## Emitter usage + +1. Via the command line + +```bash +tsp compile . --emit=@typespec/graphql +``` + +2. Via the config + +```yaml +emit: + - "@typespec/graphql" +``` + +The config can be extended with options as follows: + +```yaml +emit: + - "@typespec/graphql" +options: + "@typespec/graphql": + option: value +``` + +## Emitter options + +### `emitter-output-dir` + +**Type:** `absolutePath` + +Defines the emitter output directory. Defaults to `{output-dir}/@typespec/graphql` +See [Configuring output directory for more info](https://typespec.io/docs/handbook/configuration/configuration/#configuring-output-directory) + +### `output-file` + +**Type:** `string` + +Name of the output file. +Output file will interpolate the following values: + +- schema-name: Name of the schema if multiple + +Default: `{schema-name}.graphql` + +Example Single schema + +- `schema.graphql` + +Example Multiple schemas + +- `Org1.Schema1.graphql` +- `Org1.Schema2.graphql` + +### `new-line` + +**Type:** `"crlf" | "lf"` + +**Default:** `"lf"` + +Set the newLine character for emitting files. + +### `omit-unreachable-types` + +**Type:** `boolean` + +Omit unreachable types. +By default all types declared under the schema namespace will be included. +With this flag on only types references in an operation will be emitted. diff --git a/website/src/content/docs/docs/emitters/graphql/reference/index.mdx b/website/src/content/docs/docs/emitters/graphql/reference/index.mdx new file mode 100644 index 00000000000..9952a9cb6c8 --- /dev/null +++ b/website/src/content/docs/docs/emitters/graphql/reference/index.mdx @@ -0,0 +1,52 @@ +--- +title: Overview +sidebar_position: 0 +toc_min_heading_level: 2 +toc_max_heading_level: 3 +--- + +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +TypeSpec library for emitting GraphQL + +## Install + + + + +```bash +npm install @typespec/graphql +``` + + + + +```bash +npm install --save-peer @typespec/graphql +``` + + + + +## Emitter usage + +[See documentation](./emitter.md) + +## TypeSpec.GraphQL + +### Decorators + +- [`@compose`](./decorators.md#@TypeSpec.GraphQL.compose) +- [`@graphqlInterface`](./decorators.md#@TypeSpec.GraphQL.graphqlInterface) +- [`@mutation`](./decorators.md#@TypeSpec.GraphQL.mutation) +- [`@operationFields`](./decorators.md#@TypeSpec.GraphQL.operationFields) +- [`@query`](./decorators.md#@TypeSpec.GraphQL.query) +- [`@schema`](./decorators.md#@TypeSpec.GraphQL.schema) +- [`@specifiedBy`](./decorators.md#@TypeSpec.GraphQL.specifiedBy) +- [`@subscription`](./decorators.md#@TypeSpec.GraphQL.subscription) + +## TypeSpec.GraphQL.Schema + +### Models + +- [`SchemaOptions`](./data-types.md#TypeSpec.GraphQL.Schema.SchemaOptions) From 05406488bd77674c076139bd98360f6698964e92 Mon Sep 17 00:00:00 2001 From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> Date: Fri, 17 Jul 2026 10:21:43 -0500 Subject: [PATCH 022/249] Revert "Use provider C# reference map with pre-write internalization" (#11282) Reverts microsoft/typespec#10976 --- .../BinaryContentHelperDefinition.cs | 3 - .../src/Providers/ClientOptionsProvider.cs | 75 +- .../src/Providers/ClientProvider.cs | 43 +- .../Providers/CollectionResultDefinition.cs | 16 - .../ModelReaderWriterContextDefinition.cs | 102 +- .../ModelSerializationExtensionsDefinition.cs | 3 - .../MrwSerializationTypeDefinition.Xml.cs | 6 +- .../MrwSerializationTypeDefinition.cs | 74 +- ...ultipartFormDataSerializationDefinition.cs | 3 - ...elineRequestHeadersExtensionsDefinition.cs | 4 +- .../src/Providers/PipelineRequestProvider.cs | 4 +- .../src/Providers/RestClientProvider.cs | 176 +- .../Providers/ScmMethodProviderCollection.cs | 3 +- .../SerializationFormatDefinition.cs | 2 - .../src/ScmCodeModelGenerator.cs | 17 - .../src/ScmOutputLibrary.cs | 24 +- .../src/Snippets/HttpRequestApiSnippets.cs | 4 +- .../Providers/ClientOptionsProviderTests.cs | 107 -- .../ClientProviderCustomizationTests.cs | 3 +- ...ModelReaderWriterContextDefinitionTests.cs | 331 +--- .../ModelWithProjectedProperty.cs | 12 - .../SampleContext.cs | 9 - .../SystemObjectModelSerializationTests.cs | 34 + .../RestClientProviderTests.cs | 251 +-- .../TestClient.cs | 20 - .../Generated/TestClientOptions.cs | 16 - .../TestClientOptions.cs | 15 - .../ClientA.cs | 6 - .../ClientB.cs | 6 - .../InternalClient.cs | 6 - .../ClientBodyDependencyReferenceMapTests.cs | 948 ----------- .../test/TestHelpers/MockHelpers.cs | 17 +- .../src/CSharpGen.cs | 97 +- .../src/CodeModelGenerator.cs | 22 +- .../PostProcessing/GeneratedCodeWorkspace.cs | 29 +- .../src/PostProcessing/PostProcessor.cs | 669 ++++++++ .../src/PostProcessing/ReferenceMap.cs | 70 + .../src/PostProcessing/ReferenceMapBuilder.cs | 306 ++++ .../src/Primitives/TypeProviderWriter.cs | 9 +- .../src/Providers/CanonicalTypeProvider.cs | 20 +- .../src/Providers/ModelFactoryProvider.cs | 2 - .../src/Providers/NamedTypeSymbolProvider.cs | 414 ----- .../src/Providers/TypeProvider.cs | 93 +- ...iderReferenceMapAnalyzer.BodyReferences.cs | 609 ------- ...ProviderReferenceMapAnalyzer.Candidates.cs | 575 ------- .../ProviderReferenceMapAnalyzer.Helpers.cs | 915 ----------- .../ProviderReferenceMapAnalyzer.cs | 559 ------- .../ProviderReferenceMapResult.cs | 15 - .../ProviderReferenceMapSession.cs | 28 - .../src/SourceInput/SourceInputHelper.cs | 18 +- .../src/SourceInput/SourceInputModel.cs | 96 +- .../src/Statements/XmlDocStatement.cs | 2 - .../src/TypeFactory.cs | 20 +- .../src/Utilities/TypeSymbolExtensions.cs | 61 +- .../test/OutputLibraryVisitorTests.cs | 63 - .../test/PostProcessing/PostProcessorTests.cs | 307 ++++ .../DoesNotRemoveValidAttributes.cs | 11 + .../DoesNotRemoveValidAttributes.cs | 15 + .../DoesNotRemoveValidAttributes/Model.cs | 6 + .../DoesNotRemoveValidAttributes/RootClass.cs | 7 + .../DoesNotRemoveValidUsings.cs | 11 + .../DoesNotRemoveValidUsings/Model.cs | 6 + .../RemovesInvalidAttributes.cs | 10 + .../RemovesInvalidAttributes/Model.cs | 6 + .../RemovesInvalidAttributes.cs | 15 + .../RemovesInvalidAttributes/RootClass.cs | 7 + ...nvalidAttributesAndKeepsValidAttributes.cs | 11 + .../Model.cs | 6 + ...nvalidAttributesAndKeepsValidAttributes.cs | 16 + .../RootClass.cs | 7 + ...AttributesAndKeepsValidAttributesNoDocs.cs | 8 + .../Model.cs | 6 + ...AttributesAndKeepsValidAttributesNoDocs.cs | 13 + .../RootClass.cs | 7 + .../RemovesInvalidUsings/Model.cs | 6 + .../RemovesInvalidUsings.cs | 11 + .../EnumProviders/EnumProviderTests.cs | 7 +- .../ModelFactoriesCustomizationTests.cs | 26 - .../DerivedModel.cs | 9 - .../ClientCustomizationTests.cs | 2 +- .../ModelProviders/ModelProviderTests.cs | 16 +- .../NamedTypeSymbolProviderTests.cs | 89 - .../CustomClient.cs | 12 - .../CustomModel.cs | 6 - .../CustomApi.cs | 9 - .../CustomApi.cs | 12 - .../CustomApi.cs | 9 - .../NestedTypes.cs | 19 - .../test/Providers/TypeProviderTests.cs | 2 +- .../ProviderReferenceMapAnalyzerTests.cs | 1464 ----------------- .../LastContract.cs | 17 - .../test/TestHelpers/TestOutputLibrary.cs | 5 - .../GenericContainer.cs | 6 - .../Utilities/TypeSymbolExtensionsTests.cs | 41 - .../Models/ParametersBasicContext.cs | 1 + .../Generated/ParametersBasicModelFactory.cs | 1 + .../Models/ParametersSpreadContext.cs | 1 + .../Generated/ParametersSpreadModelFactory.cs | 2 + .../Models/PayloadMultiPartContext.cs | 1 + .../Generated/PayloadMultiPartModelFactory.cs | 1 + .../Models/PayloadPageableContext.cs | 3 + .../Generated/PayloadPageableModelFactory.cs | 5 + .../Generated/Models/SpecialWordsContext.cs | 1 + .../src/Generated/SpecialWordsModelFactory.cs | 2 + 104 files changed, 1840 insertions(+), 7453 deletions(-) delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs index 936a8501435..a2ee813e298 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs @@ -35,9 +35,6 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); - protected override IReadOnlyList BuildBodyDependencyTypes() => - [ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.Type]; - protected override MethodProvider[] BuildMethods() { var methods = new List diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs index c62e74461fd..24c20fd2c0e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientOptionsProvider.cs @@ -27,20 +27,13 @@ public class ClientOptionsProvider : TypeProvider private readonly InputClient _inputClient; private readonly ClientProvider _clientProvider; - private readonly Lazy?> _serviceVersionsEnums; + private readonly Dictionary? _serviceVersionsEnums; private static ClientOptionsProvider? _singletonInstance; - // All clients sharing the singleton are tracked so its accessibility reflects every owner. - private static readonly List _singletonClientProviders = []; internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientProvider) { _inputClient = inputClient; _clientProvider = clientProvider; - _serviceVersionsEnums = new(BuildServiceVersionsEnums); - } - - private Dictionary? BuildServiceVersionsEnums() - { List inputEnums = [.. _inputClient.Parameters .Where(p => p.IsApiVersion && p.Type is InputEnumType) .Select(p => (InputEnumType)p.Type)]; @@ -52,7 +45,7 @@ internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientPro if (inputEnums.Count > 0) { - Dictionary serviceVersionsEnums = []; + _serviceVersionsEnums = []; foreach (var inputEnum in inputEnums) { var enumProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateEnum(inputEnum, this); @@ -60,7 +53,7 @@ internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientPro { // Ensure the service version enum uses the same namespace as the options class since it is nested. enumProvider.Update(@namespace: Type.Namespace); - serviceVersionsEnums.Add(inputEnum, enumProvider); + _serviceVersionsEnums.Add(inputEnum, enumProvider); } // Only create one version property for single service clients @@ -69,11 +62,7 @@ internal ClientOptionsProvider(InputClient inputClient, ClientProvider clientPro break; } } - - return serviceVersionsEnums; } - - return null; } /// @@ -88,15 +77,12 @@ public static ClientOptionsProvider CreateClientOptionsProvider(InputClient inpu { if (UseSingletonInstance(inputClient)) { + // Use singleton instance if (_singletonInstance == null) { - _singletonClientProviders.Clear(); + // Create singleton with namespace-based naming _singletonInstance = new ClientOptionsProvider(inputClient, clientProvider); } - if (!_singletonClientProviders.Contains(clientProvider)) - { - _singletonClientProviders.Add(clientProvider); - } return _singletonInstance; } @@ -174,14 +160,13 @@ private static bool UseSingletonInstance(InputClient inputClient) private Dictionary? BuildVersionProperties() { - var serviceVersionsEnums = _serviceVersionsEnums.Value; - if (serviceVersionsEnums is null) + if (_serviceVersionsEnums is null) { return null; } - var properties = new Dictionary(serviceVersionsEnums.Count); - foreach (var (inputEnum, enumProvider) in serviceVersionsEnums) + var properties = new Dictionary(_serviceVersionsEnums.Count); + foreach (var (inputEnum, enumProvider) in _serviceVersionsEnums) { string versionPropertyName; if (!_inputClient.IsMultiServiceClient) @@ -192,10 +177,10 @@ private static bool UseSingletonInstance(InputClient inputClient) { var serviceNamespace = inputEnum.Namespace; if (!string.IsNullOrEmpty(serviceNamespace) && - ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, serviceVersionsEnums.Keys)) + ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys)) { // Last segment collides — find the shortest unique namespace suffix. - string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, serviceVersionsEnums.Keys); + string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys); versionPropertyName = $"{uniquePrefix.ToIdentifierName()}{ApiVersionSuffix}"; } else @@ -220,14 +205,13 @@ private static bool UseSingletonInstance(InputClient inputClient) private Dictionary? BuildLatestVersionsFields() { - var serviceVersionsEnums = _serviceVersionsEnums.Value; - if (serviceVersionsEnums is null) + if (_serviceVersionsEnums is null) { return null; } - Dictionary latestVersionFields = new(serviceVersionsEnums.Count); - foreach (var (inputEnum, enumProvider) in serviceVersionsEnums) + Dictionary latestVersionFields = new(_serviceVersionsEnums.Count); + foreach (var (inputEnum, enumProvider) in _serviceVersionsEnums) { string fieldName; if (!_inputClient.IsMultiServiceClient) @@ -238,10 +222,10 @@ private static bool UseSingletonInstance(InputClient inputClient) { var serviceNamespace = inputEnum.Namespace; if (!string.IsNullOrEmpty(serviceNamespace) && - ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, serviceVersionsEnums.Keys)) + ClientHelper.HasLastSegmentCollision(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys)) { // Last segment collides — find the shortest unique namespace suffix. - string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, serviceVersionsEnums.Keys); + string uniquePrefix = ClientHelper.GetShortestUniqueNamespacePrefix(serviceNamespace, inputEnum, _serviceVersionsEnums.Keys); fieldName = $"{LatestPrefix}{uniquePrefix.ToIdentifierName()}{VersionSuffix}"; } else @@ -264,30 +248,6 @@ private static bool UseSingletonInstance(InputClient inputClient) protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs"); - // TODO https://github.com/microsoft/typespec/issues/11181: Remove this once generated source parity no longer depends on internal ClientOptions XML docs. - protected override bool ShouldWriteTypeXmlDocs => CustomCodeView is null; - - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - if (this == _singletonInstance) - { - foreach (var clientProvider in _singletonClientProviders) - { - if (clientProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - return TypeSignatureModifiers.Public; - } - } - - return TypeSignatureModifiers.Internal; - } - - return GetAccessibilityModifiers(_clientProvider.DeclarationModifiers); - } - - private static TypeSignatureModifiers GetAccessibilityModifiers(TypeSignatureModifiers modifiers) - => modifiers & (TypeSignatureModifiers.Public | TypeSignatureModifiers.Internal | TypeSignatureModifiers.Protected | TypeSignatureModifiers.Private); - protected override string BuildName() { if (UseSingletonInstance(_inputClient)) @@ -329,13 +289,12 @@ protected override FieldProvider[] BuildFields() protected override TypeProvider[] BuildNestedTypes() { - var serviceVersionsEnums = _serviceVersionsEnums.Value; - if (serviceVersionsEnums is null) + if (_serviceVersionsEnums is null) { return []; } - return [.. serviceVersionsEnums.Values.OrderBy(e => e.Name)]; + return [.. _serviceVersionsEnums.Values.OrderBy(e => e.Name)]; } protected override ConstructorProvider[] BuildConstructors() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs index b3eec2a1aa7..b6e2d9cc78a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs @@ -25,8 +25,6 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { public class ClientProvider : TypeProvider { - protected override bool IsClientProvider => true; - 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); @@ -74,9 +72,7 @@ private record ApiVersionFields(FieldProvider Field, PropertyProvider? Correspon /// internal TypeProvider BackCompatProvider => _backCompatProvider ?? this; - private ParameterProvider? _clientOptionsParameter; - public ParameterProvider? ClientOptionsParameter - => ClientOptions is null ? null : _clientOptionsParameter ??= ScmKnownParameters.ClientOptions(ClientOptions.Type); + public ParameterProvider? ClientOptionsParameter { get; } protected override FormattableString BuildDescription() { @@ -112,6 +108,7 @@ public ClientProvider(InputClient inputClient) _subClientEndpointParameter = BuildSubClientEndpointParameter(); _publicCtorDescription = $"Initializes a new instance of {Name}."; ClientOptions = _inputClient.Parent is null ? ClientOptionsProvider.CreateClientOptionsProvider(_inputClient, this) : null; + ClientOptionsParameter = ClientOptions != null ? ScmKnownParameters.ClientOptions(ClientOptions.Type) : null; bool isIndividuallyInitialized = (_inputClient.InitializedBy & InputClientInitializedBy.Individually) != 0; ClientSettings = isIndividuallyInitialized && DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public) @@ -429,42 +426,6 @@ private IReadOnlyList GetClientParameters() protected override string BuildName() => _inputClient.IsExactName ? _inputClient.Name : _inputClient.Name.ToIdentifierName(); - protected override IReadOnlyList BuildHelperDependencyTypes() - { - foreach (var method in Methods.OfType()) - { - if (method.BodyStatements != null) - { - return [ScmCodeModelGenerator.Instance.ClientPipelineExtensionsDefinition.Type]; - } - } - - return []; - } - - protected override IReadOnlyList BuildBodyDependencyTypes() - { - var dependencies = new List(); - foreach (var method in Methods.OfType()) - { - if (method.BodyStatements == null) - { - continue; - } - - if (method.CollectionDefinition != null) - { - dependencies.Add(method.CollectionDefinition.Type); - } - - // Service method metadata can mention wire-only request/response models that are not - // emitted in the generated method signature or body. The graph builder and structured - // body scanner capture the generated types that are actually referenced. - } - - return dependencies; - } - protected override FieldProvider[] BuildFields() { List fields = [EndpointField]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs index b734d9a6529..62f28d86c8d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CollectionResultDefinition.cs @@ -217,22 +217,6 @@ private bool HasPagingOperationNameCollision(string operationName) protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Internal | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class; - protected override IReadOnlyList BuildBodyDependencyTypes() - { - var dependencies = new List { Client.Type, ResponseModelType, NextPagePropertyType }; - if (ItemModelType != null) - { - dependencies.Add(ItemModelType); - } - - foreach (var field in RequestFields) - { - dependencies.Add(field.Type); - } - - return dependencies; - } - protected override FieldProvider[] BuildFields() => [ClientField, .. RequestFields]; protected override CSharpType[] BuildImplements() => diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs index 7d5cc8976e6..947302cbe17 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs @@ -8,7 +8,6 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.TypeSpec.Generator.Expressions; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; using Microsoft.TypeSpec.Generator.Statements; @@ -33,30 +32,14 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override CSharpType BuildBaseType() => typeof(ModelReaderWriterContext); - // Buildable attributes depend on the final set of providers selected by the reference map. - // They are rebuilt at write time while non-buildable attributes, including visitor updates, are preserved. - protected override bool ShouldAnalyzeAttributesInReferenceMap => false; - - protected override IReadOnlyList BuildAttributesForWrite() - { - var visitorAttributes = base.BuildAttributesForWrite().Where(static attribute => !IsBuildableAttribute(attribute)); - return [.. BuildAttributes(), .. visitorAttributes]; - } - protected override IReadOnlyList BuildAttributes() { var attributes = new Dictionary(); - var customizedBuildableTypes = GetCustomizedBuildableTypes(); // Add ModelReaderWriterBuildableAttribute for all IPersistableModel types (HashSet buildableTypes, HashSet buildableProviders) = CollectBuildableTypes(); foreach (var type in buildableTypes) { - if (customizedBuildableTypes.Contains(GetTypeIdentity(type))) - { - continue; - } - // Use the full attribute type name to ensure proper compilation var attributeType = new CSharpType(typeof(ModelReaderWriterBuildableAttribute)); var attributeStatement = new AttributeStatement(attributeType, TypeOf(type)); @@ -73,11 +56,6 @@ protected override IReadOnlyList BuildAttributes() } foreach (var provider in buildableProviders) { - if (!ShouldWriteProvider(provider) || customizedBuildableTypes.Contains(GetTypeIdentity(provider.Type))) - { - continue; - } - // Use the full attribute type name to ensure proper compilation var attributeType = new CSharpType(typeof(ModelReaderWriterBuildableAttribute)); var attributeStatement = new AttributeStatement(attributeType, TypeOf(provider.Type)); @@ -98,51 +76,6 @@ protected override IReadOnlyList BuildAttributes() return attributes.OrderBy(a => GetSimpleTypeName(a.Key)).Select(kvp => kvp.Value).ToList(); } - private static bool IsBuildableAttribute(MethodBodyStatement statement) - { - var attribute = statement switch - { - AttributeStatement directAttribute => directAttribute, - SuppressionStatement suppression => suppression.AsStatement(), - _ => null - }; - - return attribute?.Type.Equals(typeof(ModelReaderWriterBuildableAttribute)) == true; - } - - private HashSet GetCustomizedBuildableTypes() - { - var customizedTypes = new HashSet(StringComparer.Ordinal); - foreach (var attribute in CustomCodeView?.Attributes ?? []) - { - if (!string.Equals( - attribute.Type.FullyQualifiedName, - typeof(ModelReaderWriterBuildableAttribute).FullName, - StringComparison.Ordinal)) - { - continue; - } - - foreach (var argument in attribute.Arguments) - { - if (argument is TypeOfExpression typeOf) - { - customizedTypes.Add(GetTypeIdentity(typeOf.Type)); - } - } - } - - return customizedTypes; - } - - private static string GetTypeIdentity(CSharpType type) - { - var name = type.FullyQualifiedName.TrimStart('.'); - return type.Arguments.Count == 0 - ? name - : $"{name}<{string.Join(",", type.Arguments.Select(GetTypeIdentity))}>"; - } - /// /// Collects all types that implement IPersistableModel, including all models and their properties /// that are also IPersistableModel types, recursively without duplicates. @@ -154,6 +87,7 @@ private static string GetTypeIdentity(CSharpType type) var visitedBaseProviders = new HashSet(ReferenceEqualityComparer.Instance); var buildableProviders = new HashSet(s_typeProviderNameComparer); var buildableTypes = new HashSet(s_cSharpTypeNameComparer); + // Base-model traversal can encounter equivalent provider instances that are not reference-equal to // the output-library roots, so keep the output-library provider set name-comparable. var contextEligibleOutputProviders = new HashSet( @@ -163,13 +97,8 @@ private static string GetTypeIdentity(CSharpType type) // Process each output-library provider recursively to discover types from methods and properties. foreach (var provider in contextEligibleOutputProviders) { - if (!ShouldWriteProvider(provider)) - { - continue; - } - // Only output-library providers get standalone context entries. - if (ShouldAddStandaloneBuildableProvider(provider)) + if (ImplementsModelReaderWriter(provider)) { buildableProviders.Add(provider); } @@ -261,10 +190,9 @@ private void CollectBuildableTypesRecursiveCore( { // Traverse base model properties for discoverable types, but do not add the base model // itself as a context entry unless it was in the output-library seed set. - var baseModelProvider = modelProvider.BaseModelProvider; - if (visitedBaseProviders.Add(baseModelProvider)) + if (visitedBaseProviders.Add(modelProvider.BaseModelProvider)) { - CollectBuildableTypesRecursiveCore(baseModelProvider, visitedTypes, visitedTypeProviders, visitedBaseProviders, buildableProviders, buildableTypes); + CollectBuildableTypesRecursiveCore(modelProvider.BaseModelProvider, visitedTypes, visitedTypeProviders, visitedBaseProviders, buildableProviders, buildableTypes); } } else @@ -292,11 +220,6 @@ private void CollectBuildableTypesFromFrameworkType( try { - if (!IsResolvableBuildableType(frameworkType)) - { - return; - } - buildableTypes.Add(frameworkType.FrameworkType); var type = frameworkType.FrameworkType; var properties = type.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance); @@ -503,23 +426,6 @@ private static bool ImplementsModelReaderWriter(TypeProvider typeProvider) return false; } - private static bool ShouldAddStandaloneBuildableProvider(TypeProvider provider) - => IsResolvableBuildableType(provider.Type) - && ImplementsModelReaderWriter(provider) - && HasWritableModelReaderWriterSerialization(provider); - - private static bool HasWritableModelReaderWriterSerialization(TypeProvider provider) - { - if (provider is not ModelProvider) - { - return true; - } - - return provider.SerializationProviders - .OfType() - .Any(ShouldWriteProvider); - } - private static void AddAttributeForType( Dictionary attributes, AttributeStatement attributeStatement, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs index ddd5ffff87b..f6f6cebbd49 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs @@ -108,9 +108,6 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override string BuildName() => "ModelSerializationExtensions"; - protected override IReadOnlyList BuildBodyDependencyTypes() => - [ScmCodeModelGenerator.Instance.TypeFormattersDefinition.Type]; - protected override FieldProvider[] BuildFields() { return [WireOptionsField, _jsonDocumentOptionsField, .. BuildXmlFields()]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs index 2b50fff372e..5d76b8f44a1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Xml.cs @@ -67,7 +67,7 @@ private MethodProvider BuildXmlModelWriteCoreMethod() MethodSignatureModifiers modifiers = _isStruct ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Internal | MethodSignatureModifiers.Virtual; - if (_shouldOverrideMethods) + if (_shouldOverrideXmlMethods) { modifiers = MethodSignatureModifiers.Internal | MethodSignatureModifiers.Override; } @@ -81,7 +81,7 @@ private MethodProvider BuildXmlModelWriteCoreMethod() private MethodBodyStatement[] BuildXmlModelWriteCoreMethodBody() { - var categorizedProperties = _shouldOverrideMethods + var categorizedProperties = _shouldOverrideXmlMethods ? CategorizedXmlProperties : AllCategorizedXmlProperties; var statements = new List @@ -90,7 +90,7 @@ private MethodBodyStatement[] BuildXmlModelWriteCoreMethodBody() MethodBodyStatement.EmptyLine }; - if (_shouldOverrideMethods) + if (_shouldOverrideXmlMethods) { statements.Add(Base.Invoke(XmlModelWriteCoreMethodName, _xmlWriterParameter, _serializationOptionsParameter).Terminate()); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs index adbb3026dda..16ac19e14e9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs @@ -53,10 +53,16 @@ public partial class MrwSerializationTypeDefinition : TypeProvider private readonly ScopedApi _mrwOptionsParameterSnippet; private readonly ScopedApi _jsonElementParameterSnippet; private readonly ScopedApi _isNotEqualToWireConditionSnippet; - private readonly CSharpType _jsonModelTInterface; - private readonly CSharpType? _jsonModelObjectInterface; - private readonly CSharpType _persistableModelTInterface; - private readonly CSharpType? _persistableModelObjectInterface; + // These interface types depend on _model.Type. Build them lazily so we do not cache a + // CSharpType before delayed base model resolution has updated the model's inheritance. + private CSharpType? _jsonModelTInterfaceValue; + private CSharpType _jsonModelTInterface => _jsonModelTInterfaceValue ??= new CSharpType(typeof(IJsonModel<>), SerializationInterfaceType.Type); + private CSharpType? _jsonModelObjectInterface; + private CSharpType? JsonModelObjectInterface => _isStruct ? _jsonModelObjectInterface ??= (CSharpType)typeof(IJsonModel) : null; + private CSharpType? _persistableModelTInterfaceValue; + private CSharpType _persistableModelTInterface => _persistableModelTInterfaceValue ??= new CSharpType(typeof(IPersistableModel<>), SerializationInterfaceType.Type); + private CSharpType? _persistableModelObjectInterface; + private CSharpType? PersistableModelObjectInterface => _isStruct ? _persistableModelObjectInterface ??= (CSharpType)typeof(IPersistableModel) : null; private readonly ModelProvider _model; private readonly InputModelType _inputModel; private readonly FieldProvider? _rawDataField; @@ -67,10 +73,20 @@ public partial class MrwSerializationTypeDefinition : TypeProvider private readonly bool _supportsXml; private ConstructorProvider? _serializationConstructor; // Flag to determine if the model should override the serialization methods - private readonly bool _shouldOverrideMethods; - private readonly bool _shouldSkipDerivedSerializationMethodOverrides; + private bool? _shouldOverrideMethods; + private bool ShouldOverrideMethods => _shouldOverrideMethods ??= _model.BaseModelProvider != null && !_isStruct; + private bool? _shouldSkipSerializationMethodOverrides; + private bool ShouldSkipSerializationMethodOverrides => _shouldSkipSerializationMethodOverrides ??= ShouldSkipDerivedSerializationMethodOverrides(_model.BaseModelProvider); + private readonly bool _shouldOverrideXmlMethods; private readonly Lazy _additionalProperties; + // Unknown discriminator models use their base model as the serialization interface type. + // This can also touch model.Type, so defer it until serialization method/interface emission. + private TypeProvider SerializationInterfaceType => _serializationInterfaceType ??= _inputModel.IsUnknownDiscriminatorModel + ? ScmCodeModelGenerator.Instance.TypeFactory.CreateModel(_inputModel.BaseModel!)! + : _model; + private TypeProvider? _serializationInterfaceType; + private CSharpType RootType => _rootType ??= GetRootModelType(); private CSharpType? _rootType; @@ -84,17 +100,10 @@ public MrwSerializationTypeDefinition(InputModelType inputModel, ModelProvider m _isStruct = _model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Struct); _supportsXml = inputModel.Usage.HasFlag(InputModelTypeUsage.Xml); _supportsJson = inputModel.Usage.HasFlag(InputModelTypeUsage.Json) || !_supportsXml; - // Initialize the serialization interfaces - var interfaceType = inputModel.IsUnknownDiscriminatorModel ? ScmCodeModelGenerator.Instance.TypeFactory.CreateModel(inputModel.BaseModel!)! : _model; - _jsonModelTInterface = new CSharpType(typeof(IJsonModel<>), interfaceType.Type); - _jsonModelObjectInterface = _isStruct ? (CSharpType)typeof(IJsonModel) : null; - _persistableModelTInterface = new CSharpType(typeof(IPersistableModel<>), interfaceType.Type); - _persistableModelObjectInterface = _isStruct ? (CSharpType)typeof(IPersistableModel) : null; + _shouldOverrideXmlMethods = _model.BaseModelProvider != null && !_isStruct; _rawDataField = _model.Fields.FirstOrDefault(f => f.Name == AdditionalPropertiesHelper.AdditionalBinaryDataPropsFieldName); _additionalBinaryDataProperty = new(GetAdditionalBinaryDataPropertiesProp); _additionalProperties = new(() => [.. _model.Properties.Where(p => p.IsAdditionalProperties)]); - _shouldOverrideMethods = _model.BaseModelProvider != null && !_isStruct; - _shouldSkipDerivedSerializationMethodOverrides = ShouldSkipDerivedSerializationMethodOverrides(_model.BaseModelProvider); _utf8JsonWriterSnippet = _utf8JsonWriterParameter.As(); _mrwOptionsParameterSnippet = _serializationOptionsParameter.As(); _jsonElementParameterSnippet = _jsonElementDeserializationParam.As(); @@ -121,13 +130,6 @@ protected override IReadOnlyList BuildMethodsForBackCompatibilit protected override CSharpType? BuildBaseType() => _model.BaseType; - protected override IReadOnlyList BuildHelperDependencyTypes() => _rawDataField != null || _additionalProperties.Value.Length > 0 - ? [ScmCodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType] - : []; - - protected override IReadOnlyList BuildBodyDependencyTypes() => - [ScmCodeModelGenerator.Instance.SystemOptionalDefinition.Type, ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.Type]; - protected override SuppressionStatement[] BuildDisabledFileWarnings() { if (_model.CanonicalView.Properties.Any(p => ScmModelProvider.IsFileBinaryContentType(p.Type))) @@ -440,17 +442,19 @@ protected override CSharpType[] BuildImplements() if (_supportsJson) { interfaces.Add(_jsonModelTInterface); - if (_jsonModelObjectInterface != null) + var jsonModelObjectInterface = JsonModelObjectInterface; + if (jsonModelObjectInterface != null) { - interfaces.Add(_jsonModelObjectInterface); + interfaces.Add(jsonModelObjectInterface); } } else if (_supportsXml) { interfaces.Add(_persistableModelTInterface); - if (_persistableModelObjectInterface != null) + var persistableModelObjectInterface = PersistableModelObjectInterface; + if (persistableModelObjectInterface != null) { - interfaces.Add(_persistableModelObjectInterface); + interfaces.Add(persistableModelObjectInterface); } } @@ -480,7 +484,7 @@ internal MethodProvider BuildJsonModelWriteMethodObjectDeclaration() var castToT = This.CastTo(_jsonModelTInterface); return new MethodProvider ( - new MethodSignature(nameof(IJsonModel.Write), null, MethodSignatureModifiers.None, null, null, [_utf8JsonWriterParameter, _serializationOptionsParameter], ExplicitInterface: _jsonModelObjectInterface), + new MethodSignature(nameof(IJsonModel.Write), null, MethodSignatureModifiers.None, null, null, [_utf8JsonWriterParameter, _serializationOptionsParameter], ExplicitInterface: JsonModelObjectInterface), castToT.Invoke(nameof(IJsonModel.Write), [_utf8JsonWriterParameter, _serializationOptionsParameter]), this ); @@ -495,7 +499,7 @@ internal MethodProvider BuildJsonModelCreateMethodObjectDeclaration() var castToT = This.CastTo(_jsonModelTInterface); return new MethodProvider ( - new MethodSignature(nameof(IJsonModel.Create), null, MethodSignatureModifiers.None, typeof(object), null, [_utf8JsonReaderParameter, _serializationOptionsParameter], ExplicitInterface: _jsonModelObjectInterface), + new MethodSignature(nameof(IJsonModel.Create), null, MethodSignatureModifiers.None, typeof(object), null, [_utf8JsonReaderParameter, _serializationOptionsParameter], ExplicitInterface: JsonModelObjectInterface), castToT.Invoke(nameof(IJsonModel.Create), [_utf8JsonReaderParameter.AsArgument(), _serializationOptionsParameter]), this ); @@ -511,7 +515,7 @@ internal MethodProvider BuildPersistableModelWriteMethodObjectDeclaration() var returnType = typeof(BinaryData); return new MethodProvider ( - new MethodSignature(nameof(IPersistableModel.Write), null, MethodSignatureModifiers.None, returnType, null, [_serializationOptionsParameter], ExplicitInterface: _persistableModelObjectInterface), + new MethodSignature(nameof(IPersistableModel.Write), null, MethodSignatureModifiers.None, returnType, null, [_serializationOptionsParameter], ExplicitInterface: PersistableModelObjectInterface), castToT.Invoke(nameof(IPersistableModel.Write), [_serializationOptionsParameter]), this ); @@ -527,7 +531,7 @@ internal MethodProvider BuildPersistableModelCreateMethodObjectDeclaration() var returnType = typeof(object); return new MethodProvider ( - new MethodSignature(nameof(IPersistableModel.Create), null, MethodSignatureModifiers.None, returnType, null, [_dataParameter, _serializationOptionsParameter], ExplicitInterface: _persistableModelObjectInterface), + new MethodSignature(nameof(IPersistableModel.Create), null, MethodSignatureModifiers.None, returnType, null, [_dataParameter, _serializationOptionsParameter], ExplicitInterface: PersistableModelObjectInterface), castToT.Invoke(nameof(IPersistableModel.Create), [_dataParameter, _serializationOptionsParameter]), this ); @@ -541,7 +545,7 @@ internal MethodProvider BuildJsonModelWriteCoreMethod() MethodSignatureModifiers modifiers = _isStruct ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (_shouldOverrideMethods) + if (ShouldOverrideMethods) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -563,7 +567,7 @@ internal MethodProvider BuildPersistableModelWriteCoreMethod() ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (_shouldOverrideMethods && !_shouldSkipDerivedSerializationMethodOverrides) + if (ShouldOverrideMethods && !ShouldSkipSerializationMethodOverrides) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -587,7 +591,7 @@ internal MethodProvider BuildPersistableModelCreateCoreMethod() ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (_shouldOverrideMethods && !_shouldSkipDerivedSerializationMethodOverrides) + if (ShouldOverrideMethods && !ShouldSkipSerializationMethodOverrides) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -635,7 +639,7 @@ internal MethodProvider BuildJsonModelCreateCoreMethod() ? MethodSignatureModifiers.Private : MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual; - if (_shouldOverrideMethods && !_shouldSkipDerivedSerializationMethodOverrides) + if (ShouldOverrideMethods && !ShouldSkipSerializationMethodOverrides) { modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override; } @@ -807,7 +811,7 @@ internal MethodProvider BuildPersistableModelGetFormatFromOptionsObjectDeclarati // string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)this).GetFormatFromOptions(options); return new MethodProvider ( - new MethodSignature(nameof(IPersistableModel.GetFormatFromOptions), null, MethodSignatureModifiers.None, typeof(string), null, [_serializationOptionsParameter], ExplicitInterface: _persistableModelObjectInterface), + new MethodSignature(nameof(IPersistableModel.GetFormatFromOptions), null, MethodSignatureModifiers.None, typeof(string), null, [_serializationOptionsParameter], ExplicitInterface: PersistableModelObjectInterface), castToT.Invoke(nameof(IPersistableModel.GetFormatFromOptions), [_serializationOptionsParameter]), this ); @@ -1066,7 +1070,7 @@ private MethodBodyStatement[] BuildPersistableModelCreateCoreMethodBody() private MethodBodyStatement CallBaseJsonModelWriteCore(bool isDynamicModelWithNonDynamicBase) { // base.() - bool callBaseWriteMethod = _shouldOverrideMethods + bool callBaseWriteMethod = ShouldOverrideMethods && (_jsonPatchProperty is null || !isDynamicModelWithNonDynamicBase); return callBaseWriteMethod ? Base.Invoke(JsonModelWriteCoreMethodName, [_utf8JsonWriterParameter, _serializationOptionsParameter]).Terminate() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs index bc9fa8eeceb..3ef2c7c4c62 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs @@ -57,9 +57,6 @@ protected override string BuildRelativeFilePath() protected override SuppressionStatement[] BuildDisabledFileWarnings() => [new SuppressionStatement(null, Literal(ScmModelProvider.FileBinaryContentDiagnosticId), ScmModelProvider.ScmEvaluationTypeSuppressionJustification)]; - protected override IReadOnlyList BuildBodyDependencyTypes() => - [ScmCodeModelGenerator.Instance.SystemOptionalDefinition.Type, ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition.Type]; - protected override ConstructorProvider[] BuildConstructors() { if (_hasJsonOrXmlUsage) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs index e4a41b74c88..288b7f1af24 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs @@ -17,7 +17,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { internal class PipelineRequestHeadersExtensionsDefinition : TypeProvider { - internal const string SetDelimitedMethodName = "SetDelimited"; + private const string _setDelimited = "SetDelimited"; private const string _addWithPrefix = "Add"; private ParameterProvider _pipelineRequestHeadersParam; public PipelineRequestHeadersExtensionsDefinition() @@ -56,7 +56,7 @@ private MethodProvider BuildSetDelimited(bool hasFormat) ? new[] { _pipelineRequestHeadersParam, nameParameter, valueParameter, delimiterParameter, formatParameter } : new[] { _pipelineRequestHeadersParam, nameParameter, valueParameter, delimiterParameter }; MethodSignature signature = new MethodSignature( - Name: SetDelimitedMethodName, + Name: _setDelimited, Modifiers: modifiers, Parameters: parameters, ReturnType: null, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs index 9468f7c58cf..63c100116e0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestProvider.cs @@ -33,9 +33,7 @@ public override MethodBodyStatement SetHeaders(IReadOnlyList ar => Original.Property(nameof(PipelineRequest.Headers)).Invoke(nameof(PipelineRequestHeaders.Set), arguments).Terminate(); public override MethodBodyStatement AddCollectionHeaders(ValueExpression prefix, ValueExpression headers) - => Original.Property(nameof(PipelineRequest.Headers)) - .Invoke(nameof(PipelineRequestHeaders.Add), [prefix, headers], typeArguments: null, callAsAsync: false, extensionType: ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition.Type) - .Terminate(); + => Original.Property(nameof(PipelineRequest.Headers)).Invoke(nameof(PipelineRequestHeaders.Add), [prefix, headers]).Terminate(); public override HttpRequestApi ToExpression() => this; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs index 9076d21ded5..f00d78571d0 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/RestClientProvider.cs @@ -28,7 +28,6 @@ public class RestClientProvider : TypeProvider private const string TopParameterName = "top"; private const string MaxCountParameterName = "maxCount"; private const string MaxPageSizeParameterName = "maxPageSize"; - private const string ContentParameterName = "content"; private static readonly Dictionary _knownSpecialHeaderParams = new(StringComparer.OrdinalIgnoreCase) { @@ -79,62 +78,6 @@ protected override FieldProvider[] BuildFields() return [.. pipelineMessage20xClassifiersFields]; } - protected override IReadOnlyList BuildHelperDependencyTypes() - { - var uriBuilderType = ScmCodeModelGenerator.Instance.TypeFactory.HttpRequestApi.ToExpression().UriBuilderType; - var dependencies = new List(); - var dependencyNames = new HashSet(StringComparer.Ordinal); - if (uriBuilderType == typeof(ClientUriBuilderDefinition)) - { - TryAddDependency(dependencies, dependencyNames, new ClientUriBuilderDefinition().Type); - } - - foreach (var serviceMethod in _inputClient.Methods) - { - foreach (var parameter in serviceMethod.Operation.Parameters) - { - if (IsContentTypeParameter(parameter) || - parameter is not InputHeaderParameter and not InputQueryParameter) - { - continue; - } - - var type = ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(parameter.Type); - if (type?.IsDictionary == true) - { - TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType); - if (parameter is InputHeaderParameter headerParameter && - !string.IsNullOrEmpty(headerParameter.CollectionHeaderPrefix)) - { - TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition.Type); - } - } - else if (type?.IsCollection == true) - { - TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.TypeFactory.ListInitializationType); - } - } - } - - return dependencies; - } - - protected override IReadOnlyList BuildBodyDependencyTypes() - { - var dependencies = new List(); - var dependencyNames = new HashSet(StringComparer.Ordinal); - TryAddDependency(dependencies, dependencyNames, ScmCodeModelGenerator.Instance.TypeFormattersDefinition.Type); - return dependencies; - } - - private static void TryAddDependency(List dependencies, HashSet dependencyNames, CSharpType dependency) - { - if (dependencyNames.Add(dependency.FullyQualifiedName)) - { - dependencies.Add(dependency); - } - } - protected override ScmMethodProvider[] BuildMethods() { List methods = new List(); @@ -332,7 +275,7 @@ private MethodBodyStatements BuildMessage( } else { - var contentParam = GetBodyContentParameter(signature.Parameters); + var contentParam = signature.Parameters.FirstOrDefault(p => p.Name == "content" && p.Location == ParameterLocation.Body); statements.AddRange(AppendHeaderParameters(request, operation, paramMap, contentParam: contentParam)); statements.AddRange(GetSetContent(request, signature.Parameters)); } @@ -399,14 +342,11 @@ private Dictionary GetReinjectedParametersMap( private IReadOnlyList GetSetContent(HttpRequestApi request, IReadOnlyList parameters) { - var contentParam = GetBodyContentParameter(parameters); + var contentParam = parameters.FirstOrDefault( + p => p.Location == ParameterLocation.Body); return contentParam is null ? [] : [request.Content().Assign(contentParam).Terminate()]; } - private static ParameterProvider? GetBodyContentParameter(IReadOnlyList parameters) - => parameters.FirstOrDefault(static p => p.InputParameter is InputBodyParameter) ?? - parameters.FirstOrDefault(static p => p.Location == ParameterLocation.Body); - private Dictionary, PropertyProvider> BuildPipelineMessage20xClassifiers() { // Contains a mapping of classifier status codes to their corresponding pipeline message classifier property @@ -979,9 +919,7 @@ private static void AppendLiteralSegment(ScopedApi uri, string literal, List paramMap, InputOperation operation, InputParameter inputParam, out CSharpType? type, out SerializationFormat? serializationFormat, out ValueExpression? valueExpression) { - type = IsContentTypeParameter(inputParam, includeInputHeaderParameter: false) - ? null - : ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(inputParam.Type); + type = ScmCodeModelGenerator.Instance.TypeFactory.CreateCSharpType(inputParam.Type); serializationFormat = null; if (inputParam.IsApiVersion && ClientProvider.IsMultiServiceClient) @@ -1292,17 +1230,7 @@ internal static List GetMethodParameters( } else { - if (IsContentTypeParameter(inputParam)) - { - parameter.Type = new CSharpType(typeof(string), isNullable: !inputParam.IsRequired); - parameter.Validation = inputParam.IsRequired - ? ParameterValidationType.AssertNotNullOrEmpty - : ParameterValidationType.None; - } - else - { - parameter.Type = parameter.Type.IsEnum ? parameter.Type.UnderlyingEnumType : parameter.Type; - } + parameter.Type = parameter.Type.IsEnum ? parameter.Type.UnderlyingEnumType : parameter.Type; } } else if (methodType is ScmMethodKind.Convenience && @@ -1321,8 +1249,8 @@ internal static List GetMethodParameters( break; case ParameterLocation.Query: case ParameterLocation.Header: - if (IsContentTypeParameter(inputParam) - && !ShouldPreserveContentTypeBeforeBody(methodType, serviceMethod, client.BackCompatProvider)) + if (inputParam is InputHeaderParameter { IsContentType: true } + && !HasContentTypeBeforeBodyInLastContract(serviceMethod.Name, client.BackCompatProvider)) { sortedParams.Add(contentType++, parameter); } @@ -1364,42 +1292,12 @@ internal static List GetMethodParameters( return [.. sortedParams.Values]; } - private static bool ShouldPreserveContentTypeBeforeBody( - ScmMethodKind methodType, - InputServiceMethod serviceMethod, - TypeProvider backCompatProvider) - { - if (HasContentTypeBeforeBodyInLastContract(serviceMethod, backCompatProvider)) - { - return true; - } - - // The baseline contract used for back-compat may come from a released package and can - // lag the generated sources in the repo. For generated convenience methods that expose a - // domain-named body parameter, keep the historic contentType-before-body ordering to avoid - // repo regen churn while protocol methods continue using the normalized "content" body. - return methodType is ScmMethodKind.Convenience && HasNamedBodyParameter(serviceMethod); - } - - private static bool HasNamedBodyParameter(InputServiceMethod serviceMethod) - { - foreach (var parameter in serviceMethod.Parameters) - { - if (parameter.Location == InputRequestLocation.Body && - !string.Equals(parameter.Name, ContentParameterName, StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - - return false; - } - private static bool HasLiteralContentTypeHeader(InputOperation operation) { foreach (var p in operation.Parameters) { - if (p is InputHeaderParameter { IsContentType: true } && p.Type is InputLiteralType) + if (p is InputHeaderParameter { IsContentType: true } header + && header.Type is InputLiteralType) { return true; } @@ -1407,19 +1305,15 @@ private static bool HasLiteralContentTypeHeader(InputOperation operation) return false; } - private static bool IsContentTypeParameter(InputParameter parameter, bool includeInputHeaderParameter = true) => - includeInputHeaderParameter && parameter is InputHeaderParameter { IsContentType: true } || - parameter is InputMethodParameter { Location: InputRequestLocation.Header } && - string.Equals(parameter.SerializedName, "Content-Type", StringComparison.OrdinalIgnoreCase); - /// /// Checks if the last contract view contains a method matching the given name where - /// a "contentType" parameter appears before the body parameter. + /// a "contentType" parameter appears before the body ("content") parameter. /// If so, we should preserve that ordering for backward compatibility. /// - private static bool HasContentTypeBeforeBodyInLastContract(InputServiceMethod serviceMethod, TypeProvider backCompatProvider) + private static bool HasContentTypeBeforeBodyInLastContract(string methodName, TypeProvider backCompatProvider) { const string contentTypeParamName = "contentType"; + const string contentParamName = "content"; var lastContractMethods = backCompatProvider.LastContractView?.Methods; if (lastContractMethods == null || lastContractMethods.Count == 0) @@ -1427,9 +1321,8 @@ private static bool HasContentTypeBeforeBodyInLastContract(InputServiceMethod se return false; } - var syncMethodName = serviceMethod.Name; - var asyncMethodName = serviceMethod.Name + "Async"; - var bodyParameterNames = GetBodyParameterNames(serviceMethod); + var syncMethodName = methodName; + var asyncMethodName = methodName + "Async"; foreach (var method in lastContractMethods) { @@ -1448,7 +1341,7 @@ private static bool HasContentTypeBeforeBodyInLastContract(InputServiceMethod se { contentTypeIndex = i; } - else if (IsLastContractBodyParameter(param, bodyParameterNames)) + else if (string.Equals(param.Name, contentParamName, StringComparison.OrdinalIgnoreCase)) { bodyIndex = i; } @@ -1468,45 +1361,6 @@ private static bool HasContentTypeBeforeBodyInLastContract(InputServiceMethod se return false; } - private static HashSet GetBodyParameterNames(InputServiceMethod serviceMethod) - { - var names = new HashSet(StringComparer.OrdinalIgnoreCase); - foreach (var parameter in serviceMethod.Parameters) - { - if (parameter.Location == InputRequestLocation.Body) - { - names.Add(parameter.Name); - } - } - - foreach (var parameter in serviceMethod.Operation.Parameters) - { - if (parameter is InputBodyParameter) - { - names.Add(parameter.Name); - } - } - - return names; - } - - private static bool IsLastContractBodyParameter(ParameterProvider parameter, HashSet bodyParameterNames) - { - if (parameter.InputParameter is InputBodyParameter || - parameter.Location == ParameterLocation.Body || - bodyParameterNames.Contains(parameter.Name)) - { - return true; - } - - if (string.Equals(parameter.Name, ContentParameterName, StringComparison.OrdinalIgnoreCase)) - { - return true; - } - - return false; - } - internal static InputModelType GetSpreadParameterModel(InputParameter inputParam) { if (inputParam.Type is InputModelType model) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs index ebf9a548fb7..b18c378a1bd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs @@ -29,6 +29,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers public class ScmMethodProviderCollection : IReadOnlyList { private readonly MethodProvider _createRequestMethod; + private static readonly ClientPipelineExtensionsDefinition _clientPipelineExtensionsDefinition = new(); private static readonly CancellationTokenExtensionsDefinition _cancellationTokenExtensionsDefinition = new(); private const string JsonMediaType = "application/json"; private const string XmlMediaType = "application/xml"; @@ -1151,7 +1152,7 @@ private ScmMethodProvider BuildProtocolMethod(MethodProvider createRequestMethod This.Invoke(createRequestMethod.Signature, BuildCreateRequestArguments(createRequestMethod.Signature, bodyParameters)), out var message), Return(ScmCodeModelGenerator.Instance.TypeFactory.ClientResponseApi.ToExpression().FromResponse(client - .PipelineProperty.Invoke(processMessageName, [message, requestOptionsParameter], isAsync, true, extensionType: ScmCodeModelGenerator.Instance.ClientPipelineExtensionsDefinition.Type))) + .PipelineProperty.Invoke(processMessageName, [message, requestOptionsParameter], isAsync, true, extensionType: _clientPipelineExtensionsDefinition.Type))) ]; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs index e902afd7c79..af294640060 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/SerializationFormatDefinition.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -46,7 +45,6 @@ protected override TypeSignatureModifiers BuildDeclarationModifiers() protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "SerializationFormat"; - protected override FormattableString BuildDescription() => $"The serialization format."; protected override TypeProvider[] BuildSerializationProviders() => []; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs index d704b9b2c27..ba4c5ffe6a1 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs @@ -30,22 +30,6 @@ public class ScmCodeModelGenerator : CodeModelGenerator internal SerializationFormatDefinition SerializationFormatDefinition { get; } = new SerializationFormatDefinition(); - private SystemOptionalDefinition? _systemOptionalDefinition; - internal SystemOptionalDefinition SystemOptionalDefinition => - _systemOptionalDefinition ??= new SystemOptionalDefinition(); - - private TypeFormattersDefinition? _typeFormattersDefinition; - internal TypeFormattersDefinition TypeFormattersDefinition => - _typeFormattersDefinition ??= new TypeFormattersDefinition(); - - private ClientPipelineExtensionsDefinition? _clientPipelineExtensionsDefinition; - internal ClientPipelineExtensionsDefinition ClientPipelineExtensionsDefinition => - _clientPipelineExtensionsDefinition ??= new ClientPipelineExtensionsDefinition(); - - private PipelineRequestHeadersExtensionsDefinition? _pipelineRequestHeadersExtensionsDefinition; - internal PipelineRequestHeadersExtensionsDefinition PipelineRequestHeadersExtensionsDefinition => - _pipelineRequestHeadersExtensionsDefinition ??= new PipelineRequestHeadersExtensionsDefinition(); - /// /// Gets the options that control ConfigurationSchema.json generation. /// @@ -65,7 +49,6 @@ protected override void Configure() AddMetadataReference(MetadataReference.CreateFromFile(typeof(ClientResult).Assembly.Location)); AddMetadataReference(MetadataReference.CreateFromFile(typeof(BinaryData).Assembly.Location)); AddMetadataReference(MetadataReference.CreateFromFile(typeof(JsonSerializer).Assembly.Location)); - AddCustomCodeMethodDependency(PipelineRequestHeadersExtensionsDefinition.SetDelimitedMethodName, PipelineRequestHeadersExtensionsDefinition); AddTypeToKeep(ModelReaderWriterContextDefinition.s_name, isRoot: false); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs index e7d755c0239..dadaad84144 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs @@ -16,11 +16,6 @@ private static TypeProvider[] BuildClientTypes() var inputClients = ScmCodeModelGenerator.Instance.InputLibrary.InputNamespace.RootClients; var types = new HashSet(); - foreach (var inputClient in inputClients) - { - CreateClientProviders(inputClient); - } - foreach (var inputClient in inputClients) { BuildClient(inputClient, types); @@ -29,16 +24,6 @@ private static TypeProvider[] BuildClientTypes() return [.. types]; } - private static void CreateClientProviders(InputClient inputClient) - { - foreach (var child in inputClient.Children) - { - CreateClientProviders(child); - } - - ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(inputClient); - } - private static void BuildClient(InputClient inputClient, HashSet types) { foreach (var child in inputClient.Children) @@ -80,12 +65,13 @@ private static void BuildClient(InputClient inputClient, HashSet t protected override TypeProvider[] BuildTypeProviders() { var baseTypes = base.BuildTypeProviders(); + var systemOptionalProvider = new SystemOptionalDefinition(); for (var i = 0; i < baseTypes.Length; i++) { if (baseTypes[i] is OptionalDefinition) { - baseTypes[i] = ScmCodeModelGenerator.Instance.SystemOptionalDefinition; + baseTypes[i] = systemOptionalProvider; } } @@ -94,14 +80,14 @@ protected override TypeProvider[] BuildTypeProviders() ..BuildClientTypes(), ScmCodeModelGenerator.Instance.ModelSerializationExtensionsDefinition, ScmCodeModelGenerator.Instance.SerializationFormatDefinition, - ScmCodeModelGenerator.Instance.TypeFormattersDefinition, + new TypeFormattersDefinition(), new ErrorResultDefinition(), new ClientUriBuilderDefinition(), new Utf8JsonBinaryContentDefinition(), new BinaryContentHelperDefinition(), - ScmCodeModelGenerator.Instance.ClientPipelineExtensionsDefinition, + new ClientPipelineExtensionsDefinition(), new CancellationTokenExtensionsDefinition(), - ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition, + new PipelineRequestHeadersExtensionsDefinition(), .. GetMultipartFormDataTypes(), new ModelReaderWriterContextDefinition() ]; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs index d27c45c1fe4..588a2094b12 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/HttpRequestApiSnippets.cs @@ -26,9 +26,7 @@ public static MethodBodyStatement SetContent(this ScopedApi pip public static MethodBodyStatement SetHeaderDelimited(this HttpRequestApi pipelineRequest, string name, ValueExpression value, ValueExpression delimiter, ValueExpression? format = null) { ValueExpression[] parameters = format != null ? [Literal(name), value, delimiter, format] : [Literal(name), value, delimiter]; - return pipelineRequest.Property(nameof(PipelineRequest.Headers)) - .Invoke(PipelineRequestHeadersExtensionsDefinition.SetDelimitedMethodName, parameters, typeArguments: null, callAsAsync: false, extensionType: ScmCodeModelGenerator.Instance.PipelineRequestHeadersExtensionsDefinition.Type) - .Terminate(); + return pipelineRequest.Property(nameof(PipelineRequest.Headers)).Invoke("SetDelimited", parameters).Terminate(); } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs index f119d0a52a5..3cdcd91a129 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientOptionsProviderTests.cs @@ -383,44 +383,6 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.IsTrue(body?.Contains("ServiceVersion.V2024_01_01 => \"2024-01-01\"")); } - [Test] - public async Task CustomizedPublicConstructorKeepsNestedServiceVersionPublic() - { - string[] apiVersions = ["2023-10-01-preview-1", "2023-11-01", "2024-01-01"]; - var enumValues = apiVersions.Select((a, index) => (a, a)); - var inputEnum = InputFactory.StringEnum( - "ServiceVersion", - enumValues, - access: string.Empty, - usage: InputModelTypeUsage.ApiVersionEnum, - clientNamespace: "SampleNamespace"); - var inputClient = InputFactory.Client("RawClient", clientNamespace: "SampleNamespace"); - - var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( - apiVersions: () => apiVersions, - inputEnums: () => [inputEnum], - clients: () => [inputClient], - compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); - - var clientProvider = mockGenerator.Object.OutputLibrary.TypeProviders - .OfType() - .Single(provider => provider.Name == "RawClient"); - var clientOptionsProvider = clientProvider.ClientOptions; - Assert.IsNotNull(clientOptionsProvider); - var serviceVersionProvider = clientOptionsProvider!.NestedTypes.Single(); - Assert.IsTrue(serviceVersionProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsNotNull(clientOptionsProvider.CustomCodeView); - var customConstructor = clientOptionsProvider.CustomCodeView!.Constructors.Single(); - var customServiceVersionType = customConstructor.Signature.Parameters.Single().Type; - Assert.IsEmpty(customServiceVersionType.Namespace); - Assert.IsNull(customServiceVersionType.DeclaringType); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(mockGenerator.Object.OutputLibrary.TypeProviders); - - Assert.IsTrue(serviceVersionProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(serviceVersionProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - [Test] public void SingletonCreatedForMultipleClientsWithStandardParameters() { @@ -540,75 +502,6 @@ public void MultipleClientsWithRequiredCustomParametersShareSingletonOptions() Assert.AreEqual("SampleClientOptions", options1!.Name); } - [Test] - public async Task SharedSingletonOptionsArePublicWhenAnyClientIsPublic() - { - List apiVersions = ["1.0"]; - var inputEnum = InputFactory.StringEnum( - "ServiceVersion", - apiVersions.Select(version => (version, version)), - usage: InputModelTypeUsage.ApiVersionEnum); - var apiVersionParameter = InputFactory.QueryParameter( - "apiVersion", - inputEnum, - isRequired: true, - scope: InputParameterScope.Client, - isApiVersion: true); - var operation = InputFactory.Operation("Get", parameters: [apiVersionParameter]); - var client1 = InputFactory.Client( - "InternalClient", - methods: [InputFactory.BasicServiceMethod("Get", operation)], - parameters: [apiVersionParameter]); - var client2 = InputFactory.Client("PublicClient"); - - var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( - clients: () => [client1, client2], - apiVersions: () => apiVersions, - inputEnums: () => [inputEnum], - compilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), - configuration: "{\"unreferenced-types-handling\":\"keepAll\"}"); - - var clientProviders = mockGenerator.Object.OutputLibrary.TypeProviders.OfType().ToList(); - var clientProvider1 = clientProviders.Single(client => client.Name == "InternalClient"); - var clientProvider2 = clientProviders.Single(client => client.Name == "PublicClient"); - Assert.IsTrue(clientProvider1.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(clientProvider2.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - - var options = clientProvider1.ClientOptions; - Assert.AreSame(options, clientProvider2.ClientOptions); - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(mockGenerator.Object.OutputLibrary.TypeProviders); - - Assert.IsTrue(options!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(options.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - - var declaration = new TypeProviderWriter(options).Write().Content; - StringAssert.Contains("public partial class SampleClientOptions", declaration); - StringAssert.DoesNotContain("public internal partial class", declaration); - } - - [Test] - public async Task SharedSingletonOptionsAreInternalWhenAllClientsAreInternal() - { - var client1 = InputFactory.Client("ClientA"); - var client2 = InputFactory.Client("ClientB"); - - var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( - clients: () => [client1, client2], - compilation: async () => await Helpers.GetCompilationFromDirectoryAsync(), - configuration: "{\"unreferenced-types-handling\":\"keepAll\"}"); - - var clientProviders = mockGenerator.Object.OutputLibrary.TypeProviders.OfType().ToList(); - var options = clientProviders.Single(client => client.Name == "ClientA").ClientOptions; - Assert.AreSame(options, clientProviders.Single(client => client.Name == "ClientB").ClientOptions); - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(mockGenerator.Object.OutputLibrary.TypeProviders); - - Assert.IsTrue(options!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(options.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - - var declaration = new TypeProviderWriter(options).Write().Content; - StringAssert.Contains("internal partial class SampleClientOptions", declaration); - } - [Test] public void NamespaceLastSegmentIsUsedForSingletonName() { diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs index bdf17516e28..327e46a7261 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs @@ -392,7 +392,8 @@ public async Task CanChangeClientAccessibility() // Find the client options provider var clientOptionsProvider = mockGenerator.Object.OutputLibrary.TypeProviders.SingleOrDefault(t => t is ClientOptionsProvider); Assert.IsNotNull(clientOptionsProvider); - Assert.IsTrue(clientOptionsProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + // The client options were not customized + Assert.IsTrue(clientOptionsProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); // ClientSettings should not be generated for internal clients Assert.IsNull(((ClientProvider)clientProvider).ClientSettings, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs index d55537cc0d0..79b77b510c9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs @@ -5,7 +5,6 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Linq; using System.Text.Json; using System.Threading.Tasks; @@ -116,113 +115,6 @@ public void ValidateModelReaderWriterBuildableAttributesAreGeneratedForNonModels "The ModelReaderWriterBuildableAttribute should be generated for TestMrwSerialization"); } - [Test] - public void RemovedProvidersDoNotContributeBuildableAttributes() - { - var keptProvider = new TestMrwSerialization(implementsPersistableModel: true, includeDepModelProperty: false); - var removedProvider = new RemovedProviderWithFrameworkDependency(); - var outputLibrary = new TestOutputLibrary([keptProvider, removedProvider]); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => outputLibrary); - - try - { - CodeModelGenerator.Instance.AddTypeToKeep(keptProvider); - ProviderReferenceMapAnalyzer.Analyze(ScmCodeModelGenerator.Instance.OutputLibrary.TypeProviders); - - var contextDefinition = new ModelReaderWriterContextDefinition(); - var buildableAttributes = contextDefinition.Attributes - .Where(a => a.Type.IsFrameworkType && a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)) - .Select(a => a.Arguments.First().ToDisplayString()) - .ToList(); - - Assert.AreEqual(1, buildableAttributes.Count); - Assert.AreEqual("typeof(global::Sample.TestMrwSerialization)", buildableAttributes[0]); - Assert.IsFalse( - buildableAttributes.Contains("typeof(global::Sample.RemovedProviderWithFrameworkDependency)"), - "Removed providers should not get standalone context entries."); - } - finally - { - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - } - } - - [Test] - public async Task VisitorAttributesArePreservedAfterReferenceMapAnalysis() - { - var outputPath = Path.Combine( - TestContext.CurrentContext.WorkDirectory, - nameof(ModelReaderWriterContextDefinitionTests), - nameof(VisitorAttributesArePreservedAfterReferenceMapAnalysis)); - var outputLibrary = new TestOutputLibrary([new RemovedProviderWithFrameworkDependency()]); - var mockGenerator = MockHelpers.LoadMockGenerator( - createOutputLibrary: () => outputLibrary, - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", - outputPath: outputPath); - mockGenerator.Object.AddVisitor(new ContextAttributeVisitor()); - - await new CSharpGen().ExecuteAsync(); - - var context = outputLibrary.TypeProviders.OfType().Single(); - Assert.IsTrue(context.Attributes.Any(attribute => attribute.Type.Equals(typeof(ObsoleteAttribute)))); - var content = await File.ReadAllTextAsync(Path.Combine(outputPath, context.RelativeFilePath)); - StringAssert.Contains("[Obsolete]", content); - StringAssert.DoesNotContain(nameof(RemovedProviderWithFrameworkDependency), content); - } - - [Test] - public void RemovedFrameworkTypeIsNotMatchedToKeptProviderWithSameSimpleName() - { - var keptProvider = new ShadowedBuildableProvider("Sample"); - var removedProvider = new RemovedShadowedBuildableProvider(); - var outputLibrary = new TestOutputLibrary([keptProvider, removedProvider]); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => outputLibrary); - - try - { - CodeModelGenerator.Instance.AddTypeToKeep(keptProvider); - ProviderReferenceMapAnalyzer.Analyze(ScmCodeModelGenerator.Instance.OutputLibrary.TypeProviders); - - var contextDefinition = new ModelReaderWriterContextDefinition(); - var buildableAttributes = contextDefinition.Attributes - .Where(a => a.Type.IsFrameworkType && a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)) - .Select(a => a.Arguments.First().ToDisplayString()) - .ToList(); - - Assert.AreEqual(1, buildableAttributes.Count); - Assert.AreEqual("typeof(global::Sample.ShadowedModel)", buildableAttributes[0]); - Assert.IsFalse( - buildableAttributes.Contains("typeof(global::Sample.Agents.ShadowedModel)"), - "Removed source types should not be resolved through a kept provider with the same simple name."); - } - finally - { - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - } - } - - [Test] - public void ExternalModelProvidersDoNotContributeStandaloneBuildableAttributes() - { - MockHelpers.LoadMockGenerator( - inputModels: () => - [ - InputFactory.Model( - "File", - @namespace: "External.Library", - usage: InputModelTypeUsage.Json, - external: new InputExternalTypeMetadata("External.Library.File", package: null, minVersion: null)) - ]); - - var contextDefinition = new ModelReaderWriterContextDefinition(); - var buildableAttributes = contextDefinition.Attributes - .Where(a => a.Type.IsFrameworkType && a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)) - .Select(a => a.Arguments.First().ToDisplayString()) - .ToList(); - - Assert.IsEmpty(buildableAttributes); - } - [Test] public void ValidateModelReaderWriterBuildableAttributesIncludeNestedModels() { @@ -1153,63 +1045,7 @@ protected internal override PropertyProvider[] BuildProperties() protected override string BuildRelativeFilePath() { - return Path.Combine("src", "Generated", $"{Name}.cs"); - } - } - - private class RemovedProviderWithFrameworkDependency : TypeProvider - { - protected override string BuildName() => "RemovedProviderWithFrameworkDependency"; - - protected internal override CSharpType[] BuildImplements() - { - return [new CSharpType(typeof(IPersistableModel))]; - } - - protected internal override PropertyProvider[] BuildProperties() - { - return [new PropertyProvider(null, MethodSignatureModifiers.Public, new CSharpType(typeof(DependencyModel)), "p1", new AutoPropertyBody(false), this)]; - } - - protected override string BuildRelativeFilePath() - { - return Path.Combine("src", "Generated", $"{Name}.cs"); - } - } - - private class ShadowedBuildableProvider : TypeProvider - { - private readonly string _namespace; - - public ShadowedBuildableProvider(string ns) - { - _namespace = ns; - } - - protected override string BuildName() => "ShadowedModel"; - - protected override string BuildNamespace() => _namespace; - - protected internal override CSharpType[] BuildImplements() - { - return [new CSharpType(typeof(IPersistableModel))]; - } - - protected override string BuildRelativeFilePath() - { - return Path.Combine("src", "Generated", $"{Name}.cs"); - } - } - - private class RemovedShadowedBuildableProvider : ShadowedBuildableProvider - { - public RemovedShadowedBuildableProvider() : base("Sample.Agents") - { - } - - protected internal override PropertyProvider[] BuildProperties() - { - return [new PropertyProvider(null, MethodSignatureModifiers.Public, new CSharpType(typeof(Sample.Agents.ShadowedModel)), "p1", new AutoPropertyBody(false), this)]; + throw new NotImplementedException(); } } @@ -1499,19 +1335,6 @@ .. _typeProviders } } - private sealed class ContextAttributeVisitor : LibraryVisitor - { - protected override TypeProvider? VisitType(TypeProvider type) - { - if (type is ModelReaderWriterContextDefinition) - { - type.Update(attributes: [.. type.Attributes, new AttributeStatement(typeof(ObsoleteAttribute))]); - } - - return type; - } - } - // Test class for a framework type marked with [Obsolete] [Obsolete("This type is obsolete. Use NewFrameworkType instead.")] public class ObsoleteFrameworkType : IJsonModel, IPersistableModel @@ -1731,63 +1554,6 @@ public void ValidateFrameworkReturnTypesAreDiscoveredFromGenericResponseWrappers "FrameworkModelWithMRW should be discovered from generic response wrapper return type"); } - [Test] - public void ValidateFrameworkBodyDependencyTypesAreNotDiscovered() - { - var clientProvider = new TestClientProviderWithFrameworkBodyDependency(); - var outputLibrary = new TestOutputLibrary([clientProvider]); - var mockGenerator = MockHelpers.LoadMockGenerator( - createOutputLibrary: () => outputLibrary); - - var contextDefinition = new ModelReaderWriterContextDefinition(); - var attributes = contextDefinition.Attributes; - - Assert.IsNotNull(attributes); - var buildableAttributes = attributes.Where(a => a.Type.IsFrameworkType && - a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)).ToList(); - - Assert.IsFalse(buildableAttributes.Any(a => a.Arguments.First().ToDisplayString().Contains("ResponseError")), - "Framework types referenced only from provider bodies should not be added to the MRW context"); - } - - [Test] - public async Task CustomizedBuildableAttributesAreNotRegenerated() - { - var clientProvider = new TestClientProviderWithResponseErrorReturnType(); - var outputLibrary = new TestOutputLibrary([clientProvider]); - var mockGenerator = MockHelpers.LoadMockGenerator(createOutputLibrary: () => outputLibrary); - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - mockGenerator.SetupProperty(p => p.SourceInputModel, new SourceInputModel(compilation, null)); - - var contextDefinition = new ModelReaderWriterContextDefinition(); - var buildableAttributes = contextDefinition.Attributes - .Where(a => a.Type.IsFrameworkType && - a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)); - - Assert.IsFalse(buildableAttributes.Any(a => a.Arguments.First().ToDisplayString().Contains("ResponseError")), - "Buildable attributes supplied by a customized context should not be regenerated"); - } - - [Test] - public async Task CustomProjectionPropertiesDoNotAddBuildableTypes() - { - var model = InputFactory.Model("ModelWithProjectedProperty", properties: - [ - InputFactory.Property("Error", InputPrimitiveType.String) - ]); - await MockHelpers.LoadMockGeneratorAsync( - inputModels: () => [model], - compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); - - var contextDefinition = new ModelReaderWriterContextDefinition(); - var buildableAttributes = contextDefinition.Attributes - .Where(a => a.Type.IsFrameworkType && - a.Type.FrameworkType == typeof(ModelReaderWriterBuildableAttribute)); - - Assert.IsFalse(buildableAttributes.Any(a => a.Arguments.First().ToDisplayString().Contains("ResponseError")), - "Public projections over CodeGenMember backing properties are not part of wire serialization"); - } - [Test] public async Task ValidateCustomPropertiesOnModelsAreDiscovered() { @@ -1979,100 +1745,5 @@ protected internal override MethodProvider[] BuildMethods() ]; } } - - private class TestClientProviderWithFrameworkBodyDependency : TypeProvider - { - protected override string BuildName() => "TestClient"; - - protected override string BuildRelativeFilePath() => "TestClient.cs"; - - protected internal override IReadOnlyList BuildBodyDependencyTypes() - { - return [new CSharpType(typeof(Azure.ResponseError))]; - } - } - - private class TestClientProviderWithResponseErrorReturnType : TypeProvider - { - protected override string BuildName() => "TestClient"; - - protected override string BuildRelativeFilePath() => "TestClient.cs"; - - protected internal override MethodProvider[] BuildMethods() - { - var signature = new MethodSignature( - Name: "GetError", - Description: null, - Modifiers: MethodSignatureModifiers.Public, - ReturnType: new CSharpType(typeof(Azure.ResponseError)), - ReturnDescription: null, - Parameters: []); - - return [new MethodProvider(signature, Statements.MethodBodyStatement.Empty, this)]; - } - } - } - -} - -namespace Azure -{ - public class ResponseError : IJsonModel - { - ResponseError? IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - ResponseError? IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - } -} - -namespace Sample.Agents -{ - public class ShadowedModel : IJsonModel - { - ShadowedModel? IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - ShadowedModel? IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - throw new NotImplementedException(); - } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs deleted file mode 100644 index 9041098996b..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomProjectionPropertiesDoNotAddBuildableTypes/ModelWithProjectedProperty.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.TypeSpec.Generator.Customizations; - -namespace Sample.Models -{ - public partial class ModelWithProjectedProperty - { - [CodeGenMember("Error")] - internal string ErrorInternal { get; } - - public Azure.ResponseError Error => new(); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs deleted file mode 100644 index dd85bacb583..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/TestData/ModelReaderWriterContextDefinitionTests/CustomizedBuildableAttributesAreNotRegenerated/SampleContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.ClientModel.Primitives; - -namespace Sample -{ - [ModelReaderWriterBuildable(typeof(Azure.ResponseError))] - public partial class SampleContext - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs index 503ed1ad68f..fcc90582416 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/MrwSerializationTypeDefinitions/SystemObjectModelSerializationTests.cs @@ -121,6 +121,31 @@ public void JsonModelWriteCore_IsOverride_WhenBaseIsRegularModel() "JsonModelWriteCore should be 'override' with regular base too"); } + [Test] + public void JsonModelWriteCore_IsOverride_WhenBaseProviderIsResolvedAfterSerialization() + { + var baseInputModel = InputFactory.Model("Resource"); + var derivedInputModel = InputFactory.Model("TrackedResource", properties: [InputFactory.Property("Location", InputPrimitiveType.String)]); + MockHelpers.LoadMockGenerator(inputModels: () => [baseInputModel, derivedInputModel]); + + var derived = new DelayedBaseModelProvider(derivedInputModel); + var serialization = new MrwSerializationTypeDefinition(derivedInputModel, derived); + + // The serialization provider can be constructed before later visitors/customization + // resolution make the base model provider available. + derived.BaseModel = new SystemObjectModelProvider(new CSharpType(typeof(object)), baseInputModel); + + var method = serialization.BuildJsonModelWriteCoreMethod(); + + Assert.AreEqual(derived.BaseModel.Type, derived.Type.BaseType, + "The generated model type should inherit the base resolved after serialization construction."); + Assert.AreEqual(derived.BaseModel.Type, serialization.Type.BaseType, + "The serialization type should inherit the same resolved base."); + Assert.IsTrue(method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Override), + "JsonModelWriteCore should evaluate BaseModelProvider when the method is built, not when serialization is constructed"); + Assert.IsFalse(method.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Virtual)); + } + // ------------------------------------------------------------------- // PersistableModelWriteCore: 'virtual' with system base, 'override' with regular // (the framework base already implements this; derived model re-introduces it) @@ -328,5 +353,14 @@ FakeMrwBase IPersistableModel.Create(BinaryData data, ModelReaderWr string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } + + private class DelayedBaseModelProvider(InputModelType inputModel) : ModelProvider(inputModel) + { + public ModelProvider? BaseModel { get; set; } + + protected override ModelProvider? BuildBaseModelProvider() => BaseModel; + + protected override CSharpType? BuildBaseType() => BaseModel?.Type; + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs index 97472c67514..e8bcb2fa0fb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.TypeSpec.Generator.ClientModel.Providers; @@ -104,21 +103,6 @@ public void ValidateProperties() Assert.IsFalse(propertyHash.ContainsKey("PipelineMessageClassifier204")); } - [Test] - public void BodyDependencyTypesDoNotRootRequestBodyModels() - { - var requestBody = InputFactory.Model("CreateWidgetRequest"); - var operation = InputFactory.Operation( - "CreateWidget", - parameters: [InputFactory.BodyParameter("body", requestBody, isRequired: true)]); - var inputClient = InputFactory.Client( - "TestClient", - methods: [InputFactory.BasicServiceMethod("CreateWidget", operation)]); - var restClient = new ClientProvider(inputClient).RestClient; - - Assert.IsFalse(restClient.BodyDependencyTypes.Any(t => t.Name == requestBody.Name)); - } - [Test] public void Validate3xxRedirectStatusCode() { @@ -288,57 +272,6 @@ public void TestGetMethodParameters_ContentTypeAfterBody(bool isRequired, bool i Assert.AreEqual("skillId", methodParameters[0].Name); Assert.AreEqual("content", methodParameters[1].Name); Assert.AreEqual("contentType", methodParameters[2].Name); - Assert.AreEqual(typeof(string), methodParameters[2].Type.FrameworkType); - Assert.AreEqual(!isRequired, methodParameters[2].Type.IsNullable); - Assert.AreEqual( - isRequired ? ParameterValidationType.AssertNotNullOrEmpty : ParameterValidationType.None, - methodParameters[2].Validation); - } - - [Test] - public void ProtocolContentTypeParameterUsesTypeFactory() - { - var contentTypeEnum = InputFactory.StringEnum( - "ContentTypeEnum", - [("application/json", "application/json")], - isExtensible: true); - var contentTypeParameter = InputFactory.MethodParameter( - "contentType", - InputFactory.Union([contentTypeEnum], "contentType"), - isRequired: true, - location: InputRequestLocation.Header, - serializedName: "Content-Type"); - var operation = InputFactory.Operation( - "Upload", - parameters: [contentTypeParameter]); - var serviceMethod = InputFactory.BasicServiceMethod( - "Upload", - operation, - parameters: [contentTypeParameter]); - var client = InputFactory.Client("TestClient", methods: [serviceMethod]); - var factoryCalled = false; - - MockHelpers.LoadMockGenerator( - clients: () => [client], - createParameterCore: parameter => - { - factoryCalled = true; - return new ParameterProvider(parameter); - }); - - var clientProvider = ScmCodeModelGenerator.Instance.TypeFactory.CreateClient(client); - Assert.IsNotNull(clientProvider); - factoryCalled = false; - - var methodParameters = RestClientProvider.GetMethodParameters( - serviceMethod, - ScmMethodKind.Protocol, - clientProvider!); - - Assert.IsTrue(factoryCalled); - Assert.AreEqual(1, methodParameters.Count); - Assert.AreEqual(typeof(string), methodParameters[0].Type.FrameworkType); - Assert.AreEqual(ParameterValidationType.AssertNotNullOrEmpty, methodParameters[0].Validation); } [Test] @@ -429,135 +362,6 @@ public async Task ContentTypeAfterBodyInLastContractView() Assert.AreEqual("contentType", methodParameters[2].Name); // contentType after body } - [Test] - public async Task ContentTypeOrderPreservedFromLastContractViewWithNamedBody() - { - var contentTypeEnum = InputFactory.StringEnum("ContentTypeEnum", - [("application/json", "application/json"), ("application/xml", "application/xml")], - isExtensible: true); - var contentTypeHeader = InputFactory.HeaderParameter( - "contentType", - contentTypeEnum, - isRequired: true, - isContentType: true, - serializedName: "Content-Type"); - var bodyParam = InputFactory.BodyParameter("schemaContent", InputPrimitiveType.String, isRequired: true); - var groupNameParam = InputFactory.PathParameter("groupName", InputPrimitiveType.String, isRequired: true); - var pathParam = InputFactory.PathParameter("schemaName", InputPrimitiveType.String, isRequired: true); - var methodGroupNameParam = InputFactory.MethodParameter( - "groupName", - InputPrimitiveType.String, - isRequired: true, - location: InputRequestLocation.Path); - var methodSchemaNameParam = InputFactory.MethodParameter( - "schemaName", - InputPrimitiveType.String, - isRequired: true, - location: InputRequestLocation.Path); - var methodContentTypeParam = InputFactory.MethodParameter( - "contentType", - contentTypeEnum, - isRequired: true, - serializedName: "Content-Type", - location: InputRequestLocation.Header); - var methodBodyParam = InputFactory.MethodParameter( - "schemaContent", - InputPrimitiveType.String, - isRequired: true, - location: InputRequestLocation.Body); - - var operation = InputFactory.Operation( - "RegisterSchema", - parameters: [groupNameParam, pathParam, contentTypeHeader, bodyParam]); - - var serviceMethod = InputFactory.BasicServiceMethod( - "RegisterSchema", - operation, - parameters: [methodGroupNameParam, methodSchemaNameParam, methodContentTypeParam, methodBodyParam]); - - var client = InputFactory.Client("TestClient", methods: [serviceMethod]); - - var generator = await MockHelpers.LoadMockGeneratorAsync( - clients: () => [client], - lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); - - var clientProvider = generator.Object.OutputLibrary.TypeProviders.OfType().FirstOrDefault(); - Assert.IsNotNull(clientProvider); - Assert.IsNotNull(clientProvider!.LastContractView); - - var methodParameters = RestClientProvider.GetMethodParameters(serviceMethod, ScmMethodKind.Protocol, clientProvider!); - - Assert.AreEqual(4, methodParameters.Count); - Assert.AreEqual("groupName", methodParameters[0].Name); - Assert.AreEqual("schemaName", methodParameters[1].Name); - Assert.AreEqual("contentType", methodParameters[2].Name); - Assert.AreEqual("content", methodParameters[3].Name); - - var convenienceMethodParameters = RestClientProvider.GetMethodParameters(serviceMethod, ScmMethodKind.Convenience, clientProvider!); - - Assert.AreEqual(4, convenienceMethodParameters.Count); - Assert.AreEqual("groupName", convenienceMethodParameters[0].Name); - Assert.AreEqual("schemaName", convenienceMethodParameters[1].Name); - Assert.AreEqual("contentType", convenienceMethodParameters[2].Name); - Assert.AreEqual("schemaContent", convenienceMethodParameters[3].Name); - } - - [Test] - public void ContentTypeOrderUsesBodyMetadataWhenLastContractHasMultipleBinaryDataParameters() - { - var checksumParam = InputFactory.MethodParameter( - "checksum", - InputPrimitiveType.Base64, - isRequired: true, - location: InputRequestLocation.Query); - var contentTypeParam = InputFactory.MethodParameter( - "contentType", - InputPrimitiveType.String, - isRequired: true, - serializedName: "Content-Type", - location: InputRequestLocation.Header); - var payloadParam = InputFactory.MethodParameter( - "payload", - InputPrimitiveType.Base64, - isRequired: true, - location: InputRequestLocation.Body); - var operation = InputFactory.Operation( - "Upload", - parameters: [ - InputFactory.QueryParameter("checksum", InputPrimitiveType.Base64, isRequired: true), - InputFactory.HeaderParameter("Content-Type", InputPrimitiveType.String, isRequired: true, isContentType: true), - InputFactory.BodyParameter("payload", InputPrimitiveType.Base64, isRequired: true) - ]); - var serviceMethod = InputFactory.BasicServiceMethod( - "Upload", - operation, - parameters: [checksumParam, contentTypeParam, payloadParam]); - var lastContractView = new LastContractTestTypeProvider(); - lastContractView.Update(methods: - [ - new MethodProvider( - new MethodSignature( - "Upload", - null, - MethodSignatureModifiers.Public, - null, - null, - [ - new ParameterProvider("checksum", $"", typeof(BinaryData)), - new ParameterProvider("contentType", $"", typeof(string)), - new ParameterProvider("payload", $"", typeof(BinaryData)) - ]), - MethodBodyStatement.Empty, - lastContractView) - ]); - var provider = new LastContractTestTypeProvider(lastContractView); - var method = typeof(RestClientProvider).GetMethod("HasContentTypeBeforeBodyInLastContract", BindingFlags.NonPublic | BindingFlags.Static)!; - - var shouldPreserveOrder = (bool)method.Invoke(null, [serviceMethod, provider])!; - - Assert.IsTrue(shouldPreserveOrder); - } - [Test] public async Task ParameterNamePreservedFromLastContractView() { @@ -934,6 +738,38 @@ public void ValidateGetResponseClassifiersThrowsWhenNoSuccess() Assert.Fail("Expected Exception to be thrown."); } + [Test] + public void TestBuildCreateRequestMethodWithExplodedModelQueryParameter() + { + var filterModel = InputFactory.Model( + "filterOptions", + properties: + [ + InputFactory.Property("field", InputPrimitiveType.String, isRequired: true), + InputFactory.Property("value", InputPrimitiveType.String, isRequired: true), + ]); + var operation = InputFactory.Operation( + "sampleOp", + parameters: [InputFactory.QueryParameter("filter", filterModel, isRequired: true, explode: true)]); + var client = InputFactory.Client( + "TestClient", + methods: [InputFactory.BasicServiceMethod("Test", operation)]); + var clientProvider = new ClientProvider(client); + var restClientProvider = new MockClientProvider(client, clientProvider); + + var method = restClientProvider.Methods.FirstOrDefault(m => m.Signature.Name == "CreateSampleOpRequest"); + Assert.IsNotNull(method); + var body = method!.BodyStatements!.ToDisplayString(); + + // A model-typed query parameter with `explode` is expanded into one query entry per + // property (RFC 6570 form explode) using each property's wire name, instead of serializing + // the whole object via ConvertToString (which produced the type name). + Assert.IsTrue(body.Contains("uri.AppendQuery(\"field\", filter.Field, true);"), body); + Assert.IsTrue(body.Contains("uri.AppendQuery(\"value\", filter.Value, true);"), body); + Assert.IsFalse(body.Contains("AppendQuery(\"filter\""), body); + Assert.IsFalse(body.Contains("ConvertToString(filter)"), body); + } + [Test] public void TestBuildCreateRequestMethodWithQueryParameters() { @@ -1905,29 +1741,6 @@ protected override ScmMethodProvider[] BuildMethods() protected override TypeProvider[] BuildNestedTypes() => []; } - private class LastContractTestTypeProvider : TypeProvider - { - private readonly MethodProvider[] _methods; - private readonly TypeProvider? _lastContractView; - - public LastContractTestTypeProvider(params MethodProvider[] methods) - { - _methods = methods; - } - - public LastContractTestTypeProvider(TypeProvider lastContractView) - { - _methods = []; - _lastContractView = lastContractView; - } - - protected override string BuildName() => "TestClient"; - protected override string BuildNamespace() => "Sample"; - protected override string BuildRelativeFilePath() => "TestClient.cs"; - protected internal override MethodProvider[] BuildMethods() => _methods; - private protected override TypeProvider? BuildLastContractView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _lastContractView; - } - private static IEnumerable ValidateApiVersionPathParameterTestCases() { InputMethodParameter endpointParameter = InputFactory.MethodParameter( diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs deleted file mode 100644 index e7005ee3202..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ContentTypeOrderPreservedFromLastContractViewWithNamedBody/TestClient.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable disable - -using System; -using System.ClientModel; -using System.Threading; -using System.Threading.Tasks; - -namespace Sample -{ - public partial class TestClient - { - // This represents a previous contract where contentType appears before a named body parameter. - internal virtual Task RegisterSchemaAsync(string groupName, string schemaName, SchemaContentTypeValues contentType, BinaryData schemaContent, CancellationToken cancellationToken = default) { return null; } - internal virtual ClientResult RegisterSchema(string groupName, string schemaName, SchemaContentTypeValues contentType, BinaryData schemaContent, CancellationToken cancellationToken = default) { return null; } - } - - internal readonly partial struct SchemaContentTypeValues - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs deleted file mode 100644 index b21ea1df8bf..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/Generated/TestClientOptions.cs +++ /dev/null @@ -1,16 +0,0 @@ -#nullable disable - -using System.ClientModel.Primitives; - -namespace SampleNamespace -{ - public partial class TestClientOptions : ClientPipelineOptions - { - public enum ServiceVersion - { - V2023_10_01_Preview_1 = 0, - V2023_11_01 = 1, - V2024_01_01 = 2 - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs deleted file mode 100644 index 5deb0d63350..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/CustomizedPublicConstructorKeepsNestedServiceVersionPublic/TestClientOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable disable - -using System.ClientModel.Primitives; -using Microsoft.TypeSpec.Generator.Customizations; - -namespace SampleNamespace -{ - [CodeGenType("RawClientOptions")] - public partial class TestClientOptions : ClientPipelineOptions - { - public TestClientOptions(ServiceVersion version) - { - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs deleted file mode 100644 index a34d00e3c6e..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientA.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample -{ - internal partial class ClientA - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs deleted file mode 100644 index 2bfb3b16ae8..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsAreInternalWhenAllClientsAreInternal/ClientB.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample -{ - internal partial class ClientB - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs deleted file mode 100644 index 3eb98f9a9e3..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/TestData/ClientOptionsProviderTests/SharedSingletonOptionsArePublicWhenAnyClientIsPublic/InternalClient.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample -{ - internal partial class InternalClient - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs deleted file mode 100644 index b209cd1a18c..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/ReferenceMap/ClientBodyDependencyReferenceMapTests.cs +++ /dev/null @@ -1,948 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.TypeSpec.Generator.Input; -using Microsoft.TypeSpec.Generator.Primitives; -using Microsoft.TypeSpec.Generator.Tests.Common; -using NUnit.Framework; - -namespace Microsoft.TypeSpec.Generator.ClientModel.Tests.ReferenceMap -{ - public class ClientBodyDependencyReferenceMapTests - { - [Test] - public async Task PublicOperationBodyParameterModelIsRetained() - { - var requestModel = InputFactory.Model("RequestBody"); - var parameter = InputFactory.BodyParameter("body", requestModel, isRequired: true); - var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST"); - var method = InputFactory.BasicServiceMethod("Create", operation); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [requestModel], - clients: [client], - customFiles: [], - expectedFiles: [], - publicModelNames: ["RequestBody"]); - } - - [Test] - public async Task PublicProtocolOnlyOperationBodyParameterModelIsRetained() - { - var requestModel = InputFactory.Model("RequestBody"); - var parameter = InputFactory.BodyParameter("body", requestModel, isRequired: true); - var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST", generateConvenienceMethod: false); - var method = InputFactory.BasicServiceMethod("Create", operation); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [requestModel], - clients: [client], - customFiles: [], - expectedFiles: [], - publicModelNames: ["RequestBody"]); - } - - [Test] - public async Task OperationResponseBodyModelRemainsPublicAsRootOutputModel() - { - var responseModel = InputFactory.Model("ResponseBody"); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); - var method = InputFactory.BasicServiceMethod( - "Get", - operation, - response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertPublicModels([responseModel], [client], ["ResponseBody"]); - } - - [Test] - public async Task InternalModelReferencedByPublicModelPropertyIsPublicized() - { - var dependencyModel = InputFactory.Model("DependencyModel", access: "internal"); - var responseModel = InputFactory.Model( - "ResponseBody", - properties: [InputFactory.Property("Dependency", dependencyModel)]); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); - var method = InputFactory.BasicServiceMethod( - "Get", - operation, - response: InputFactory.ServiceMethodResponse(responseModel, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertPublicModels([responseModel, dependencyModel], [client], ["ResponseBody", "DependencyModel"]); - } - - [Test] - public async Task InternalModelReferencedByPublicNonRootCollectionPropertyIsPublicized() - { - var dependencyModel = InputFactory.Model("DependencyModel", access: "internal"); - var responseModel = InputFactory.Model( - "ResponseBody", - properties: [InputFactory.Property("Dependencies", InputFactory.Array(dependencyModel))]); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); - var method = InputFactory.BasicServiceMethod( - "Get", - operation, - response: InputFactory.ServiceMethodResponse(responseModel, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [responseModel, dependencyModel], - clients: [client], - customFiles: [ - (Path.Combine("src", "Generated", "SampleModelFactory.cs"), """ - using System.Collections.Generic; - using Sample.Models; - - namespace Sample; - - public static partial class SampleModelFactory - { - public static ResponseBody ResponseBody(IEnumerable dependencies = default) => null; - } - """) - ], - expectedFiles: [], - publicModelNames: ["ResponseBody", "DependencyModel"], - configureGenerator: () => - { - var responseProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "ResponseBody"); - var dependencyProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "DependencyModel"); - CodeModelGenerator.Instance.AddTypeToKeep(responseProvider, isRoot: false); - CodeModelGenerator.Instance.AddTypeToKeep(dependencyProvider, isRoot: false); - }); - } - - [Test] - public async Task PublicInputRootsOverrideCustomInternalBoundary() - { - var customInternalModel = InputFactory.Model("CustomInternalModel"); - var publicWrapper = InputFactory.Model( - "PublicWrapper", - properties: [InputFactory.Property("CustomInternal", customInternalModel)]); - - var outputPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - Directory.CreateDirectory(outputPath); - try - { - var customPath = Path.Combine(outputPath, "src", "Custom", "CustomInternalModel.cs"); - Directory.CreateDirectory(Path.GetDirectoryName(customPath)!); - File.WriteAllText(customPath, """ - using Microsoft.TypeSpec.Generator.Customizations; - - namespace Sample.Models; - - [CodeGenType("CustomInternalModel")] - internal partial class CustomInternalModel - { - } - """); - var modelFactoryPath = Path.Combine(outputPath, "src", "Generated", "SampleModelFactory.cs"); - Directory.CreateDirectory(Path.GetDirectoryName(modelFactoryPath)!); - File.WriteAllText(modelFactoryPath, """ - using Sample.Models; - - namespace Sample; - - public static partial class SampleModelFactory - { - public static PublicWrapper PublicWrapper(CustomInternalModel customInternal = default) => null; - } - """); - - await MockHelpers.LoadMockGeneratorAsync( - inputModels: () => [publicWrapper, customInternalModel], - configuration: """{ "package-name": "Sample", "disable-xml-docs": true }""", - outputPath: outputPath); - - var publicWrapperProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "PublicWrapper"); - var customInternalProvider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "CustomInternalModel"); - CodeModelGenerator.Instance.AddTypeToKeep(publicWrapperProvider, isRoot: false); - CodeModelGenerator.Instance.AddTypeToKeep(customInternalProvider, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(CodeModelGenerator.Instance.OutputLibrary.TypeProviders); - - Assert.IsTrue(publicWrapperProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public), "PublicWrapper should remain public because it is an explicit input root."); - Assert.IsTrue(customInternalProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public), "Public input roots should preserve their declared accessibility."); - } - finally - { - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - if (Directory.Exists(outputPath)) - { - Directory.Delete(outputPath, recursive: true); - } - } - } - - [Test] - public async Task PublicOperationResponseBodyModelIsRetained() - { - var metadataOnlyModel = InputFactory.Model("MetadataOnlyResponse"); - var operation = InputFactory.Operation( - "Get", - responses: [ - InputFactory.OperationResponse(bodytype: InputPrimitiveType.String), - new InputOperationResponse([202], metadataOnlyModel, [], isErrorResponse: false, ["application/json"]) - ]); - var method = InputFactory.BasicServiceMethod( - "Get", - operation, - response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [metadataOnlyModel], - clients: [client], - customFiles: [], - expectedFiles: [], - publicModelNames: ["MetadataOnlyResponse"]); - } - - [Test] - public async Task EmptyCustomPartialModelIsKept() - { - var customizedModel = InputFactory.Model("CustomizedModel"); - - await GenerateAndAssertFiles( - enums: [], - models: [customizedModel], - clients: [], - customFiles: [( - Path.Combine("src", "CustomizedModel.cs"), - """ - namespace Sample.Models - { - public partial class CustomizedModel - { - } - } - """)], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "CustomizedModel.cs"), - Path.Combine("src", "Generated", "Models", "CustomizedModel.Serialization.cs") - ]); - } - - [Test] - public async Task InternalAdditionalRootModelIsRetainedAsInternal() - { - var metadataOnlyModel = InputFactory.Model("MetadataOnlyResponse", access: "internal"); - var operation = InputFactory.Operation( - "Get", - responses: [ - InputFactory.OperationResponse(bodytype: InputPrimitiveType.String), - new InputOperationResponse([202], metadataOnlyModel, [], isErrorResponse: false, ["application/json"]) - ]); - var method = InputFactory.BasicServiceMethod( - "Get", - operation, - response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [metadataOnlyModel], - clients: [client], - customFiles: [], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "MetadataOnlyResponse.cs"), - Path.Combine("src", "Generated", "Models", "MetadataOnlyResponse.Serialization.cs") - ], - internalModelNames: ["MetadataOnlyResponse"], - configureGenerator: () => - { - var provider = CodeModelGenerator.Instance.OutputLibrary.TypeProviders.Single(provider => provider.Name == "MetadataOnlyResponse"); - CodeModelGenerator.Instance.AddTypeToKeep(provider); - }); - } - - [Test] - public async Task PublicAdditionalRootEnumIsRetained() - { - var metadataOnlyEnum = InputFactory.StringEnum( - "MetadataOnlyResponseKind", - [("Accepted", "accepted")]); - var operation = InputFactory.Operation( - "Get", - responses: [ - InputFactory.OperationResponse(bodytype: InputPrimitiveType.String), - new InputOperationResponse([202], metadataOnlyEnum, [], isErrorResponse: false, ["application/json"]) - ]); - var method = InputFactory.BasicServiceMethod( - "Get", - operation, - response: InputFactory.ServiceMethodResponse(InputPrimitiveType.String, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [metadataOnlyEnum], - models: [], - clients: [client], - customFiles: [], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "MetadataOnlyResponseKind.cs"), - Path.Combine("src", "Generated", "Models", "MetadataOnlyResponseKind.Serialization.cs") - ]); - } - - [Test] - public async Task PublicContentTypeHeaderEnumIsRetained() - { - var contentTypeEnum = InputFactory.StringEnum( - "UpdateSnapshotRequestContentType", - [ - ("ApplicationMergePatchJson", "application/merge-patch+json"), - ("ApplicationJson", "application/json") - ]); - var contentTypeParameter = InputFactory.MethodParameter( - "contentType", - InputFactory.Union([contentTypeEnum], "contentType"), - isRequired: true, - location: InputRequestLocation.Header, - serializedName: "Content-Type"); - var operation = InputFactory.Operation( - "UpdateSnapshot", - parameters: [contentTypeParameter], - httpMethod: "PATCH", - generateConvenienceMethod: false); - var method = InputFactory.BasicServiceMethod( - "UpdateSnapshot", - operation, - parameters: [ - InputFactory.MethodParameter("name", InputPrimitiveType.String, isRequired: true, location: InputRequestLocation.Path), - contentTypeParameter, - InputFactory.MethodParameter("content", InputPrimitiveType.Base64, isRequired: true) - ]); - var client = InputFactory.Client("ConfigurationClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [contentTypeEnum], - models: [], - clients: [client], - customFiles: [], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "UpdateSnapshotRequestContentType.cs"), - Path.Combine("src", "Generated", "Models", "UpdateSnapshotRequestContentType.Serialization.cs") - ], - configureGenerator: () => - CodeModelGenerator.Instance.TypeFactory.CreateCSharpType(InputFactory.Union([contentTypeEnum], "contentType"))); - } - - [Test] - public async Task PublicEnumIsRetainedWhenNotOtherwiseReferenced() - { - var metadataOnlyEnum = InputFactory.StringEnum( - "MetadataOnlyKind", - [("One", "one")]); - - await GenerateAndAssertFiles( - enums: [metadataOnlyEnum], - models: [], - clients: [], - customFiles: [], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "MetadataOnlyKind.cs"), - Path.Combine("src", "Generated", "Models", "MetadataOnlyKind.Serialization.cs") - ]); - } - - [Test] - public async Task ContentTypeHeaderEnumReferencedByCustomSuppressionIsKept() - { - var contentTypeEnum = InputFactory.StringEnum( - "PutKeyValueRequestContentType", - [("ApplicationJson", "application/json")], - isExtensible: true); - var contentTypeParameter = InputFactory.HeaderParameter( - "contentType", - InputFactory.Union([contentTypeEnum], "contentType"), - isRequired: true, - isContentType: true, - serializedName: "Content-Type"); - var operation = InputFactory.Operation( - "SetConfigurationSettingInternal", - parameters: [contentTypeParameter], - httpMethod: "PUT"); - var method = InputFactory.BasicServiceMethod("SetConfigurationSettingInternal", operation); - var client = InputFactory.Client("ConfigurationClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [contentTypeEnum], - models: [], - clients: [client], - customFiles: [ - (Path.Combine("src", "PutKeyValueRequestContentType.cs"), """ - namespace Sample.Models; - - internal readonly partial struct PutKeyValueRequestContentType - { - public static PutKeyValueRequestContentType ApplicationJson { get; } = new PutKeyValueRequestContentType("application/json"); - } - """) - ], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "PutKeyValueRequestContentType.cs") - ]); - } - - [Test] - public async Task ContentTypeHeaderEnumReferencedOnlyByCustomSuppressionAttributeIsKept() - { - var contentTypeEnum = InputFactory.StringEnum( - "CreateSnapshotRequestContentType", - [("ApplicationJson", "application/json")], - isExtensible: true); - var contentTypeParameter = InputFactory.MethodParameter( - "contentType", - InputFactory.Union([contentTypeEnum], "contentType"), - isRequired: true, - location: InputRequestLocation.Header, - serializedName: "Content-Type"); - var operation = InputFactory.Operation( - "CreateSnapshot", - parameters: [contentTypeParameter], - httpMethod: "PUT", - generateConvenienceMethod: false); - var method = InputFactory.BasicServiceMethod( - "CreateSnapshot", - operation, - parameters: [ - InputFactory.MethodParameter("name", InputPrimitiveType.String, isRequired: true, location: InputRequestLocation.Path), - contentTypeParameter, - InputFactory.MethodParameter("content", InputPrimitiveType.Base64, isRequired: true) - ]); - var client = InputFactory.Client("ConfigurationClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [contentTypeEnum], - models: [], - clients: [client], - customFiles: [ - (Path.Combine("src", "ConfigurationClient.cs"), """ - namespace Sample; - - [Microsoft.TypeSpec.Generator.Customizations.CodeGenType("ConfigurationClient")] - [Microsoft.TypeSpec.Generator.Customizations.CodeGenSuppress("CreateSnapshot", typeof(string), typeof(CreateSnapshotRequestContentType))] - public partial class ConfigurationClient - { - } - """) - ], - expectedFiles: [ - Path.Combine("src", "Generated", "Models", "CreateSnapshotRequestContentType.cs") - ]); - } - - [Test] - public async Task PublicNestedBodyModelGraphRemainsPublic() - { - var nestedModel = InputFactory.Model("NestedToolParameter"); - var toolModel = InputFactory.Model( - "ToolConfig", - properties: [InputFactory.Property("Parameter", nestedModel)]); - var parameter = InputFactory.BodyParameter("tool", toolModel, isRequired: true); - var operation = InputFactory.Operation("Configure", parameters: [parameter], httpMethod: "POST"); - var method = InputFactory.BasicServiceMethod("Configure", operation); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [toolModel, nestedModel], - clients: [client], - customFiles: [], - expectedFiles: [], - publicModelNames: ["ToolConfig", "NestedToolParameter"]); - } - - [Test] - public async Task PublicNonDiscriminatorDerivedBodyModelRemainsPublic() - { - var baseTool = InputFactory.Model("BaseTool"); - var concreteTool = InputFactory.Model( - "ConcreteTool", - properties: [InputFactory.Property("Name", InputPrimitiveType.String)], - baseModel: baseTool); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: baseTool)]); - var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(baseTool, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertMixedModels( - [baseTool, concreteTool], - [client], - publicModelNames: ["BaseTool", "ConcreteTool"], - internalModelNames: []); - } - - [Test] - public async Task PublicModelSignatureDependencyIsPromotedToPublic() - { - var internalDependency = InputFactory.Model("InternalDependency", access: "internal"); - var responseModel = InputFactory.Model( - "ResponseBody", - properties: [InputFactory.Property("Dependency", internalDependency)]); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); - var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(responseModel, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertPublicModels([responseModel, internalDependency], [client], ["ResponseBody", "InternalDependency"]); - } - - [Test] - public async Task AzureClientPublicMethodSignatureReferencesStayPublic() - { - var signatureModel = InputFactory.Model("SignatureModel", @namespace: "Azure.Sample.Models"); - var methodParameter = InputFactory.MethodParameter("signature", signatureModel, isRequired: true); - var operation = InputFactory.Operation( - "Create", - parameters: [InputFactory.BodyParameter("signature", signatureModel, isRequired: true)], - httpMethod: "POST"); - var method = InputFactory.BasicServiceMethod("Create", operation, parameters: [methodParameter]); - var client = InputFactory.Client("SampleClient", clientNamespace: "Azure.Sample", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [signatureModel], - clients: [client], - customFiles: [], - expectedFiles: [], - publicModelNames: ["SignatureModel"], - packageName: "Azure.Sample"); - } - - [Test] - public async Task BasePreservedDerivedModelTraversesTransitiveDependencies() - { - var transitiveDependency = InputFactory.Model("TransitiveDependency"); - var dependency = InputFactory.Model( - "DerivedDependency", - properties: [InputFactory.Property("Transitive", transitiveDependency)]); - var baseModel = InputFactory.Model("BaseResult"); - var derivedModel = InputFactory.Model( - "DerivedResult", - properties: [InputFactory.Property("Dependency", dependency)], - baseModel: baseModel); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: baseModel)]); - var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(baseModel, [])); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [baseModel, derivedModel, dependency, transitiveDependency], - clients: [client], - customFiles: [], - expectedFiles: [], - publicModelNames: ["BaseResult", "DerivedResult", "DerivedDependency", "TransitiveDependency"]); - } - - [Test] - public async Task PublicCustomCodeArraySignatureReferencesStayPublic() - { - var generatedModel = InputFactory.Model("GeneratedModel"); - - await GenerateAndAssertFiles( - enums: [], - models: [generatedModel], - clients: [], - customFiles: [ - (Path.Combine("src", "PublicCustomApi.cs"), """ - using Sample.Models; - - namespace Sample; - - public partial class PublicCustomApi - { - public GeneratedModel[] Items { get; } = System.Array.Empty(); - } - """) - ], - expectedFiles: [], - publicModelNames: ["GeneratedModel"]); - } - - [Test] - public async Task PublicCustomCodeTypeConstraintsStayPublic() - { - var generatedModel = InputFactory.Model("GeneratedModel", access: "internal"); - - await GenerateAndAssertFiles( - enums: [], - models: [generatedModel], - clients: [], - customFiles: [ - (Path.Combine("src", "PublicCustomApi.cs"), """ - using Sample.Models; - - namespace Sample; - - public partial class PublicCustomApi where T : GeneratedModel - { - } - """) - ], - expectedFiles: [], - publicModelNames: ["GeneratedModel"]); - } - - [Test] - public async Task GeneratedRequestHeaderSetDelimitedReferenceKeepsExtensions() - { - var header = InputFactory.HeaderParameter("x-ms-custom", InputFactory.Array(InputPrimitiveType.String), isRequired: true); - var operation = InputFactory.Operation("Create", parameters: [header]); - var method = InputFactory.BasicServiceMethod("Create", operation); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [], - clients: [client], - customFiles: [], - expectedFiles: [Path.Combine("src", "Generated", "Internal", "PipelineRequestHeadersExtensions.cs")]); - } - - [Test] - public async Task GeneratedPrefixedDictionaryHeaderKeepsExtensions() - { - var header = InputFactory.HeaderParameter( - "x-ms-meta", - InputFactory.Dictionary(InputPrimitiveType.String), - isRequired: true, - collectionHeaderPrefix: "x-ms-meta-"); - var operation = InputFactory.Operation("Create", parameters: [header]); - var method = InputFactory.BasicServiceMethod("Create", operation); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [], - clients: [client], - customFiles: [], - expectedFiles: [Path.Combine("src", "Generated", "Internal", "PipelineRequestHeadersExtensions.cs")]); - } - - [Test] - public async Task BinaryDataBodyParameterDoesNotKeepBinaryContentHelpers() - { - var parameter = InputFactory.BodyParameter( - "content", - InputPrimitiveType.Base64, - isRequired: true, - contentTypes: ["application/octet-stream"], - defaultContentType: "application/octet-stream"); - var operation = InputFactory.Operation("Upload", parameters: [parameter], httpMethod: "POST"); - var method = InputFactory.BasicServiceMethod( - "Upload", - operation, - parameters: [InputFactory.MethodParameter("content", InputPrimitiveType.Base64, isRequired: true)]); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [], - clients: [client], - customFiles: [], - expectedFiles: [], - unexpectedFiles: [ - Path.Combine("src", "Generated", "Internal", "BinaryContentHelper.cs"), - Path.Combine("src", "Generated", "Internal", "Utf8JsonBinaryContent.cs") - ]); - } - - [Test] - public async Task CollectionBodyParameterKeepsBinaryContentHelpers() - { - var parameter = InputFactory.BodyParameter("items", InputFactory.Array(InputPrimitiveType.String), isRequired: true); - var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST"); - var method = InputFactory.BasicServiceMethod( - "Create", - operation, - parameters: [InputFactory.MethodParameter("items", InputFactory.Array(InputPrimitiveType.String), isRequired: true)]); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [], - clients: [client], - customFiles: [], - expectedFiles: [ - Path.Combine("src", "Generated", "Internal", "BinaryContentHelper.cs"), - Path.Combine("src", "Generated", "Internal", "Utf8JsonBinaryContent.cs") - ]); - } - - [Test] - public async Task CustomOnlyRequestHeaderSetDelimitedReferenceKeepsExtensions() - { - await GenerateAndAssertFiles( - enums: [], - models: [], - clients: [], - customFiles: [ - (Path.Combine("src", "CustomHeaders.cs"), """ - using System.ClientModel.Primitives; - - namespace Sample; - - public static class CustomHeaders - { - public static void Add(PipelineRequestHeaders headers, string[] values) - => headers.SetDelimited("x-ms-custom", values, ","); - } - """) - ], - expectedFiles: [Path.Combine("src", "Generated", "Internal", "PipelineRequestHeadersExtensions.cs")]); - } - - [Test] - public async Task CustomizedEnumSerializationProviderIsKeptWhenModelSerializationUsesEnum() - { - var statusEnum = InputFactory.StringEnum( - "Status", - [("Succeeded", "succeeded"), ("Failed", "failed")], - clientNamespace: "Sample"); - var resultModel = InputFactory.Model( - "OperationResult", - properties: [InputFactory.Property("Status", statusEnum, isRequired: true)], - @namespace: "Sample"); - var operation = InputFactory.Operation("Get", responses: [InputFactory.OperationResponse(bodytype: resultModel)]); - var method = InputFactory.BasicServiceMethod("Get", operation, response: InputFactory.ServiceMethodResponse(resultModel, [])); - var client = InputFactory.Client("TestClient", methods: [method], clientNamespace: "Sample"); - - await GenerateAndAssertFiles( - enums: [statusEnum], - models: [resultModel], - clients: [client], - customFiles: [ - (Path.Combine("src", "Custom", "Status.cs"), """ - namespace Sample; - - [CodeGenType("Status")] - public enum Status - { - Succeeded, - Failed - } - """) - ], - expectedFiles: [Path.Combine("src", "Generated", "Models", "Status.Serialization.cs")]); - } - - [Test] - public async Task PublicBodyOnlyModelRemainsPublicWithCustomModelFactory() - { - var requestModel = InputFactory.Model("RequestBody"); - var parameter = InputFactory.BodyParameter("body", requestModel, isRequired: true); - var operation = InputFactory.Operation("Create", parameters: [parameter], httpMethod: "POST"); - var method = InputFactory.BasicServiceMethod("Create", operation); - var client = InputFactory.Client("TestClient", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [requestModel], - clients: [client], - customFiles: [ - (Path.Combine("src", "SampleModelFactory.cs"), """ - namespace Sample; - - [Microsoft.TypeSpec.Generator.Customizations.CodeGenType("SampleModelFactory")] - public static partial class SampleModelFactory - { - } - """) - ], - expectedFiles: [], - publicModelNames: ["RequestBody"]); - } - - [Test] - public async Task InternalCustomClientPartialOverridesLastContractPublicClient() - { - var responseModel = InputFactory.Model("CompactResource"); - var operation = InputFactory.Operation("Compact", responses: [InputFactory.OperationResponse(bodytype: responseModel)]); - var method = InputFactory.BasicServiceMethod("Compact", operation, response: InputFactory.ServiceMethodResponse(responseModel, [])); - var client = InputFactory.Client("Responses", methods: [method]); - - await GenerateAndAssertFiles( - enums: [], - models: [responseModel], - clients: [client], - customFiles: [ - (Path.Combine("src", "Generated", "Responses.cs"), """ - namespace Sample; - - public partial class Responses - { - } - """), - (Path.Combine("src", "Custom", "Internal", "Responses.cs"), """ - namespace Sample; - - internal partial class Responses - { - } - """) - ], - expectedFiles: [], - publicModelNames: ["CompactResource"], - internalClientNames: ["Responses"]); - } - - private static async Task GenerateAndAssertInternalModels( - InputModelType[] models, - InputClient[] clients, - string[] modelNames) - => await GenerateAndAssertModels(models, clients, modelNames, shouldBePublic: false); - - private static async Task GenerateAndAssertPublicModels( - InputModelType[] models, - InputClient[] clients, - string[] modelNames) - => await GenerateAndAssertModels(models, clients, modelNames, shouldBePublic: true); - - private static async Task GenerateAndAssertMixedModels( - InputModelType[] models, - InputClient[] clients, - string[] publicModelNames, - string[] internalModelNames) - => await GenerateAndAssertModels(models, clients, publicModelNames, internalModelNames); - - private static async Task GenerateAndAssertModels( - InputModelType[] models, - InputClient[] clients, - string[] modelNames, - bool shouldBePublic) - => await GenerateAndAssertModels( - models, - clients, - shouldBePublic ? modelNames : [], - shouldBePublic ? [] : modelNames); - - private static async Task GenerateAndAssertModels( - InputModelType[] models, - InputClient[] clients, - string[] publicModelNames, - string[] internalModelNames) - { - await GenerateAndAssertFiles( - enums: [], - models: models, - clients: clients, - customFiles: [], - publicModelNames: publicModelNames, - internalModelNames: internalModelNames, - expectedFiles: []); - } - - private static async Task GenerateAndAssertFiles( - InputEnumType[] enums, - InputModelType[] models, - InputClient[] clients, - (string Path, string Content)[] customFiles, - string[] expectedFiles, - string[] unexpectedFiles = null!, - string[] publicModelNames = null!, - string[] internalModelNames = null!, - string[] internalClientNames = null!, - string packageName = "Sample", - Action? configureGenerator = null) - { - publicModelNames ??= []; - internalModelNames ??= []; - internalClientNames ??= []; - unexpectedFiles ??= []; - - var outputPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - Directory.CreateDirectory(outputPath); - try - { - foreach (var customFile in customFiles) - { - var customPath = Path.Combine(outputPath, customFile.Path); - Directory.CreateDirectory(Path.GetDirectoryName(customPath)!); - File.WriteAllText(customPath, customFile.Content); - } - - await MockHelpers.LoadMockGeneratorAsync( - inputEnums: () => enums, - inputModels: () => models, - clients: () => clients, - configuration: $$"""{ "package-name": "{{packageName}}", "disable-xml-docs": true }""", - outputPath: outputPath); - configureGenerator?.Invoke(); - - await new CSharpGen().ExecuteAsync(); - - foreach (var modelName in publicModelNames) - { - var modelPath = Path.Combine(outputPath, "src", "Generated", "Models", $"{modelName}.cs"); - Assert.IsTrue(File.Exists(modelPath), $"Expected generated model file '{modelPath}'."); - var text = File.ReadAllText(modelPath); - StringAssert.Contains($"public partial class {modelName}", text, $"{modelName} should be public."); - } - - foreach (var modelName in internalModelNames) - { - var modelPath = Path.Combine(outputPath, "src", "Generated", "Models", $"{modelName}.cs"); - Assert.IsTrue(File.Exists(modelPath), $"Expected generated model file '{modelPath}'."); - var text = File.ReadAllText(modelPath); - StringAssert.Contains($"internal partial class {modelName}", text, $"{modelName} should be internal."); - StringAssert.DoesNotContain($"public partial class {modelName}", text, $"{modelName} should not be public."); - } - - foreach (var clientName in internalClientNames) - { - var clientPath = Path.Combine(outputPath, "src", "Generated", $"{clientName}.cs"); - Assert.IsTrue(File.Exists(clientPath), $"Expected generated client file '{clientPath}'."); - var text = File.ReadAllText(clientPath); - StringAssert.Contains($"internal partial class {clientName}", text, $"{clientName} should be internal."); - StringAssert.DoesNotContain($"public partial class {clientName}", text, $"{clientName} should not be public."); - } - - var modelFactoryPath = Path.Combine(outputPath, "src", "Generated", "SampleModelFactory.cs"); - if (File.Exists(modelFactoryPath)) - { - var modelFactoryText = File.ReadAllText(modelFactoryPath); - foreach (var modelName in publicModelNames) - { - StringAssert.Contains($" {modelName}(", modelFactoryText, $"Model factory method for {modelName} should be generated."); - } - - foreach (var modelName in internalModelNames) - { - StringAssert.DoesNotContain($" {modelName}(", modelFactoryText, $"Model factory method for {modelName} should not be generated."); - } - } - - foreach (var expectedFile in expectedFiles) - { - var filePath = Path.Combine(outputPath, expectedFile); - Assert.IsTrue(File.Exists(filePath), $"Expected generated file '{filePath}'."); - } - - foreach (var unexpectedFile in unexpectedFiles) - { - var filePath = Path.Combine(outputPath, unexpectedFile); - Assert.IsFalse(File.Exists(filePath), $"Did not expect generated file '{filePath}'."); - } - } - finally - { - if (Directory.Exists(outputPath)) - { - Directory.Delete(outputPath, recursive: true); - } - } - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs index 6c6e743ad89..9148f659e43 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs @@ -34,8 +34,7 @@ public static async Task> LoadMockGeneratorAsync( Func>? apiVersions = null, string? configuration = null, Func? createCSharpTypeCore = null, - Func? createCSharpTypeCoreFallback = null, - string? outputPath = null) + Func? createCSharpTypeCoreFallback = null) { var mockGenerator = LoadMockGenerator( inputLiterals: inputLiterals, @@ -45,13 +44,13 @@ public static async Task> LoadMockGeneratorAsync( apiVersions: apiVersions, configuration: configuration, createCSharpTypeCore: createCSharpTypeCore, - createCSharpTypeCoreFallback: createCSharpTypeCoreFallback, - outputPath: outputPath); + createCSharpTypeCoreFallback: createCSharpTypeCoreFallback); var compilationResult = compilation == null ? null : await compilation(); var lastContractCompilationResult = lastContractCompilation == null ? null : await lastContractCompilation(); - mockGenerator.SetupProperty(p => p.SourceInputModel, new SourceInputModel(compilationResult, lastContractCompilationResult)); + var sourceInputModel = new Mock(() => new SourceInputModel(compilationResult, lastContractCompilationResult)) { CallBase = true }; + mockGenerator.Setup(p => p.SourceInputModel).Returns(sourceInputModel.Object); return mockGenerator; } @@ -77,8 +76,7 @@ public static Mock LoadMockGenerator( Func? createOutputLibrary = null, bool includeXmlDocs = false, Func? createCSharpTypeCoreFallback = null, - Func? createModelCore = null, - string? outputPath = null) + Func? createModelCore = null) { IReadOnlyList inputNsApiVersions = apiVersions?.Invoke() ?? []; IReadOnlyList inputNsLiterals = inputLiterals?.Invoke() ?? []; @@ -152,7 +150,7 @@ public static Mock LoadMockGenerator( { configuration = "{\"disable-xml-docs\": false, \"package-name\": \"Sample.Namespace\"}"; } - object?[] parameters = [outputPath ?? _configFilePath, configuration]; + object?[] parameters = [_configFilePath, configuration]; var config = loadMethod?.Invoke(null, parameters); var mockGeneratorContext = new Mock(config!); var mockGeneratorInstance = new Mock(mockGeneratorContext.Object) { CallBase = true }; @@ -188,7 +186,8 @@ public static Mock LoadMockGenerator( mockGeneratorInstance.Setup(p => p.OutputLibrary).Returns(createOutputLibrary); } - mockGeneratorInstance.SetupProperty(p => p.SourceInputModel, new SourceInputModel(null, null)); + var sourceInputModel = new Mock(() => new SourceInputModel(null, null)) { CallBase = true }; + mockGeneratorInstance.Setup(p => p.SourceInputModel).Returns(sourceInputModel.Object); codeModelInstance!.SetValue(null, mockGeneratorInstance.Object); clientModelInstance!.SetValue(null, mockGeneratorInstance.Object); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs index 94abf17e68e..c013817a72e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CSharpGen.cs @@ -31,8 +31,8 @@ public async Task ExecuteAsync() var outputPath = CodeModelGenerator.Instance.Configuration.OutputDirectory; var generatedSourceOutputPath = CodeModelGenerator.Instance.Configuration.ProjectGeneratedDirectory; - // Resolve PackageReference items from the .csproj so custom code referencing external - // NuGet types compiles correctly. + // Resolve PackageReference items from the .csproj so custom code referencing + // external NuGet types (e.g., Azure.Storage.Common) compiles correctly. await GeneratedCodeWorkspace.AddPackageReferencesFromProject(); // Pre-walk the input library and resolve any external types that point at NuGet packages. @@ -90,69 +90,36 @@ await GeneratedCodeWorkspace.LoadBaselineContract(), { // Ensure back-compatibility processing is done after all visitors have run outputType.ProcessTypeForBackCompatibility(); - } - - try - { - using var referenceMapSession = ProviderReferenceMapAnalyzer.PrepareForGeneration(output.TypeProviders); - foreach (var outputType in output.TypeProviders) - { - if (!referenceMapSession.ShouldWriteProvider(outputType)) - { - continue; - } - if (outputType is ModelFactoryProvider && outputType.Methods.Count == 0) - { - continue; - } + var writer = CodeModelGenerator.Instance.GetWriter(outputType); + generateFilesTasks.Add(generatedCodeWorkspace.AddGeneratedFile(writer.Write())); - var writer = CodeModelGenerator.Instance.GetWriter(outputType); + foreach (var serialization in outputType.SerializationProviders) + { + writer = CodeModelGenerator.Instance.GetWriter(serialization); generateFilesTasks.Add(generatedCodeWorkspace.AddGeneratedFile(writer.Write())); - - foreach (var serialization in outputType.SerializationProviders) - { - if (!referenceMapSession.ShouldWriteProvider(serialization)) - { - continue; - } - - writer = CodeModelGenerator.Instance.GetWriter(serialization); - generateFilesTasks.Add(generatedCodeWorkspace.AddGeneratedFile(writer.Write())); - } } + } - // Add all the generated files to the workspace - await Task.WhenAll(generateFilesTasks); + // Add all the generated files to the workspace + await Task.WhenAll(generateFilesTasks); - referenceMapSession.RestorePreWriteModelFactoryMethods(); + LoggingHelpers.LogElapsedTime("All generated types have been written into memory"); - LoggingHelpers.LogElapsedTime("All generated types have been written into memory"); + // Delete any old generated files + DeleteDirectory(generatedSourceOutputPath, _filesToKeep); - // Delete any old generated files - DeleteDirectory(generatedSourceOutputPath, _filesToKeep); + LoggingHelpers.LogElapsedTime("All old generated files have been deleted"); - LoggingHelpers.LogElapsedTime("All old generated files have been deleted"); - } - finally - { - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - } + await generatedCodeWorkspace.PostProcessAsync(); - var generatedFiles = new List<(string Name, string Text)>(); + // Write the generated files to the output directory await foreach (var file in generatedCodeWorkspace.GetGeneratedFilesAsync()) { if (string.IsNullOrEmpty(file.Text)) { continue; } - - generatedFiles.Add((file.Name, file.Text)); - } - - // Write the generated files to the output directory - foreach (var file in generatedFiles) - { var filename = Path.Combine(outputPath, file.Name); CodeModelGenerator.Instance.Emitter.Info($"Writing {Path.GetFullPath(filename)}"); Directory.CreateDirectory(Path.GetDirectoryName(filename)!); @@ -173,30 +140,15 @@ await GeneratedCodeWorkspace.LoadBaselineContract(), internal static void FilterAllCustomizedMembers(OutputLibrary output) { - var visited = new HashSet(); foreach (var typeProvider in output.TypeProviders) { - FilterAllCustomizedMembers(typeProvider, visited); - } - } - - private static void FilterAllCustomizedMembers(TypeProvider typeProvider, HashSet visited) - { - if (!visited.Add(typeProvider)) - { - return; - } - - // Update the type with the potentially modified members, filtering out customized members - // after the visitors have been applied so that the filtering is done against the final version. - FilterCustomizedMembers(typeProvider); - foreach (var serializationProvider in typeProvider.SerializationProviders) - { - FilterAllCustomizedMembers(serializationProvider, visited); - } - foreach (var nestedType in typeProvider.NestedTypes) - { - FilterAllCustomizedMembers(nestedType, visited); + // Update the type with the potentially modified members, filtering out customized members + // after the visitors have been applied so that the filtering is done against the final version. + FilterCustomizedMembers(typeProvider); + foreach (var serializationProvider in typeProvider.SerializationProviders) + { + FilterCustomizedMembers(serializationProvider); + } } } @@ -225,10 +177,9 @@ private static void DeleteDirectory(string path, string[] filesToKeep) return; } - var fileNamesToKeep = filesToKeep.ToHashSet(StringComparer.Ordinal); foreach (var file in directoryInfo.GetFiles("*", SearchOption.AllDirectories)) { - if (!fileNamesToKeep.Contains(file.Name)) + if (!filesToKeep.Contains(file.Name)) { file.Delete(); } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs index 413cf395a7f..e8732f15ffd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/CodeModelGenerator.cs @@ -26,7 +26,6 @@ public abstract class CodeModelGenerator { private List _visitors = []; private List _additionalMetadataReferences = []; - private readonly Dictionary> _customCodeMethodDependencies = new(StringComparer.Ordinal); private static CodeModelGenerator? _instance; private List _sharedSourceDirectories = []; public const string GeneratorMetadataName = "GeneratorName"; @@ -162,25 +161,6 @@ public virtual void AddMetadataReference(MetadataReference reference) _additionalMetadataReferences.Add(reference); } - /// - /// Registers a generated provider required by an unresolved custom-code method invocation. - /// - /// The invoked method name. - /// The generated provider that defines the method. - protected void AddCustomCodeMethodDependency(string methodName, TypeProvider provider) - { - if (!_customCodeMethodDependencies.TryGetValue(methodName, out var providers)) - { - providers = []; - _customCodeMethodDependencies.Add(methodName, providers); - } - - providers.Add(provider); - } - - internal IReadOnlyList GetCustomCodeMethodDependencies(string methodName) => - _customCodeMethodDependencies.TryGetValue(methodName, out var providers) ? providers : []; - public virtual void AddSharedSourceDirectory(string sharedSourceDirectory) { _sharedSourceDirectories.Add(sharedSourceDirectory); @@ -262,7 +242,7 @@ public void AddTypeToKeep(string typeName, bool isRoot = true) /// /// /// The provider's fully qualified name is resolved lazily, when the keep list is consumed during - /// reference-map analysis. This makes it safe to call this method from a + /// post-processing. This makes it safe to call this method from a /// constructor (including base constructors that run before the derived constructor body), since /// it does not force evaluation of — which would dispatch virtual /// Build* methods on a not-yet-fully-constructed instance. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs index 740e000451c..c1c2678e1d3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/GeneratedCodeWorkspace.cs @@ -116,7 +116,7 @@ internal static SyntaxTree GetTree(TypeProvider provider) } var docs = await Task.WhenAll(documents); - LoggingHelpers.LogElapsedTime("Roslyn document processing complete"); + LoggingHelpers.LogElapsedTime("Roslyn post processing complete"); foreach (var doc in docs) { @@ -260,6 +260,33 @@ internal static Project AddDirectory(Project project, string directory, Func + /// This method invokes the postProcessor to do some post processing work + /// Depending on the configuration, it will either remove + internalize, just internalize or do nothing + /// + public async Task PostProcessAsync() + { + var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; + var nonRootTypes = CodeModelGenerator.Instance.NonRootTypes; + var postProcessor = new PostProcessor( + [.. CodeModelGenerator.Instance.TypeFactory.UnionVariantTypesToKeep, .. CodeModelGenerator.Instance.AdditionalRootTypes], + modelFactoryFullName: modelFactory.Type.FullyQualifiedName, + additionalNonRootTypeNames: nonRootTypes); + + switch (Configuration.UnreferencedTypesHandling) + { + case Configuration.UnreferencedTypesHandlingOption.KeepAll: + break; + case Configuration.UnreferencedTypesHandlingOption.Internalize: + _project = await postProcessor.InternalizeAsync(_project); + break; + case Configuration.UnreferencedTypesHandlingOption.RemoveOrInternalize: + _project = await postProcessor.InternalizeAsync(_project); + _project = await postProcessor.RemoveAsync(_project); + break; + } + } + /// /// Resolves PackageReference items from the project's .csproj file and adds their assemblies /// as metadata references so that custom code referencing external NuGet types compiles correctly. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs new file mode 100644 index 00000000000..dc42f801732 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs @@ -0,0 +1,669 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Simplification; + +namespace Microsoft.TypeSpec.Generator +{ + internal class PostProcessor + { + private readonly string? _modelFactoryFullName; + private readonly HashSet _additionalNonRootTypeNames; + private readonly HashSet _typesToKeep; + private INamedTypeSymbol? _modelFactorySymbol; + + public PostProcessor( + HashSet typesToKeep, + string? modelFactoryFullName = null, + IEnumerable? additionalNonRootTypeNames = null) + { + _typesToKeep = typesToKeep; + _modelFactoryFullName = modelFactoryFullName; + _additionalNonRootTypeNames = new HashSet(additionalNonRootTypeNames ?? []); + } + + private record TypeSymbols( + HashSet DeclaredSymbols, + INamedTypeSymbol? ModelFactorySymbol, + IReadOnlyDictionary> DeclaredNodesCache, + IReadOnlyDictionary> DocumentsCache); + + /// + /// This method reads the project, returns the types defined in it and build symbol caches to accelerate the calculation + /// By default, the types defined in shared documents are not included. Please override to tweak this behavior. + /// + /// The of the + /// The project to extract type symbols from + /// If is true, only public types will be included. If is false, all types will be included + /// A instance of which includes the information of the declared symbols of the given accessibility, along with some useful cache that is useful in this class. + private async Task GetTypeSymbolsAsync(Compilation compilation, + Project project, + bool publicOnly = true) + { + var result = new HashSet(SymbolEqualityComparer.Default); + var declarationCache = + new Dictionary>(SymbolEqualityComparer.Default); + var documentCache = new Dictionary>(); + + if (_modelFactoryFullName != null) + { + _modelFactorySymbol = compilation.GetTypeByMetadataName(_modelFactoryFullName); + } + + foreach (var document in project.Documents) + { + if (ShouldIncludeDocument(document)) + { + var root = await document.GetSyntaxRootAsync(); + if (root == null) + { + continue; + } + + var semanticModel = compilation.GetSemanticModel(root.SyntaxTree); + + foreach (var typeDeclaration in root.DescendantNodes().OfType()) + { + var symbol = semanticModel.GetDeclaredSymbol(typeDeclaration); + if (symbol == null) + { + continue; + } + + if (publicOnly && symbol.DeclaredAccessibility != Accessibility.Public && + !document.Name.StartsWith("Internal/", StringComparison.Ordinal)) + { + continue; + } + + AddInList(declarationCache, symbol, typeDeclaration); + AddInList(documentCache, document, symbol, + () => new HashSet(SymbolEqualityComparer.Default)); + + // we do not add the model factory and additionalNonRootTypeSymbols to the declared symbol list + // so that it will never be included in any process of internalization or removal + if (SymbolEqualityComparer.Default.Equals(symbol, _modelFactorySymbol) + || _additionalNonRootTypeNames.Contains(symbol.Name) + || _additionalNonRootTypeNames.Contains(symbol.GetFullyQualifiedName())) + { + continue; + } + + result.Add(symbol); + } + } + } + + return new TypeSymbols(result, + _modelFactorySymbol, + declarationCache.ToDictionary(kv => kv.Key, kv => kv.Value.ToHashSet(), + (IEqualityComparer)SymbolEqualityComparer.Default), + documentCache.ToDictionary(kv => kv.Key, + kv => kv.Value.ToHashSet(SymbolEqualityComparer.Default))); + } + + protected virtual bool ShouldIncludeDocument(Document document) => + !GeneratedCodeWorkspace.IsGeneratedTestDocument(document); + + /// + /// This method marks the "not publicly" referenced types as internal if they are previously defined as public. It will do this job in the following steps: + /// 1. This method will read all the public types defined in the given , and build a cache for those symbols + /// 2. Build a public reference map for those symbols + /// 3. Finds all the root symbols, please override the to control which document you would like to include + /// 4. Visit all the symbols starting from the root symbols following the reference map to get all unvisited symbols + /// 5. Change the accessibility of the unvisited symbols in step 4 to internal + /// + /// The project to process + /// The processed . is immutable, therefore this should usually be a new instance + public async Task InternalizeAsync(Project project) + { + var compilation = await project.GetCompilationAsync(); + if (compilation == null) + { + return project; + } + + // first get all the declared symbols + var definitions = await GetTypeSymbolsAsync(compilation, project, true); + // build the reference map + var referenceMap = + await new ReferenceMapBuilder(compilation, project).BuildPublicReferenceMapAsync( + definitions.DeclaredSymbols, definitions.DeclaredNodesCache); + // get the root symbols + var rootSymbols = await GetRootSymbolsAsync(project, definitions); + // traverse all the root and recursively add all the things we met + var publicSymbols = VisitSymbolsFromRootAsync(rootSymbols, referenceMap); + + var symbolsToInternalize = definitions.DeclaredSymbols.Except(publicSymbols); + + var nodesToInternalize = new Dictionary(); + foreach (var symbol in symbolsToInternalize) + { + foreach (var node in definitions.DeclaredNodesCache[symbol]) + { + nodesToInternalize[node] = project.GetDocumentId(node.SyntaxTree)!; + } + } + + foreach (var (model, documentId) in nodesToInternalize) + { + project = MarkInternal(project, model, documentId); + } + + var modelNamesToRemove = + nodesToInternalize.Keys.Select(item => item.Identifier.Text); + project = await RemoveMethodsFromModelFactoryAsync(project, definitions, modelNamesToRemove.ToHashSet()); + + return project; + } + + private async Task RemoveMethodsFromModelFactoryAsync(Project project, + TypeSymbols definitions, + HashSet namesToRemove) + { + var modelFactorySymbol = definitions.ModelFactorySymbol; + if (modelFactorySymbol == null) + { + return project; + } + + var nodesToRemove = new List(); + + foreach (var method in modelFactorySymbol.GetMembers().OfType()) + { + if (namesToRemove.Contains(method.Name)) + { + foreach (var reference in method.DeclaringSyntaxReferences) + { + var node = await reference.GetSyntaxAsync(); + nodesToRemove.Add(node); + } + } + } + + // find the GENERATED document of model factory (we may have the customized document of this for overloads) + Document? modelFactoryGeneratedDocument = null; + // the nodes corresponding to the model factory symbol has never been changed therefore the nodes inside the cache are still usable + if (definitions.DeclaredNodesCache.TryGetValue(modelFactorySymbol, out var nodes)) + { + foreach (var declarationNode in nodes) + { + var document = project.GetDocument(declarationNode.SyntaxTree); + if (document != null && GeneratedCodeWorkspace.IsGeneratedDocument(document)) + { + modelFactoryGeneratedDocument = document; + break; + } + } + } + + // maybe this is possible, for instance, we could be adding the customization all entries previously inside the generated model factory so that the generated model factory is empty and removed. + if (modelFactoryGeneratedDocument == null) + { + return project; + } + + var root = await modelFactoryGeneratedDocument.GetSyntaxRootAsync(); + Debug.Assert(root is not null); + root = root.RemoveNodes(nodesToRemove, SyntaxRemoveOptions.KeepNoTrivia)!; + modelFactoryGeneratedDocument = modelFactoryGeneratedDocument.WithSyntaxRoot(root); + + // see if this class still has any method, if it contains nothing, we should remove this document + var methods = root.DescendantNodes().OfType(); + if (!methods.Any()) + { + return project.RemoveDocument(modelFactoryGeneratedDocument.Id); + } + + return modelFactoryGeneratedDocument.Project; + } + + /// + /// This method removes the no-referenced types from the . It will do this job in the following steps: + /// 1. This method will read all the defined types in the given , and build a cache for those symbols + /// 2. Build a reference map for those symbols (including non-public usage) + /// 3. Finds all the root symbols, please override the to control which document you would like to include + /// 4. Visit all the symbols starting from the root symbols following the reference map to get all unvisited symbols + /// 5. Remove the definition of the unvisited symbols in step 4 + /// + /// The project to process + /// The processed . is immutable, therefore this should usually be a new instance + public async Task RemoveAsync(Project project) + { + var compilation = await project.GetCompilationAsync(); + if (compilation == null) + { + return project; + } + + // find all the declarations, including non-public declared + var definitions = await GetTypeSymbolsAsync(compilation, project, false); + // build reference map + var referenceMap = + await new ReferenceMapBuilder(compilation, project).BuildAllReferenceMapAsync( + definitions.DeclaredSymbols, definitions.DocumentsCache); + // get root symbols + var rootSymbols = await GetRootSymbolsAsync(project, definitions); + // include model factory as a root symbol when doing the remove pass so that we are sure to include any internal + // helpers that are required by the model factory. + if (_modelFactorySymbol != null) + { + rootSymbols.Add(_modelFactorySymbol); + } + // traverse the map to determine the declarations that we are about to remove, starting from root nodes + var referencedSymbols = VisitSymbolsFromRootAsync(rootSymbols, referenceMap); + + referencedSymbols = AddSampleSymbols(referencedSymbols, definitions.DeclaredSymbols); + var referencedSet = new HashSet(referencedSymbols, SymbolEqualityComparer.Default); + + var symbolsToRemove = definitions.DeclaredSymbols.Except(referencedSet); + + var nodesToRemove = new List(); + foreach (var symbol in symbolsToRemove) + { + if (referencedSet.Contains(GetBase(symbol))) + { + continue; + } + nodesToRemove.AddRange(definitions.DeclaredNodesCache[symbol]); + } + + // remove them one by one + project = await RemoveModelsAsync(project, nodesToRemove); + + return project; + } + + private INamedTypeSymbol GetBase(INamedTypeSymbol symbol) + { + var baseType = symbol.BaseType; + if (baseType == null || baseType.SpecialType == SpecialType.System_Object) + { + return symbol; + } + + return GetBase(baseType); + } + + private IEnumerable AddSampleSymbols( + IEnumerable referencedSymbols, + HashSet declaredSymbols) + { + List symbolsToAdd = new List(); + foreach (var symbol in declaredSymbols) + { + if (symbol.ContainingNamespace.Name == "Samples" && symbol.Name.StartsWith("Samples_") && + !referencedSymbols.Any(s => s.Name == symbol.Name)) + { + symbolsToAdd.Add(symbol); + } + } + + return referencedSymbols.Concat(symbolsToAdd); + } + + /// + /// Do a BFS starting from the by following the + /// + /// + /// + /// + private static IEnumerable VisitSymbolsFromRootAsync( + IEnumerable rootSymbols, + ReferenceMap referenceMap) + { + var queue = new Queue(rootSymbols.Concat(referenceMap.GlobalReferencedSymbols)); + var visited = new HashSet(SymbolEqualityComparer.Default); + while (queue.Count > 0) + { + var definition = queue.Dequeue(); + if (visited.Contains(definition)) + { + continue; + } + + visited.Add(definition); + // add this definition to the result + yield return definition; + // add every type referenced by this node to the queue + foreach (var child in GetReferencedTypes(definition, referenceMap)) + { + queue.Enqueue(child); + } + } + } + + private static IEnumerable GetReferencedTypes(T definition, + IReadOnlyDictionary> referenceMap) where T : notnull + { + if (referenceMap.TryGetValue(definition, out var references)) + { + return references; + } + + return Enumerable.Empty(); + } + + private Project MarkInternal(Project project, BaseTypeDeclarationSyntax declarationNode, DocumentId documentId) + { + var newNode = ChangeModifier(declarationNode, SyntaxKind.PublicKeyword, SyntaxKind.InternalKeyword); + var tree = declarationNode.SyntaxTree; + var document = project.GetDocument(documentId)!; + var newRoot = tree.GetRoot().ReplaceNode(declarationNode, newNode) + .WithAdditionalAnnotations(Simplifier.Annotation); + document = document.WithSyntaxRoot(newRoot); + return document.Project; + } + + private async Task RemoveModelsAsync(Project project, + IEnumerable unusedModels) + { + // accumulate the definitions from the same document together + var documents = new Dictionary>(); + + foreach (var model in unusedModels) + { + var document = project.GetDocument(model.SyntaxTree); + Debug.Assert(document != null); + if (!documents.ContainsKey(document)) + { + documents.Add(document, new HashSet()); + } + + documents[document].Add(model); + } + + foreach (var models in documents.Values) + { + project = await RemoveModelsFromDocumentAsync(project, models); + } + + // remove what are now invalid references due to the models being removed + project = await RemoveInvalidRefs(project); + + return project; + } + + private static BaseTypeDeclarationSyntax ChangeModifier(BaseTypeDeclarationSyntax memberDeclaration, + SyntaxKind from, + SyntaxKind to) + { + var originalTokenInList = memberDeclaration.Modifiers.FirstOrDefault(token => token.IsKind(from)); + + // skip this if there is nothing to replace + if (originalTokenInList == default) + { + return memberDeclaration; + } + + var newToken = + SyntaxFactory.Token(originalTokenInList.LeadingTrivia, to, originalTokenInList.TrailingTrivia); + var newModifiers = memberDeclaration.Modifiers.Replace(originalTokenInList, newToken); + return memberDeclaration.WithModifiers(newModifiers); + } + + private async Task RemoveModelsFromDocumentAsync(Project project, + IEnumerable models) + { + var tree = models.First().SyntaxTree; + var document = project.GetDocument(tree); + if (document == null) + { + return project; + } + + var root = await tree.GetRootAsync(); + root = root.RemoveNodes(models, SyntaxRemoveOptions.KeepNoTrivia); + + var emptyNamespaces = root! + .DescendantNodes() + .OfType() + .Where(ns => !ns.Members.OfType().Any()) + .ToList(); + + if (emptyNamespaces.Any()) + { + root = root.RemoveNodes(emptyNamespaces, SyntaxRemoveOptions.KeepNoTrivia); + } + + document = document.WithSyntaxRoot(root!); + return document.Project; + } + + private async Task RemoveInvalidRefs(Project project) + { + var solution = project.Solution; + + // Process each document for invalid usings + foreach (var documentId in project.DocumentIds) + { + solution = await RemoveInvalidUsings(solution, documentId); + } + + // Process each document for invalid attributes (with fresh semantic models) + foreach (var documentId in project.DocumentIds) + { + solution = await RemoveInvalidAttributes(solution, documentId); + } + + return solution.GetProject(project.Id)!; + } + + private async Task RemoveInvalidUsings(Solution solution, DocumentId documentId) + { + var document = solution.GetDocument(documentId)!; + var root = await document.GetSyntaxRootAsync(); + var model = await document.GetSemanticModelAsync(); + + if (root is not CompilationUnitSyntax cu || model == null) + { + return solution; + } + + var invalidUsings = cu.Usings + .Where(u => + { + var info = model.GetSymbolInfo(u.Name!); + var sym = info.Symbol; + return sym is null || sym.Kind != SymbolKind.Namespace; + }) + .ToList(); + + if (invalidUsings.Count > 0) + { + cu = cu.RemoveNodes(invalidUsings, SyntaxRemoveOptions.KeepNoTrivia)!; + solution = solution.WithDocumentSyntaxRoot(documentId, cu); + } + + return solution; + } + + private async Task RemoveInvalidAttributes(Solution solution, DocumentId documentId) + { + var document = solution.GetDocument(documentId)!; + var root = await document.GetSyntaxRootAsync(); + var model = await document.GetSemanticModelAsync(); + + if (root is not CompilationUnitSyntax cu || model == null) + { + return solution; + } + + var attributes = cu.DescendantNodes().OfType(); + var firstAttribute = attributes.FirstOrDefault(); + + var invalidAttributes = attributes + .Where(attr => attr.Attributes.Any(attribute => + attribute.ArgumentList?.Arguments.Any(arg => + arg.Expression is TypeOfExpressionSyntax typeOfExpr && + model.GetTypeInfo(typeOfExpr.Type).Type?.TypeKind == TypeKind.Error) == true)) + .ToHashSet(); + + if (invalidAttributes.Count > 0) + { + cu = cu.RemoveNodes(invalidAttributes, SyntaxRemoveOptions.KeepNoTrivia)!; + + if (invalidAttributes.Contains(firstAttribute!)) + { + var leadingTrivia = firstAttribute!.GetLeadingTrivia(); + // Find where XML docs end and indentation begins + var xmlDocTrivia = new List(); + var lastXmlIndex = -1; + + for (int i = 0; i < leadingTrivia.Count; i++) + { + var trivia = leadingTrivia[i]; + if (trivia.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia)) + { + lastXmlIndex = i; + } + } + + // Collect trivia up to and including the last XML doc line's newline + if (lastXmlIndex >= 0) + { + for (int i = 0; i <= lastXmlIndex; i++) + { + xmlDocTrivia.Add(leadingTrivia[i]); + } + + // Include the newline after the last XML doc if present + if (lastXmlIndex + 1 < leadingTrivia.Count && + leadingTrivia[lastXmlIndex + 1].IsKind(SyntaxKind.EndOfLineTrivia)) + { + xmlDocTrivia.Add(leadingTrivia[lastXmlIndex + 1]); + } + } + + // Find the updated type and add the XML docs to it + var updatedType = cu.DescendantNodes() + .OfType() + .FirstOrDefault(); + + if (updatedType != null && xmlDocTrivia.Any()) + { + var existingTrivia = updatedType.GetLeadingTrivia(); + cu = cu.ReplaceNode(updatedType, + updatedType.WithLeadingTrivia(xmlDocTrivia.Concat(existingTrivia))); + } + } + + solution = solution.WithDocumentSyntaxRoot(documentId, cu); + } + + return solution; + } + + private async Task> GetRootSymbolsAsync(Project project, TypeSymbols modelSymbols) + { + var result = new HashSet(SymbolEqualityComparer.Default); + foreach (var symbol in modelSymbols.DeclaredSymbols) + { + foreach (var declarationNode in modelSymbols.DeclaredNodesCache[symbol]) + { + var document = project.GetDocument(declarationNode.SyntaxTree); + if (document == null) + { + continue; + } + + if (await IsRootDocument(document)) + { + result.Add(symbol); + break; + // if any of the declaring document of this symbol is considered as a root document, we add the symbol to the root list, skipping the processing of any other documents of this symbol + } + } + } + + return result; + } + + protected virtual async Task IsRootDocument(Document document) + { + var root = await document.GetSyntaxRootAsync(); + // a document is a root document, when + // 1. it is a custom document (not generated or shared) + // 2. it is a client + // 3. user exceptions + return GeneratedCodeWorkspace.IsCustomDocument(document) || IsClientDocument(document) || + ShouldKeepType(root, _typesToKeep); + } + + private static bool ShouldKeepType(SyntaxNode? root, HashSet typesToKeep) + { + if (root is null) + { + return false; + } + + // use `BaseTypeDeclarationSyntax` to also include enums because `EnumDeclarationSyntax` extends `BaseTypeDeclarationSyntax` + // `ClassDeclarationSyntax` and `StructDeclarationSyntax` both inherit `TypeDeclarationSyntax` + var typeNodes = root.DescendantNodes().OfType(); + // there is possibility that we have multiple types defined in the same document (for instance, custom code) + return typeNodes.Any(t => + { + // Get simple name + var simpleName = t.Identifier.Text; + if (typesToKeep.Contains(simpleName)) + { + return true; + } + + // Get fully qualified name + var fullName = GetFullyQualifiedName(t); + return typesToKeep.Contains(fullName); + }); + } + + private static string GetFullyQualifiedName(BaseTypeDeclarationSyntax typeDeclaration) + { + var namespaceDeclaration = typeDeclaration.Ancestors() + .OfType() + .FirstOrDefault(); + + return namespaceDeclaration != null + ? $"{namespaceDeclaration.Name}.{typeDeclaration.Identifier.Text}" + : typeDeclaration.Identifier.Text; + } + + private static bool IsClientDocument(Document document) + { + return document.Name.EndsWith("Client.cs", StringComparison.Ordinal); + } + + private static void AddInList(Dictionary dictionary, + TKey key, + TValue value, + Func? collectionConstructor = null) where TKey : notnull where TList : ICollection, new() + { + if (dictionary.TryGetValue(key, out var list)) + { + list.Add(value); + } + else + { + TList newList; + if (collectionConstructor == null) + { + newList = new TList(); + } + else + { + newList = collectionConstructor(); + } + + newList.Add(value); + dictionary.Add(key, newList); + } + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs new file mode 100644 index 00000000000..7fe83d20f2e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMap.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Microsoft.CodeAnalysis; + +namespace Microsoft.TypeSpec.Generator +{ + internal class ReferenceMap : IReadOnlyDictionary> + { + private Dictionary> _referenceMap; + + private List _globalReference; + + public ReferenceMap() + { + _referenceMap = new(SymbolEqualityComparer.Default); + _globalReference = new(); + } + + /// + /// Adds the value into the list corresponding to key + /// + /// + /// + /// true if the value is added into the list, false if the value already exists in the list + internal bool AddInList(INamedTypeSymbol key, INamedTypeSymbol value) + { + if (_referenceMap.TryGetValue(key, out var list)) + { + // the list is guaranteed to be a HashSet + var set = (HashSet)list; + return set.Add(value); + } + else + { + var newList = new HashSet(SymbolEqualityComparer.Default) { value }; + _referenceMap.Add(key, newList); + return true; + } + } + + internal void AddGlobal(INamedTypeSymbol typeSymbol) + { + _globalReference.Add(typeSymbol); + } + + public IEnumerable GlobalReferencedSymbols => _globalReference; + + public IEnumerable this[INamedTypeSymbol key] => _referenceMap[key]; + + public IEnumerable Keys => _referenceMap.Keys; + + public IEnumerable> Values => _referenceMap.Values; + + public int Count => _referenceMap.Count; + + public bool ContainsKey(INamedTypeSymbol key) => _referenceMap.ContainsKey(key); + + public IEnumerator>> GetEnumerator() => + _referenceMap.GetEnumerator(); + + public bool TryGetValue(INamedTypeSymbol key, [MaybeNullWhen(false)] out IEnumerable value) => + _referenceMap.TryGetValue(key, out value); + + IEnumerator IEnumerable.GetEnumerator() => _referenceMap.GetEnumerator(); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs new file mode 100644 index 00000000000..a4b1e31f90b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/ReferenceMapBuilder.cs @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Xml.Linq; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.FindSymbols; + +namespace Microsoft.TypeSpec.Generator +{ + internal class ReferenceMapBuilder + { + private readonly Compilation _compilation; + private readonly Project _project; + + public ReferenceMapBuilder(Compilation compilation, Project project) + { + _compilation = compilation; + _project = project; + } + + public async Task BuildPublicReferenceMapAsync(IEnumerable definitions, IReadOnlyDictionary> nodeCache) + { + var referenceMap = new ReferenceMap(); + foreach (var definition in definitions) + { + await ProcessPublicSymbolAsync(definition, referenceMap, nodeCache); + } + + return referenceMap; + } + + public async Task BuildAllReferenceMapAsync(IEnumerable definitions, IReadOnlyDictionary> documentCache) + { + var referenceMap = new ReferenceMap(); + foreach (var definition in definitions) + { + await ProcessSymbolAsync(definition, referenceMap, documentCache); + } + + return referenceMap; + } + + private async Task ProcessPublicSymbolAsync(INamedTypeSymbol symbol, ReferenceMap referenceMap, IReadOnlyDictionary> cache) + { + // only add to reference when myself is public + if (symbol.DeclaredAccessibility != Accessibility.Public) + { + return; + } + + // process myself, adding base and generic arguments + AddTypeSymbol(symbol, symbol, referenceMap); + + // add my sibling classes + foreach (var declaration in cache[symbol]) + { + // first find all the derived types from this type + foreach (var derivedTypeSymbol in await SymbolFinder.FindDerivedClassesAsync(symbol, _project.Solution)) + { + AddTypeSymbol(symbol, derivedTypeSymbol, referenceMap); + } + } + + // go over all the members + foreach (var member in symbol.GetMembers()) + { + // only go through the public members + if (member.DeclaredAccessibility != Accessibility.Public) + { + continue; + } + + switch (member) + { + case IMethodSymbol methodSymbol: + ProcessMethodSymbol(symbol, methodSymbol, referenceMap); + break; + case IPropertySymbol propertySymbol: + ProcessPropertySymbol(symbol, propertySymbol, referenceMap); + break; + case IFieldSymbol fieldSymbol: + ProcessFieldSymbol(symbol, fieldSymbol, referenceMap); + break; + case IEventSymbol eventSymbol: + ProcessEventSymbol(symbol, eventSymbol, referenceMap); + break; + case INamedTypeSymbol innerTypeSymbol: + break; // do nothing for the inner types + default: + throw new InvalidOperationException($"This case has not been covered {member.GetType()}"); + } + } + } + + private async Task ProcessSymbolAsync(INamedTypeSymbol symbol, ReferenceMap referenceMap, IReadOnlyDictionary> documentCache) + { + foreach (var reference in await SymbolFinder.FindReferencesAsync(symbol, _project.Solution)) + { + await AddReferenceToReferenceMapAsync(symbol, reference, referenceMap, documentCache); + } + + // static class can have direct references, like ClassName.Method, but the extension methods might not have direct reference to the class itself + // therefore here we find the references of all its members and add them to the reference map + await ProcessExtensionSymbol(symbol, referenceMap, documentCache); + } + + private async Task ProcessExtensionSymbol(INamedTypeSymbol extensionClassSymbol, ReferenceMap referenceMap, IReadOnlyDictionary> documentCache) + { + if (!extensionClassSymbol.IsStatic) + { + return; + } + + foreach (var member in extensionClassSymbol.GetMembers()) + { + if (member is not IMethodSymbol methodSymbol) + { + continue; + } + + if (!methodSymbol.IsExtensionMethod) + { + continue; + } + + foreach (var reference in await SymbolFinder.FindReferencesAsync(member, _project.Solution)) + { + await AddReferenceToReferenceMapAsync(extensionClassSymbol, reference, referenceMap, documentCache); + } + + // this is to hook the extension class like this: + // internal static class FooExtensions + // { + // public static string ToSerialString(this Foo foo) => foo.ToString(); + // public static Foo ToFoo(this string foo) => // omit body + // } + + // if this is an extension method, we add it to the reference map of the type it is extending to pretend that this class is a part of that type + // handle the first method above + if (methodSymbol.Parameters.FirstOrDefault()?.Type is INamedTypeSymbol typeSymbol) + { + referenceMap.AddInList(typeSymbol, extensionClassSymbol); + } + + // we also add the return type into the reference map of the extension class to cover both cases + // handle the second method above + if (methodSymbol.ReturnType is INamedTypeSymbol returnTypeSymbol) + { + referenceMap.AddInList(returnTypeSymbol, extensionClassSymbol); + } + } + } + + private async Task AddReferenceToReferenceMapAsync(INamedTypeSymbol symbol, ReferencedSymbol reference, ReferenceMap referenceMap, IReadOnlyDictionary> documentCache) + { + foreach (var location in reference.Locations) + { + var document = location.Document; + + // skip this reference if it comes from a document that does not define any symbol + if (!documentCache.TryGetValue(document, out var candidateReferenceSymbols)) + { + continue; + } + + if (candidateReferenceSymbols.Count == 1) + { + referenceMap.AddInList(candidateReferenceSymbols.Single(), symbol); + } + else + { + // fallback to calculate the symbol when the document contains multiple type symbols + // this should never happen in the generated code + // customized code might have this issue + var root = await document.GetSyntaxRootAsync(); + if (root == null) + { + continue; + } + // get the node of this reference + var node = root.FindNode(location.Location.SourceSpan); + var owner = GetOwnerTypeOfReference(node); + if (owner == null) + { + referenceMap.AddGlobal(symbol); + } + else + { + var semanticModel = _compilation.GetSemanticModel(owner.SyntaxTree); + var ownerSymbol = semanticModel.GetDeclaredSymbol(owner); + + if (ownerSymbol == null) + { + continue; + } + // add it to the map + referenceMap.AddInList(ownerSymbol, symbol); + } + } + } + } + + /// + /// This method recursively adds all related types in to the reference map as the value of key + /// + /// + /// + /// + private void AddTypeSymbol(ITypeSymbol keySymbol, ITypeSymbol? valueSymbol, ReferenceMap referenceMap) + { + if (keySymbol is not INamedTypeSymbol keyTypeSymbol) + { + return; + } + + if (valueSymbol is not INamedTypeSymbol valueTypeSymbol) + { + return; + } + // add the class and all its partial classes to the map + // this will make all the partial classes are referencing each other in the reference map + // when we make the travesal over the reference map, we will not only remove one of the partial class, instead we will either keep all the partial classes (if at least one of them has references), or remove all of them (if none of them has references) + if (!referenceMap.AddInList(keyTypeSymbol, valueTypeSymbol)) + { + return; // we short cut if the valueTypeSymbol has already existed in the list to avoid infinite loops + } + // add the base type + AddTypeSymbol(keyTypeSymbol, valueTypeSymbol.BaseType, referenceMap); + // add the interfaces if there is any + foreach (var interfaceSymbol in valueTypeSymbol.Interfaces) + { + AddTypeSymbol(keyTypeSymbol, interfaceSymbol, referenceMap); + } + // add the generic type arguments + foreach (var typeArgument in valueTypeSymbol.TypeArguments) + { + AddTypeSymbol(keyTypeSymbol, typeArgument, referenceMap); + } + } + + private void ProcessMethodSymbol(INamedTypeSymbol keySymbol, IMethodSymbol methodSymbol, ReferenceMap referenceMap) + { + // add the return type + AddTypeSymbol(keySymbol, methodSymbol.ReturnType, referenceMap); + // add the parameters + foreach (var parameter in methodSymbol.Parameters) + { + AddTypeSymbol(keySymbol, parameter.Type, referenceMap); + } + } + + private void ProcessPropertySymbol(INamedTypeSymbol keySymbol, IPropertySymbol propertySymbol, ReferenceMap referenceMap) + { + AddTypeSymbol(keySymbol, propertySymbol.Type, referenceMap); + + // find the node that defines myself + var xml = propertySymbol.GetDocumentationCommentXml(); + if (string.IsNullOrEmpty(xml)) + { + return; + } + + var xDocument = XDocument.Parse(xml); + var cRefs = xDocument.Descendants().Attributes("cref").Select(a => a.Value).Where(a => a[0] == 'T' && a[1] == ':').Select(a => a.Substring(2)); + + foreach (var cref in cRefs) + { + var symbol = _compilation.GetTypeByMetadataName(cref); + AddTypeSymbol(keySymbol, symbol, referenceMap); + } + } + + private void ProcessFieldSymbol(INamedTypeSymbol keySymbol, IFieldSymbol fieldSymbol, ReferenceMap referenceMap) => AddTypeSymbol(keySymbol, fieldSymbol.Type, referenceMap); + + private void ProcessEventSymbol(INamedTypeSymbol keySymbol, IEventSymbol eventSymbol, ReferenceMap referenceMap) => AddTypeSymbol(keySymbol, eventSymbol.Type, referenceMap); + + /// + /// Returns the node that defines inside the document, which should be , or + /// The here should come from the result of , therefore a result is guaranteed + /// + /// + /// + private static BaseTypeDeclarationSyntax? GetOwnerTypeOfReference(SyntaxNode node) + { + SyntaxNode? current = node; + while (current != null) + { + if (current is BaseTypeDeclarationSyntax declarationNode) + { + return declarationNode; + } + + current = current.Parent; + } + + // this means owner of the reference is outside a type definition. For instance, we could have an assembly attribute that is referencing a class using `nameof` + return null; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs index 4797be0d90b..49fe9723973 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/TypeProviderWriter.cs @@ -45,11 +45,11 @@ private bool IsPublicContext(TypeProvider provider) private void WriteType(CodeWriter writer) { - if (_provider.PreserveTypeXmlDocs || _provider.ShouldWriteTypeXmlDocs || IsPublicContext(_provider)) + if (IsPublicContext(_provider)) { writer.WriteXmlDocsNoScope(_provider.XmlDocs); } - foreach (var attribute in _provider.GetAttributesForWrite()) + foreach (var attribute in _provider.GetAttributes()) { attribute.Write(writer); if (attribute is AttributeStatement) @@ -207,11 +207,6 @@ private void WriteConstructors(CodeWriter writer) private void WriteMethods(CodeWriter writer) { - if (_provider is ModelFactoryProvider { PreserveLeadingMethodSeparator: true } && _provider.Methods.Count > 0) - { - writer.WriteLine(); - } - for (int i = 0; i < _provider.Methods.Count; i++) { writer.WriteMethod(_provider.Methods[i]); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs index 90e71ace797..b2c2915f915 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/CanonicalTypeProvider.cs @@ -48,25 +48,7 @@ public CanonicalTypeProvider(TypeProvider generatedTypeProvider, InputType? inpu protected override IReadOnlyList BuildAttributes() { - // TODO https://github.com/microsoft/typespec/issues/11232: Move this generated/custom attribute merge into a shared TypeProvider API. - return DeduplicateAttributes( - _generatedTypeProvider.Attributes, - _generatedTypeProvider.CustomCodeView?.Attributes); - } - - private static IReadOnlyList DeduplicateAttributes(params IEnumerable?[] attributeSets) - { - var seen = new HashSet(); - var attributes = new List(); - foreach (var attribute in attributeSets.SelectMany(static attributeSet => attributeSet ?? [])) - { - if (seen.Add(attribute.ToDisplayString())) - { - attributes.Add(attribute); - } - } - - return attributes; + return [.. _generatedTypeProvider.Attributes, .. _generatedTypeProvider.CustomCodeView?.Attributes ?? []]; } private protected override CanonicalTypeProvider BuildCanonicalView() => this; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs index f4fbf891762..ae2495a64ba 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelFactoryProvider.cs @@ -30,8 +30,6 @@ protected internal ModelFactoryProvider(IEnumerable models) _models = models; } - internal bool PreserveLeadingMethodSeparator { get; set; } - protected override string BuildName() => string.Concat(CodeModelGenerator.Instance.TypeFactory.ServiceName, ModelFactorySuffix); protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.cs"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs index 34b7e129827..5f0faf734e7 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/NamedTypeSymbolProvider.cs @@ -22,8 +22,6 @@ internal sealed class NamedTypeSymbolProvider : TypeProvider { private INamedTypeSymbol _namedTypeSymbol; private readonly Compilation _compilation; - private string? _metadataName; - private string? _metadataSimpleName; private TypeProvider? _baseTypeProvider; public NamedTypeSymbolProvider(INamedTypeSymbol namedTypeSymbol, Compilation compilation) @@ -32,40 +30,9 @@ public NamedTypeSymbolProvider(INamedTypeSymbol namedTypeSymbol, Compilation com _compilation = compilation; } - internal string MetadataName - { - get - { - if (_metadataName != null) - { - return _metadataName; - } - - var ns = _namedTypeSymbol.ContainingNamespace.GetFullyQualifiedNameFromDisplayString(); - var typeName = GetMetadataName(_namedTypeSymbol); - _metadataName = string.IsNullOrEmpty(ns) ? typeName : $"{ns}.{typeName}"; - return _metadataName; - } - } - - internal string MetadataSimpleName => _metadataSimpleName ??= _namedTypeSymbol.Name; - private protected sealed override NamedTypeSymbolProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => null; private protected sealed override TypeProvider? BuildLastContractView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => null; - protected override CSharpType[] GetTypeArguments() => - [.. _namedTypeSymbol.TypeParameters.Select(parameter => parameter.GetCSharpType())]; - - private static string GetMetadataName(INamedTypeSymbol symbol) - { - if (symbol.ContainingType is null) - { - return symbol.MetadataName; - } - - return $"{GetMetadataName(symbol.ContainingType)}+{symbol.MetadataName}"; - } - protected override string BuildRelativeFilePath() => throw new InvalidOperationException("This type should not be writing in generation"); protected override string BuildName() => _namedTypeSymbol.Name; @@ -347,9 +314,6 @@ protected internal override MethodProvider[] BuildMethods() GetNullableCSharpType(methodSymbol.ReturnType), GetSymbolXmlDoc(methodSymbol, "returns"), [.. methodSymbol.Parameters.Select(p => ConvertToParameterProvider(methodSymbol, p))], - GenericArguments: methodSymbol.TypeParameters.IsEmpty - ? null - : [.. methodSymbol.TypeParameters.Select(parameter => parameter.GetCSharpType())], ExplicitInterface: explicitInterface?.ContainingType?.GetCSharpType()); methods.Add(new MethodProvider(signature, MethodBodyStatement.Empty, this)); @@ -357,384 +321,6 @@ [.. methodSymbol.Parameters.Select(p => ConvertToParameterProvider(methodSymbol, return [.. methods]; } - protected internal override IReadOnlyList BuildBodyDependencyTypes() - { - var dependencies = new HashSet(); - foreach (var syntaxReference in _namedTypeSymbol.DeclaringSyntaxReferences) - { - var syntax = syntaxReference.GetSyntax(); - if (IsGeneratedSourceFile(syntax.SyntaxTree.FilePath)) - { - continue; - } - - AddBodyDependencyTypes(syntax, dependencies); - } - - return [.. dependencies]; - } - - protected internal override IReadOnlyList BuildSignatureDependencyTypes() - { - var dependencies = new HashSet(); - foreach (var syntaxReference in _namedTypeSymbol.DeclaringSyntaxReferences) - { - var syntax = syntaxReference.GetSyntax(); - if (IsGeneratedSourceFile(syntax.SyntaxTree.FilePath) || - syntax is not TypeDeclarationSyntax typeDeclaration || - !IsPublic(typeDeclaration.Modifiers)) - { - continue; - } - - var semanticModel = _compilation.GetSemanticModel(typeDeclaration.SyntaxTree); - var namespaceCandidates = GetNamespaceCandidates(typeDeclaration); - AddPublicTypeSignatureDependencyTypes(typeDeclaration, dependencies, semanticModel, namespaceCandidates); - } - - return [.. dependencies]; - } - - private void AddBodyDependencyTypes(SyntaxNode syntax, HashSet dependencies) - { - var semanticModel = _compilation.GetSemanticModel(syntax.SyntaxTree); - AddSyntaxTypeReferences(syntax, dependencies, semanticModel, GetNamespaceCandidates(syntax)); - - foreach (var invocation in syntax.DescendantNodes().OfType()) - { - var invocationName = GetInvocationName(invocation); - if (invocationName == null) - { - continue; - } - - foreach (var provider in CodeModelGenerator.Instance.GetCustomCodeMethodDependencies(invocationName)) - { - dependencies.Add(provider.Type); - } - } - } - - private void AddPublicSignatureDependencyTypes(MemberDeclarationSyntax member, HashSet dependencies) - { - var semanticModel = _compilation.GetSemanticModel(member.SyntaxTree); - var namespaceCandidates = GetNamespaceCandidates(member); - switch (member) - { - case MethodDeclarationSyntax method: - AddSyntaxTypeReferences(method.ReturnType, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(method.ParameterList, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(method.ConstraintClauses, dependencies, semanticModel, namespaceCandidates); - break; - case ConstructorDeclarationSyntax constructor: - AddSyntaxTypeReferences(constructor.ParameterList, dependencies, semanticModel, namespaceCandidates); - break; - case ConversionOperatorDeclarationSyntax conversion: - AddSyntaxTypeReferences(conversion.Type, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(conversion.ParameterList, dependencies, semanticModel, namespaceCandidates); - break; - case OperatorDeclarationSyntax @operator: - AddSyntaxTypeReferences(@operator.ReturnType, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(@operator.ParameterList, dependencies, semanticModel, namespaceCandidates); - break; - case PropertyDeclarationSyntax property: - AddSyntaxTypeReferences(property.Type, dependencies, semanticModel, namespaceCandidates); - break; - case IndexerDeclarationSyntax indexer: - AddSyntaxTypeReferences(indexer.Type, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(indexer.ParameterList, dependencies, semanticModel, namespaceCandidates); - break; - case FieldDeclarationSyntax field: - AddSyntaxTypeReferences(field.Declaration.Type, dependencies, semanticModel, namespaceCandidates); - break; - case EventFieldDeclarationSyntax eventField: - AddSyntaxTypeReferences(eventField.Declaration.Type, dependencies, semanticModel, namespaceCandidates); - break; - case EventDeclarationSyntax @event: - AddSyntaxTypeReferences(@event.Type, dependencies, semanticModel, namespaceCandidates); - break; - case DelegateDeclarationSyntax @delegate: - AddSyntaxTypeReferences(@delegate.ReturnType, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(@delegate.ParameterList, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(@delegate.ConstraintClauses, dependencies, semanticModel, namespaceCandidates); - break; - case TypeDeclarationSyntax type: - AddPublicTypeSignatureDependencyTypes(type, dependencies, semanticModel, namespaceCandidates); - break; - case BaseTypeDeclarationSyntax type: - AddSyntaxTypeReferences(type.BaseList, dependencies, semanticModel, namespaceCandidates); - break; - } - } - - private void AddPublicTypeSignatureDependencyTypes( - TypeDeclarationSyntax typeDeclaration, - HashSet dependencies, - SemanticModel semanticModel, - IReadOnlyList namespaceCandidates) - { - AddSyntaxTypeReferences(typeDeclaration.BaseList, dependencies, semanticModel, namespaceCandidates); - AddSyntaxTypeReferences(typeDeclaration.ConstraintClauses, dependencies, semanticModel, namespaceCandidates); - foreach (var member in typeDeclaration.Members) - { - if (IsPublicApiMember(member)) - { - AddPublicSignatureDependencyTypes(member, dependencies); - } - } - } - - private static void AddSyntaxTypeReferences(SyntaxNode? node, HashSet dependencies, SemanticModel semanticModel, IReadOnlyList namespaceCandidates) - { - if (node == null) - { - return; - } - - foreach (var type in node.DescendantNodesAndSelf().OfType()) - { - if (type.IsPartOfStructuredTrivia()) - { - continue; - } - - AddSyntaxTypeReference(type, dependencies, semanticModel, namespaceCandidates); - } - } - - private static void AddSyntaxTypeReferences(IEnumerable nodes, HashSet dependencies, SemanticModel semanticModel, IReadOnlyList namespaceCandidates) - { - foreach (var node in nodes) - { - AddSyntaxTypeReferences(node, dependencies, semanticModel, namespaceCandidates); - } - } - - private static bool IsPublicApiMember(MemberDeclarationSyntax member) - => member switch - { - EventDeclarationSyntax @event => IsPublic(@event.Modifiers) || IsImplicitPublicInterfaceMember(@event), - EventFieldDeclarationSyntax @event => IsPublic(@event.Modifiers) || IsImplicitPublicInterfaceMember(@event), - BaseFieldDeclarationSyntax field => IsPublic(field.Modifiers) || IsImplicitPublicInterfaceMember(field), - BaseMethodDeclarationSyntax method => IsPublic(method.Modifiers) || IsImplicitPublicInterfaceMember(method), - BasePropertyDeclarationSyntax property => IsPublic(property.Modifiers) || IsImplicitPublicInterfaceMember(property), - DelegateDeclarationSyntax @delegate => IsPublic(@delegate.Modifiers) || IsImplicitPublicInterfaceMember(@delegate), - BaseTypeDeclarationSyntax type => IsPublic(type.Modifiers) || IsImplicitPublicInterfaceMember(type), - _ => false - }; - - private static bool IsPublic(SyntaxTokenList modifiers) - => modifiers.Any(static modifier => - modifier.IsKind(SyntaxKind.PublicKeyword) || - modifier.IsKind(SyntaxKind.ProtectedKeyword)); - - private static bool IsImplicitPublicInterfaceMember(MemberDeclarationSyntax member) - => member.Parent is InterfaceDeclarationSyntax && - !member.Modifiers.Any(static modifier => - modifier.IsKind(SyntaxKind.PrivateKeyword) || - modifier.IsKind(SyntaxKind.InternalKeyword)); - - private static bool IsGeneratedSourceFile(string filePath) => - filePath.Contains("/Generated/", StringComparison.Ordinal) || - filePath.Contains("\\Generated\\", StringComparison.Ordinal); - - private static CSharpType CreateUnresolvedDependencyType(string name, int genericArgumentCount = 0) - => new( - name, - string.Empty, - isValueType: false, - isNullable: false, - declaringType: null, - args: [.. Enumerable.Range(0, genericArgumentCount).Select(static _ => CreateUnresolvedDependencyType(string.Empty))], - isPublic: false, - isStruct: false); - - private static void AddSyntaxTypeReference(TypeSyntax type, HashSet dependencies, SemanticModel semanticModel, IReadOnlyList namespaceCandidates) - { - if (TryAddSemanticTypeReference(type, dependencies, semanticModel)) - { - return; - } - - if (!IsSyntacticTypeReference(type)) - { - return; - } - - switch (type) - { - case IdentifierNameSyntax identifier: - AddUnresolvedDependencyType(dependencies, identifier.Identifier.ValueText, namespaceCandidates); - break; - case GenericNameSyntax genericName: - AddUnresolvedDependencyType(dependencies, genericName.Identifier.ValueText, namespaceCandidates, genericName.TypeArgumentList.Arguments.Count); - foreach (var argument in genericName.TypeArgumentList.Arguments) - { - AddSyntaxTypeReference(argument, dependencies, semanticModel, namespaceCandidates); - } - break; - case QualifiedNameSyntax qualifiedName: - AddQualifiedUnresolvedDependencyType(dependencies, qualifiedName); - AddSyntaxTypeReference(qualifiedName.Right, dependencies, semanticModel, namespaceCandidates); - break; - case AliasQualifiedNameSyntax aliasQualifiedName: - AddSyntaxTypeReference(aliasQualifiedName.Name, dependencies, semanticModel, namespaceCandidates); - break; - case ArrayTypeSyntax arrayType: - AddSyntaxTypeReference(arrayType.ElementType, dependencies, semanticModel, namespaceCandidates); - break; - case NullableTypeSyntax nullableType: - AddSyntaxTypeReference(nullableType.ElementType, dependencies, semanticModel, namespaceCandidates); - break; - case PointerTypeSyntax pointerType: - AddSyntaxTypeReference(pointerType.ElementType, dependencies, semanticModel, namespaceCandidates); - break; - case TupleTypeSyntax tupleType: - foreach (var element in tupleType.Elements) - { - AddSyntaxTypeReference(element.Type, dependencies, semanticModel, namespaceCandidates); - } - break; - } - } - - private static bool TryAddSemanticTypeReference(TypeSyntax type, HashSet dependencies, SemanticModel semanticModel) - { - var typeSymbol = semanticModel.GetTypeInfo(type).Type ?? - semanticModel.GetTypeInfo(type).ConvertedType ?? - (semanticModel.GetSymbolInfo(type).Symbol as INamedTypeSymbol); - if (typeSymbol is not INamedTypeSymbol namedTypeSymbol || - namedTypeSymbol.TypeKind == TypeKind.Error || - namedTypeSymbol.SpecialType == SpecialType.System_Void) - { - return false; - } - - dependencies.Add(namedTypeSymbol.GetCSharpType()); - return true; - } - - private static void AddUnresolvedDependencyType(HashSet dependencies, string name, IReadOnlyList namespaceCandidates, int genericArgumentCount = 0) - { - if (string.Equals(name, "var", StringComparison.Ordinal) || - string.Equals(name, "dynamic", StringComparison.Ordinal)) - { - return; - } - - dependencies.Add(CreateUnresolvedDependencyType(name, genericArgumentCount)); - foreach (var ns in namespaceCandidates) - { - dependencies.Add(CreateDependencyType(name, ns, genericArgumentCount)); - } - } - - private static void AddQualifiedUnresolvedDependencyType(HashSet dependencies, QualifiedNameSyntax qualifiedName) - { - var fullName = qualifiedName.ToString(); - var lastDot = fullName.LastIndexOf('.'); - if (lastDot <= 0 || lastDot == fullName.Length - 1) - { - return; - } - - dependencies.Add(CreateDependencyType(fullName.Substring(lastDot + 1), fullName.Substring(0, lastDot))); - } - - private static CSharpType CreateDependencyType(string name, string ns, int genericArgumentCount = 0) - => new( - name, - ns, - isValueType: false, - isNullable: false, - declaringType: null, - args: [.. Enumerable.Range(0, genericArgumentCount).Select(static _ => CreateUnresolvedDependencyType(string.Empty))], - isPublic: false, - isStruct: false); - - private static IReadOnlyList GetNamespaceCandidates(SyntaxNode node) - { - var namespaces = new HashSet(StringComparer.Ordinal); - for (var current = node; current != null; current = current.Parent) - { - switch (current) - { - case BaseNamespaceDeclarationSyntax namespaceDeclaration: - namespaces.Add(namespaceDeclaration.Name.ToString()); - break; - } - } - - if (node.SyntaxTree.GetRoot() is CompilationUnitSyntax compilationUnit) - { - foreach (var usingDirective in compilationUnit.Usings) - { - if (usingDirective.Alias == null && !usingDirective.StaticKeyword.IsKind(SyntaxKind.StaticKeyword) && usingDirective.Name != null) - { - namespaces.Add(usingDirective.Name.ToString()); - } - } - } - - return [.. namespaces]; - } - - private static bool IsSyntacticTypeReference(TypeSyntax type) - { - var parent = type.Parent; - return parent switch - { - ArrayTypeSyntax arrayType => arrayType.ElementType == type && IsSyntacticTypeReference(arrayType), - NullableTypeSyntax nullableType => nullableType.ElementType == type && IsSyntacticTypeReference(nullableType), - PointerTypeSyntax pointerType => pointerType.ElementType == type && IsSyntacticTypeReference(pointerType), - TupleElementSyntax tupleElement => tupleElement.Type == type, - TypeArgumentListSyntax typeArgumentList => typeArgumentList.Arguments.Contains(type), - QualifiedNameSyntax qualifiedName => qualifiedName.Right == type && IsSyntacticTypeReference(qualifiedName), - AliasQualifiedNameSyntax aliasQualifiedName => aliasQualifiedName.Name == type && IsSyntacticTypeReference(aliasQualifiedName), - SimpleBaseTypeSyntax simpleBaseType => simpleBaseType.Type == type, - ParameterSyntax parameter => parameter.Type == type, - VariableDeclarationSyntax variableDeclaration => variableDeclaration.Type == type, - PropertyDeclarationSyntax property => property.Type == type, - IndexerDeclarationSyntax indexer => indexer.Type == type, - MethodDeclarationSyntax method => method.ReturnType == type, - LocalFunctionStatementSyntax localFunction => localFunction.ReturnType == type, - DelegateDeclarationSyntax @delegate => @delegate.ReturnType == type, - OperatorDeclarationSyntax @operator => @operator.ReturnType == type, - ConversionOperatorDeclarationSyntax conversion => conversion.Type == type, - TypeConstraintSyntax typeConstraint => typeConstraint.Type == type, - ObjectCreationExpressionSyntax objectCreation => objectCreation.Type == type, - MemberAccessExpressionSyntax memberAccess => memberAccess.Expression == type && LooksLikeTypeName(type), - CastExpressionSyntax cast => cast.Type == type, - DefaultExpressionSyntax @default => @default.Type == type, - SizeOfExpressionSyntax sizeOf => sizeOf.Type == type, - TypeOfExpressionSyntax typeOf => typeOf.Type == type, - DeclarationExpressionSyntax declaration => declaration.Type == type, - _ => false - }; - } - - private static bool LooksLikeTypeName(TypeSyntax type) - => type switch - { - IdentifierNameSyntax identifier => IsUppercaseIdentifier(identifier.Identifier.ValueText), - GenericNameSyntax genericName => IsUppercaseIdentifier(genericName.Identifier.ValueText), - QualifiedNameSyntax qualifiedName => LooksLikeTypeName(qualifiedName.Right), - AliasQualifiedNameSyntax aliasQualifiedName => LooksLikeTypeName(aliasQualifiedName.Name), - _ => false - }; - - private static bool IsUppercaseIdentifier(string name) - => name.Length > 0 && char.IsUpper(name[0]); - - private static string? GetInvocationName(InvocationExpressionSyntax invocation) - => invocation.Expression switch - { - IdentifierNameSyntax identifier => identifier.Identifier.ValueText, - MemberAccessExpressionSyntax memberAccess => memberAccess.Name.Identifier.ValueText, - GenericNameSyntax genericName => genericName.Identifier.ValueText, - _ => null - }; - private static bool IsPartialMethodDeclaration(IMethodSymbol methodSymbol) { foreach (var syntaxReference in methodSymbol.DeclaringSyntaxReferences) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs index 31bc0d3fd63..83380c4299b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs @@ -22,7 +22,6 @@ public abstract class TypeProvider private Lazy _lastContractView; private Lazy _canonicalView; private Lazy _specView; - private Lazy _declaringTypeName; private readonly InputType? _inputType; protected TypeProvider(InputType? inputType = default) @@ -31,7 +30,6 @@ protected TypeProvider(InputType? inputType = default) _canonicalView = new(BuildCanonicalView); _lastContractView = new(() => BuildLastContractView()); _specView = new(BuildSpecView); - _declaringTypeName = new(() => GetDeclaringTypeName(DeclaringTypeProvider)); _inputType = inputType; } @@ -46,26 +44,14 @@ protected TypeProvider() : this(null) => CodeModelGenerator.Instance.SourceInputModel.FindForTypeInCustomization( generatedTypeNamespace ?? BuildNamespace(), generatedTypeName ?? BuildName(), - _declaringTypeName.Value); + // Use the Type.Name so that any customizations to the declaring type are applied for the lookup. + DeclaringTypeProvider?.Type.Name); private protected virtual TypeProvider? BuildLastContractView(string? generatedTypeName = null, string? generatedTypeNamespace = null) => CodeModelGenerator.Instance.SourceInputModel.FindForTypeInLastContract( generatedTypeNamespace ?? CustomCodeView?.Type.Namespace ?? BuildNamespace(), generatedTypeName ?? CustomCodeView?.Name ?? BuildName(), - _declaringTypeName.Value); - - private static string? GetDeclaringTypeName(TypeProvider? declaringTypeProvider) - { - if (declaringTypeProvider is null) - { - return null; - } - - var parentName = GetDeclaringTypeName(declaringTypeProvider.DeclaringTypeProvider); - return parentName is null - ? declaringTypeProvider.Type.Name - : $"{parentName}+{declaringTypeProvider.Type.Name}"; - } + DeclaringTypeProvider?.Type.Name); private protected virtual TypeProvider BuildSpecView() => new SpecTypeProvider(this); @@ -157,17 +143,6 @@ public XmlDocProvider XmlDocs private set => _xmlDocs = value; } - internal bool PreserveTypeXmlDocs { get; private set; } - - protected internal virtual bool ShouldWriteTypeXmlDocs => false; - - protected internal virtual bool IsClientProvider => false; - - internal void PreserveXmlDocs() - { - PreserveTypeXmlDocs = true; - } - public string? Deprecated { get => _deprecated; @@ -325,21 +300,7 @@ private IReadOnlyList ApplyCustomizationFilter(IEnumerable? _serializationProviders; - public IReadOnlyList SerializationProviders => _serializationProviders ??= BuildSerializationProvidersInternal(); - - internal TypeProvider? SerializationProviderOwner { get; private set; } - - private IReadOnlyList? _helperDependencyTypes; - internal IReadOnlyList HelperDependencyTypes => _helperDependencyTypes ??= BuildHelperDependencyTypes(); - protected internal virtual IReadOnlyList BuildHelperDependencyTypes() => []; - - private IReadOnlyList? _bodyDependencyTypes; - public IReadOnlyList BodyDependencyTypes => _bodyDependencyTypes ??= BuildBodyDependencyTypes(); - protected internal virtual IReadOnlyList BuildBodyDependencyTypes() => []; - - private IReadOnlyList? _signatureDependencyTypes; - public IReadOnlyList SignatureDependencyTypes => _signatureDependencyTypes ??= BuildSignatureDependencyTypes(); - protected internal virtual IReadOnlyList BuildSignatureDependencyTypes() => []; + public IReadOnlyList SerializationProviders => _serializationProviders ??= BuildSerializationProviders(); private IReadOnlyList? _attributes; @@ -362,31 +323,6 @@ public IReadOnlyList Attributes internal IReadOnlyList GetAttributes() => _attributes ??= BuildAttributes(); - internal IReadOnlyList GetAttributesForWrite() => BuildAttributesForWrite(); - - /// - /// Builds the attributes emitted by the writer. Providers whose generated attributes depend on final - /// generation decisions can override this without replacing attributes updated by visitors. - /// - protected internal virtual IReadOnlyList BuildAttributesForWrite() => GetAttributes(); - - /// - /// Indicates whether this provider's attributes should contribute to reference-map analysis. - /// - protected internal virtual bool ShouldAnalyzeAttributesInReferenceMap => true; - - /// - /// Determines whether a provider remains in the generated output after reference-map analysis. - /// - protected static bool ShouldWriteProvider(TypeProvider provider) => - ProviderReferenceMapAnalyzer.ShouldWriteProvider(provider); - - /// - /// Determines whether a type remains resolvable after reference-map analysis. - /// - protected static bool IsResolvableBuildableType(CSharpType type) => - ProviderReferenceMapAnalyzer.IsResolvableBuildableType(type); - protected virtual CSharpType[] GetTypeArguments() => []; internal PropertyProvider[] FilterCustomizedProperties(IEnumerable specProperties) @@ -569,20 +505,6 @@ private TypeProvider[] BuildNestedTypesInternal() protected virtual TypeProvider[] BuildSerializationProviders() => []; - private IReadOnlyList BuildSerializationProvidersInternal() - => AssignSerializationProviderOwners(BuildSerializationProviders()); - - private IReadOnlyList AssignSerializationProviderOwners(IEnumerable serializationProviders) - { - var providers = (serializationProviders as IReadOnlyList) ?? [.. serializationProviders]; - foreach (var serializationProvider in providers) - { - serializationProvider.SerializationProviderOwner = this; - } - - return providers; - } - protected virtual CSharpType BuildEnumUnderlyingType() => throw new InvalidOperationException("Not an EnumProvider type"); protected virtual IReadOnlyList BuildAttributes() => []; @@ -626,10 +548,8 @@ public virtual void Reset() _serializationProviders = null; _nestedTypes = null; _xmlDocs = null; - PreserveTypeXmlDocs = false; _declarationModifiers = null; _relativeFilePath = null; - _declaringTypeName = new(() => GetDeclaringTypeName(DeclaringTypeProvider)); _customCodeView = new(() => BuildCustomCodeView()); _canonicalView = new(BuildCanonicalView); _lastContractView = new(() => BuildLastContractView()); @@ -702,7 +622,7 @@ public void Update( } if (serializations != null) { - _serializationProviders = AssignSerializationProviderOwners(serializations); + _serializationProviders = (serializations as IReadOnlyList) ?? serializations.ToList(); } if (nestedTypes != null) { @@ -722,7 +642,7 @@ public void Update( } if (attributes != null) { - _attributes = [.. attributes]; + _attributes = (attributes as IReadOnlyList) ?? [.. attributes]; } if (name != null) @@ -741,7 +661,6 @@ public void Update( private void ResetMembersBasedOnIdentityChange(string? name = null, string? @namespace = null) { - _declaringTypeName = new(() => GetDeclaringTypeName(DeclaringTypeProvider)); // Reset the custom code view to reflect the new namespace _customCodeView = new(BuildCustomCodeView(name ?? Type.Name, @namespace ?? Type.Namespace)); name = _customCodeView.Value?.Name ?? name ?? Type.Name; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs deleted file mode 100644 index 8ece3a31fa3..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.BodyReferences.cs +++ /dev/null @@ -1,609 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Microsoft.TypeSpec.Generator.Expressions; -using Microsoft.TypeSpec.Generator.Primitives; -using Microsoft.TypeSpec.Generator.Providers; -using Microsoft.TypeSpec.Generator.Snippets; -using Microsoft.TypeSpec.Generator.Statements; - -namespace Microsoft.TypeSpec.Generator -{ - internal static partial class ProviderReferenceMapAnalyzer - { - private static void AddGeneratedBodyReferences(IReadOnlyList providers, ProviderReferenceGraph graph) - { - var generatedProviders = GetGeneratedProviders(providers); - var serializationProviderNamesByType = GetSerializationProviderNamesByType(generatedProviders); - foreach (var (provider, isSerializationProvider) in GetBodyReferenceProviders(providers)) - { - if (IsModelFactoryProvider(provider) || - !IsGeneratedBodyReferenceCandidate(provider, isSerializationProvider)) - { - continue; - } - - var providerName = GetProviderTypeName(provider.Type); - if (!graph.Nodes.Contains(providerName)) - { - continue; - } - - var bodyReferences = CollectStructuredBodyReferences(provider); - AddStructuredBodyReferenceTypes( - graph.References[providerName], - provider, - bodyReferences.Types, - graph.Nodes, - serializationProviderNamesByType); - AddExtensionMethodProviderReferences( - graph.References[providerName], - bodyReferences.ExtensionMethods, - generatedProviders, - graph.Nodes); - AddProviderBodyDependencyTypes(graph.References[providerName], provider.BodyDependencyTypes, graph.Nodes); - AddGeneratedProviderNamespaceBodyDependencyTypes(graph.References[providerName], provider, graph.Nodes); - } - } - - private static void AddGeneratedProviderNamespaceBodyDependencyTypes(HashSet references, TypeProvider provider, HashSet nodes) - { - var providerNamespace = provider.Type.Namespace; - if (string.IsNullOrEmpty(providerNamespace)) - { - return; - } - - foreach (var dependency in provider.BodyDependencyTypes) - { - AddGeneratedProviderNamespaceBodyDependencyType(references, dependency, providerNamespace, nodes); - } - } - - private static void AddGeneratedProviderNamespaceBodyDependencyType(HashSet references, CSharpType? dependency, string providerNamespace, HashSet nodes) - { - if (dependency == null) - { - return; - } - - AddNamespaceBodyDependencyName(references, providerNamespace, dependency, nodes); - foreach (var argument in dependency.Arguments) - { - AddGeneratedProviderNamespaceBodyDependencyType(references, argument, providerNamespace, nodes); - } - } - - private static void AddNamespaceBodyDependencyName(HashSet references, string providerNamespace, CSharpType dependency, HashSet nodes) - { - var dependencyName = GetSimpleName(GetProviderTypeName(dependency)); - AddExactMetadataNameMatch(references, $"{providerNamespace}.{dependencyName}", nodes); - var aritylessDependencyName = StripGenericArity(dependencyName); - if (!string.Equals(aritylessDependencyName, dependencyName, StringComparison.Ordinal)) - { - AddExactMetadataNameMatch(references, $"{providerNamespace}.{aritylessDependencyName}", nodes); - } - } - - private static void AddStructuredBodyReferenceTypes( - HashSet references, - TypeProvider provider, - IReadOnlyList dependencies, - HashSet nodes, - IReadOnlyDictionary serializationProviderNamesByType) - { - foreach (var dependency in dependencies) - { - if (!IsEnumProviderDependency(dependency, nodes)) - { - AddTypeReference( - references, - dependency, - nodes, - serializationProviderNamesByType, - provider.Type.Namespace); - } - } - } - - private static StructuredBodyReferences CollectStructuredBodyReferences(TypeProvider provider) - { - var references = new HashSet(); - var extensionMethods = new HashSet(); - var visited = new HashSet(ReferenceEqualityComparer.Instance); - - foreach (var field in provider.Fields) - { - CollectStructuredBodyReferences(field.InitializationValue, references, extensionMethods, visited); - } - - foreach (var property in provider.Properties) - { - CollectStructuredBodyReferences(property.Body, references, extensionMethods, visited); - } - - foreach (var constructor in provider.Constructors) - { - CollectStructuredBodyReferences(constructor.BodyExpression, references, extensionMethods, visited); - CollectStructuredBodyReferences(constructor.BodyStatements, references, extensionMethods, visited); - } - - foreach (var method in provider.Methods) - { - if (method.IsMethodSuppressed()) - { - continue; - } - - CollectStructuredBodyReferences(method.BodyExpression, references, extensionMethods, visited); - CollectStructuredBodyReferences(method.BodyStatements, references, extensionMethods, visited); - } - - return new([.. references], [.. extensionMethods]); - } - - private static void CollectStructuredBodyReferences( - object? value, - HashSet references, - HashSet extensionMethods, - HashSet visited) - { - switch (value) - { - case null: - case string: - case FormattableString: - return; - } - - if (!value.GetType().IsValueType && !visited.Add(value)) - { - return; - } - - if (value is InvokeMethodExpression { ExtensionType: null, MethodName: { } methodName } invocation) - { - var receiverType = GetExpressionType(invocation.InstanceReference); - if (receiverType != null) - { - extensionMethods.Add(new(methodName, receiverType)); - } - } - - switch (value) - { - case CSharpType type: - references.Add(type); - return; - case Type type: - references.Add(type); - return; - case ParameterProvider parameter: - references.Add(parameter.Type); - CollectStructuredBodyReferences(parameter.DefaultValue, references, extensionMethods, visited); - CollectStructuredBodyReferences(parameter.InitializationValue, references, extensionMethods, visited); - return; - case MethodSignatureBase signature: - CollectStructuredBodyReferences(signature.ReturnType, references, extensionMethods, visited); - CollectStructuredBodyReferences(signature.Parameters, references, extensionMethods, visited); - return; - case KeyValuePair positionalArgument: - CollectStructuredBodyReferences(positionalArgument.Value, references, extensionMethods, visited); - return; - case FieldProvider field: - references.Add(field.Type); - CollectStructuredBodyReferences(field.InitializationValue, references, extensionMethods, visited); - return; - } - - if (IsStructuredBodyReferenceObject(value)) - { - foreach (var property in value.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) - { - if (property.GetIndexParameters().Length > 0) - { - continue; - } - - CollectStructuredBodyReferences(property.GetValue(value), references, extensionMethods, visited); - } - - return; - } - - if (value is not IEnumerable values) - { - return; - } - - foreach (var item in values) - { - CollectStructuredBodyReferences(item, references, extensionMethods, visited); - } - } - - private static CSharpType? GetExpressionType(ValueExpression? expression) => - expression switch - { - VariableExpression variable => variable.Type, - ScopedApi scopedApi => scopedApi.Type, - _ => null - }; - - private static void AddExtensionMethodProviderReferences( - HashSet references, - IReadOnlyList extensionMethods, - IReadOnlyList generatedProviders, - HashSet nodes) - { - foreach (var extensionMethod in extensionMethods) - { - var provider = FindUniqueExtensionMethodProvider(extensionMethod, generatedProviders); - if (provider != null) - { - AddTypeReference(references, provider.Type, nodes); - } - } - } - - private static TypeProvider? FindUniqueExtensionMethodProvider( - ExtensionMethodReference extensionMethod, - IReadOnlyList generatedProviders) - { - TypeProvider? match = null; - foreach (var provider in generatedProviders) - { - if (!provider.Methods.Any(method => IsMatchingExtensionMethod(method.Signature, extensionMethod))) - { - continue; - } - - if (match != null) - { - return null; - } - - match = provider; - } - - return match; - } - - private static bool IsMatchingExtensionMethod(MethodSignature signature, ExtensionMethodReference extensionMethod) - { - if (!signature.Modifiers.HasFlag(MethodSignatureModifiers.Extension) || - !string.Equals(signature.Name, extensionMethod.Name, StringComparison.Ordinal)) - { - return false; - } - - return extensionMethod.ReceiverType == null || - signature.Parameters.Count > 0 && - string.Equals( - GetProviderTypeName(signature.Parameters[0].Type), - GetProviderTypeName(extensionMethod.ReceiverType), - StringComparison.Ordinal); - } - - private readonly record struct StructuredBodyReferences( - IReadOnlyList Types, - IReadOnlyList ExtensionMethods); - - private readonly record struct ExtensionMethodReference(string Name, CSharpType? ReceiverType); - - private static bool IsEnumProviderDependency(CSharpType dependency, HashSet nodes) - { - var providerName = GetProviderTypeName(dependency); - if (!nodes.Contains(providerName)) - { - return false; - } - - foreach (var provider in CodeModelGenerator.Instance.OutputLibrary.TypeProviders) - { - if (provider is EnumProvider && - string.Equals(GetProviderTypeName(provider.Type), providerName, StringComparison.Ordinal)) - { - return true; - } - } - - return false; - } - - private static bool IsStructuredBodyReferenceObject(object value) => - value is ValueExpression || - value is MethodBodyStatement || - value is PropertyBody; - - private static void AddProviderBodyDependencyTypes( - HashSet references, - IReadOnlyList dependencies, - HashSet nodes, - bool includeSimpleNameReferences = false, - bool includeUnqualifiedSimpleNameReferences = false) - { - foreach (var dependency in dependencies) - { - AddProviderBodyDependencyType(references, dependency, nodes, includeSimpleNameReferences, includeUnqualifiedSimpleNameReferences); - } - } - - private static void AddProviderBodyDependencyType( - HashSet references, - CSharpType? dependency, - HashSet nodes, - bool includeSimpleNameReferences, - bool includeUnqualifiedSimpleNameReferences) - { - if (dependency == null) - { - return; - } - - AddTypeReference(references, dependency, nodes); - if (includeSimpleNameReferences && - !string.IsNullOrEmpty(dependency.Namespace) && - dependency.Arguments.Count == 0) - { - AddMatchingName(references, dependency.Name, nodes); - } - else if (includeUnqualifiedSimpleNameReferences && - string.IsNullOrEmpty(dependency.Namespace) && - dependency.Arguments.Count == 0) - { - AddUnambiguousMatchingName(references, dependency.Name, nodes); - } - foreach (var argument in dependency.Arguments) - { - AddProviderBodyDependencyType(references, argument, nodes, includeSimpleNameReferences, includeUnqualifiedSimpleNameReferences); - } - } - - private static IReadOnlyList<(TypeProvider Provider, bool IsSerializationProvider)> GetBodyReferenceProviders(IReadOnlyList providers) - { - var bodyReferenceProviders = new List<(TypeProvider Provider, bool IsSerializationProvider)>(); - foreach (var provider in providers) - { - bodyReferenceProviders.Add((provider, false)); - foreach (var serializationProvider in provider.SerializationProviders) - { - bodyReferenceProviders.Add((serializationProvider, true)); - } - } - - return bodyReferenceProviders; - } - - private static bool IsGeneratedBodyReferenceCandidate(TypeProvider provider, bool isSerializationProvider) - { - return IsGeneratedImplementationBodyReferenceCandidate(provider, isSerializationProvider) || - provider.HelperDependencyTypes.Count > 0 || - provider.BodyDependencyTypes.Count > 0; - } - - private static bool IsGeneratedImplementationBodyReferenceCandidate(TypeProvider provider, bool isSerializationProvider) - { - if (provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Static) || - provider.IsClientProvider || - isSerializationProvider) - { - return true; - } - - return provider is not ModelProvider && - provider is not EnumProvider && - !IsModelFactoryProvider(provider) && - provider.DeclaringTypeProvider == null && - provider.SerializationProviders.Count == 0; - } - - private static void AddSignatureReferences( - HashSet references, - MethodSignatureBase signature, - HashSet nodes, - IReadOnlyDictionary? serializationProviderNamesByType, - bool includeAttributes = true, - bool includeAttributeArguments = true, - string? providerNamespace = null, - string? containingProviderTypeName = null, - IReadOnlySet? contextualTypeExclusions = null) - { - HashSet? signatureTypeExclusions = contextualTypeExclusions == null - ? null - : new(contextualTypeExclusions, StringComparer.Ordinal); - if (signature is MethodSignature { GenericArguments: not null } genericMethodSignature) - { - signatureTypeExclusions ??= new(StringComparer.Ordinal); - signatureTypeExclusions.UnionWith(genericMethodSignature.GenericArguments.Select(argument => argument.Name)); - } - - AddTypeReference(references, signature.ReturnType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); - if (includeAttributes) - { - AddAttributes(references, signature.Attributes, nodes, serializationProviderNamesByType, includeAttributeArguments); - } - - foreach (var parameter in signature.Parameters) - { - AddTypeReference(references, parameter.Type, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); - if (includeAttributes) - { - AddAttributes(references, parameter.Attributes, nodes, serializationProviderNamesByType, includeAttributeArguments); - } - } - - if (signature is MethodSignature methodSignature) - { - AddTypeReference(references, methodSignature.ExplicitInterface, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); - if (methodSignature.GenericArguments != null) - { - foreach (var genericArgument in methodSignature.GenericArguments) - { - AddTypeReference(references, genericArgument, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); - } - } - - if (methodSignature.GenericParameterConstraints != null) - { - foreach (var constraint in methodSignature.GenericParameterConstraints) - { - AddTypeReference(references, constraint.Type, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); - } - } - } - - if (signature is ConstructorSignature constructorSignature) - { - AddTypeReference(references, constructorSignature.Type, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, signatureTypeExclusions); - } - } - - private static void AddAttributes( - HashSet references, - IReadOnlyList attributes, - HashSet nodes, - IReadOnlyDictionary? serializationProviderNamesByType, - bool includeArguments) - { - foreach (var attribute in attributes) - { - AddTypeReference(references, attribute.Type, nodes, serializationProviderNamesByType); - if (!includeArguments) - { - continue; - } - - foreach (var argument in attribute.Arguments) - { - AddAttributeArgumentReference(references, argument, nodes, serializationProviderNamesByType); - } - - foreach (var (_, argument) in attribute.PositionalArguments) - { - AddAttributeArgumentReference(references, argument, nodes, serializationProviderNamesByType); - } - } - } - - private static bool IsAttributeNamed(AttributeStatement attribute, string name) - => string.Equals(attribute.Type.Name, name, StringComparison.Ordinal) || - string.Equals(attribute.Type.Name, $"{name}Attribute", StringComparison.Ordinal); - - private static void AddAttributeArgumentReference( - HashSet references, - ValueExpression argument, - HashSet nodes, - IReadOnlyDictionary? serializationProviderNamesByType) - { - if (argument is TypeOfExpression typeOf) - { - AddTypeReference(references, typeOf.Type, nodes, serializationProviderNamesByType); - AddMatchingName(references, typeOf.Type.Name, nodes); - } - } - - private static void AddTypeReference( - HashSet references, - CSharpType? type, - HashSet nodes, - IReadOnlyDictionary? serializationProviderNamesByType = null, - string? providerNamespace = null, - string? containingProviderTypeName = null, - IReadOnlySet? contextualTypeExclusions = null) - { - if (type == null) - { - return; - } - - if (type.IsArray) - { - AddTypeReference(references, type.ElementType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); - return; - } - - var providerTypeName = GetProviderTypeName(type); - var matchedContainingType = string.IsNullOrEmpty(type.Namespace) && - contextualTypeExclusions?.Contains(type.Name) != true && - !string.IsNullOrEmpty(containingProviderTypeName) && - AddExactMetadataNameMatch(references, $"{containingProviderTypeName}.{providerTypeName}", nodes); - if (!matchedContainingType && nodes.Contains(providerTypeName)) - { - references.Add(providerTypeName); - } - - if (serializationProviderNamesByType != null && - serializationProviderNamesByType.TryGetValue(providerTypeName, out var serializationProviderNames)) - { - foreach (var serializationProviderName in serializationProviderNames) - { - references.Add(serializationProviderName); - } - } - else if (!matchedContainingType && - !nodes.Contains(providerTypeName) && - string.IsNullOrEmpty(type.Namespace) && - !string.IsNullOrEmpty(providerNamespace)) - { - AddExactMetadataNameMatch(references, $"{providerNamespace}.{providerTypeName}", nodes); - } - - AddTypeReference(references, type.BaseType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); - AddTypeReference(references, type.DeclaringType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); - if (type.IsUnion) - { - foreach (var unionItemType in type.UnionItemTypes) - { - AddTypeReference(references, unionItemType, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); - } - } - foreach (var argument in type.Arguments) - { - AddTypeReference(references, argument, nodes, serializationProviderNamesByType, providerNamespace, containingProviderTypeName, contextualTypeExclusions); - } - } - - private static string GetSimpleName(string fullyQualifiedName) - { - var lastDot = fullyQualifiedName.LastIndexOf('.'); - return lastDot < 0 ? fullyQualifiedName : fullyQualifiedName.Substring(lastDot + 1); - } - - private static string? GetNamespaceName(string fullyQualifiedName) - { - var lastDot = fullyQualifiedName.LastIndexOf('.'); - return lastDot < 0 ? null : fullyQualifiedName.Substring(0, lastDot); - } - - private static string GetProviderTypeName(CSharpType type) - { - var name = type.Arguments.Count > 0 && !type.Name.Contains('`', StringComparison.Ordinal) - ? $"{type.Name}`{type.Arguments.Count}" - : type.Name; - if (type.DeclaringType is { } declaringType) - { - return $"{GetProviderTypeName(declaringType)}.{name}"; - } - - return string.IsNullOrEmpty(type.Namespace) ? name : $"{type.Namespace}.{name}"; - } - - private static string StripGenericArity(string name) - { - var tick = name.IndexOf('`'); - var typeArgumentStart = name.IndexOf('<'); - var genericSuffixStart = tick < 0 - ? typeArgumentStart - : typeArgumentStart < 0 - ? tick - : Math.Min(tick, typeArgumentStart); - return genericSuffixStart < 0 ? name : name.Substring(0, genericSuffixStart); - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs deleted file mode 100644 index 622aa980a89..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Candidates.cs +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.TypeSpec.Generator.Primitives; -using Microsoft.TypeSpec.Generator.Providers; - -namespace Microsoft.TypeSpec.Generator -{ - internal static partial class ProviderReferenceMapAnalyzer - { - private static HashSet GetCustomInternalBoundaryNodes( - ProviderReferenceGraph publicGraph, - HashSet customInternalDeclarations) - { - var boundaryNodes = new HashSet(StringComparer.Ordinal); - foreach (var node in publicGraph.Nodes) - { - if (!publicGraph.References.TryGetValue(node, out var references)) - { - continue; - } - - if (references.Overlaps(customInternalDeclarations)) - { - boundaryNodes.Add(node); - } - } - - return boundaryNodes; - } - - private static HashSet GetPublicDeclaredNodes( - IReadOnlyList generatedProviders, - HashSet nodes) - { - return GetGeneratedDeclaredNodes(generatedProviders, nodes, publicOnly: false); - } - - private static HashSet GetPublicApiTraversalNodes( - HashSet internalizeDeclaredNodes, - HashSet publicDeclaredNodes, - HashSet generatedInternalDeclarations, - HashSet generatedImplementationInternalDeclarations) - { - var traversalNodes = new HashSet(StringComparer.Ordinal); - foreach (var node in internalizeDeclaredNodes) - { - if (generatedInternalDeclarations.Contains(node) || - generatedImplementationInternalDeclarations.Contains(node)) - { - continue; - } - - traversalNodes.Add(node); - } - - foreach (var node in publicDeclaredNodes) - { - if (!generatedInternalDeclarations.Contains(node) && - !generatedImplementationInternalDeclarations.Contains(node)) - { - traversalNodes.Add(node); - } - } - - return traversalNodes; - } - - private static HashSet GetInternalizeCandidates( - HashSet internalizeDeclaredNodes, - HashSet publicReachable, - HashSet customInternalDeclarations, - HashSet generatedInternalDeclarations, - HashSet customInternalBoundaryNodes, - HashSet customPublicRoots, - HashSet publicRoots, - HashSet nodes, - IReadOnlyDictionary> references) - { - var candidates = new HashSet(StringComparer.Ordinal); - foreach (var node in internalizeDeclaredNodes) - { - var isNonRootKept = IsKeptName(node, CodeModelGenerator.Instance.NonRootTypes, nodes); - var isPublicReachableNonRootKept = isNonRootKept && publicReachable.Contains(node); - if (!publicReachable.Contains(node) || - customInternalDeclarations.Contains(node) || - generatedInternalDeclarations.Contains(node) && !customPublicRoots.Contains(node) && !isPublicReachableNonRootKept || - customInternalBoundaryNodes.Contains(node) && (!publicRoots.Contains(node) || isNonRootKept) || - isNonRootKept && - references.TryGetValue(node, out var nodeReferences) && - (nodeReferences.Overlaps(customInternalDeclarations) || - nodeReferences.Overlaps(generatedInternalDeclarations))) - { - candidates.Add(node); - } - } - - // If a public non-root type exposes something that must remain internal, make the - // exposing type internal too. That avoids generating public APIs with internal types. - var addedCandidate = true; - while (addedCandidate) - { - addedCandidate = false; - foreach (var node in internalizeDeclaredNodes) - { - var isNonRootKept = IsKeptName(node, CodeModelGenerator.Instance.NonRootTypes, nodes); - if (candidates.Contains(node) || - publicRoots.Contains(node) && !isNonRootKept || - !references.TryGetValue(node, out var nodeReferences) || - !nodeReferences.Overlaps(candidates)) - { - continue; - } - - candidates.Add(node); - addedCandidate = true; - } - } - - // Non-root keep entries preserve the declared type/file, but deliberately do not - // root their dependencies. They can still be internalized when needed to avoid - // exposing custom/internal types through a public surface. - RemoveKeptNonRootNames(candidates, nodes, references, customInternalDeclarations, generatedInternalDeclarations, customInternalBoundaryNodes); - return candidates; - } - - private static void RemovePublicApiExposedCandidates( - HashSet internalizeDeclaredNodes, - HashSet candidates, - HashSet customInternalDeclarations, - IReadOnlyDictionary> references) - { - var removedCandidate = true; - while (removedCandidate) - { - removedCandidate = false; - foreach (var candidate in candidates.ToArray()) - { - if (customInternalDeclarations.Contains(candidate)) - { - continue; - } - - foreach (var node in internalizeDeclaredNodes) - { - if (candidates.Contains(node) || - !references.TryGetValue(node, out var nodeReferences) || - !nodeReferences.Contains(candidate)) - { - continue; - } - - candidates.Remove(candidate); - removedCandidate = true; - break; - } - } - } - } - - private static void AddNestedInternalizeCandidates( - IReadOnlyList generatedProviders, - HashSet candidates, - HashSet nodes) - { - var addedCandidate = true; - while (addedCandidate) - { - addedCandidate = false; - foreach (var provider in generatedProviders) - { - var declaringType = provider.DeclaringTypeProvider?.Type; - if (declaringType == null || - !candidates.Contains(GetProviderTypeName(declaringType))) - { - continue; - } - - var providerName = GetProviderTypeName(provider.Type); - if (nodes.Contains(providerName) && candidates.Add(providerName)) - { - addedCandidate = true; - } - } - } - } - - /// - /// Internalizes dependencies whose generated predecessors are all internal, unless the dependency - /// is an explicit public root. Repeats until transitive internal-only dependencies are included. - /// - private static void AddInternalOnlyDependencyCandidates( - HashSet internalizeDeclaredNodes, - HashSet candidates, - HashSet customInternalDeclarations, - HashSet generatedInternalDeclarations, - HashSet explicitPublicRoots, - IReadOnlyDictionary> references, - HashSet generatedImplementationInternalDeclarations) - { - var addedCandidate = true; - while (addedCandidate) - { - addedCandidate = false; - foreach (var node in internalizeDeclaredNodes) - { - if (candidates.Contains(node) || explicitPublicRoots.Contains(node)) - { - continue; - } - - var hasPredecessor = false; - var allPredecessorsInternalized = true; - foreach (var (owner, children) in references) - { - if (string.Equals(owner, node, StringComparison.Ordinal) || - generatedImplementationInternalDeclarations.Contains(owner) || - !children.Contains(node)) - { - continue; - } - - hasPredecessor = true; - if (!candidates.Contains(owner) && - !customInternalDeclarations.Contains(owner) && - !generatedInternalDeclarations.Contains(owner)) - { - allPredecessorsInternalized = false; - break; - } - } - - if (hasPredecessor && allPredecessorsInternalized && candidates.Add(node)) - { - addedCandidate = true; - } - } - } - } - - /// - /// Finds generated declarations that must be promoted to public because they are exposed by a - /// reachable public API, while respecting explicit internal boundaries and helper-only roots. - /// - private static HashSet GetPublicCandidates( - HashSet publicDeclaredNodes, - HashSet publicReachable, - HashSet customInternalDeclarations, - HashSet customInternalBoundaryNodes, - HashSet internalizeHelperRoots, - HashSet publicRootExclusions, - HashSet generatedInternalDeclarations, - HashSet publicRoots, - Dictionary> publicApiReferences, - Dictionary> internalizeReferences, - HashSet generatedImplementationInternalDeclarations) - { - var candidates = new HashSet(StringComparer.Ordinal); - foreach (var node in publicDeclaredNodes) - { - if (customInternalDeclarations.Contains(node) || - customInternalBoundaryNodes.Contains(node) || - internalizeHelperRoots.Contains(node) || - publicRootExclusions.Contains(node) || - !publicReachable.Contains(node)) - { - continue; - } - - if (generatedInternalDeclarations.Contains(node) && - !publicRoots.Contains(node) && - !HasPublicApiPredecessor(node, publicApiReferences, publicReachable, generatedImplementationInternalDeclarations)) - { - continue; - } - - if (!publicRoots.Contains(node) && - !HasPublicApiPredecessor(node, internalizeReferences, publicReachable, generatedInternalDeclarations, generatedImplementationInternalDeclarations)) - { - continue; - } - - candidates.Add(node); - } - - return candidates; - } - - private static HashSet GetRemovalCandidates( - IReadOnlyList providers, - IReadOnlyList generatedProviders, - ProviderReferenceGraph graph, - HashSet customRemovalRoots, - HashSet generatedDiscriminatorBaseNames) - { - var removeRoots = GetRootNames( - providers, - graph.Nodes, - helperRoots: [], - includeModelFactory: true, - includeAdditionalRoots: true, - publicClientRootsOnly: false); - - removeRoots.UnionWith(customRemovalRoots); - AddKeptNonRootNames(removeRoots, graph.Nodes); - - var removeReachableWithoutHelpers = GetReachableTypes(removeRoots, graph.References); - AddDerivedModelReferences(providers, graph.Nodes, graph.References, removeReachableWithoutHelpers, generatedDiscriminatorBaseNames); - removeReachableWithoutHelpers = GetReachableTypes(removeRoots, graph.References); - AddBasePreservedReferences(generatedProviders, graph.Nodes, graph.References, removeReachableWithoutHelpers); - - var removeHelperRoots = GetHelperRootNames(generatedProviders, graph.Nodes, removeReachableWithoutHelpers, graph.References, includeModelSerializationProviders: true); - removeRoots.UnionWith(removeHelperRoots); - - var removeReachable = GetReachableTypes(removeRoots, graph.References); - AddBasePreservedReferences(generatedProviders, graph.Nodes, graph.References, removeReachable); - - var removeDeclaredNodes = GetGeneratedDeclaredNodes(generatedProviders, graph.Nodes, publicOnly: false); - removeDeclaredNodes.ExceptWith(removeReachable); - return removeDeclaredNodes; - } - - private static void AddKeptNonRootNames(HashSet roots, HashSet nodes) - { - var nonRootTypes = CodeModelGenerator.Instance.NonRootTypes; - foreach (var node in nodes) - { - if (IsKeptName(node, nonRootTypes, nodes)) - { - roots.Add(node); - } - } - } - - private static void RemoveKeptNonRootNames( - HashSet candidates, - HashSet nodes, - IReadOnlyDictionary> references, - HashSet customInternalDeclarations, - HashSet generatedInternalDeclarations, - HashSet customInternalBoundaryNodes) - { - var nonRootTypes = CodeModelGenerator.Instance.NonRootTypes; - foreach (var node in nodes) - { - if (customInternalDeclarations.Contains(node) || - generatedInternalDeclarations.Contains(node) || - customInternalBoundaryNodes.Contains(node)) - { - continue; - } - - if (IsKeptName(node, nonRootTypes, nodes) && - !HasCandidateReference(node, candidates, references)) - { - candidates.Remove(node); - } - } - } - - private static bool HasCandidateReference( - string node, - HashSet candidates, - IReadOnlyDictionary> references) - { - if (references.TryGetValue(node, out var nodeReferences)) - { - foreach (var reference in nodeReferences) - { - if (!string.Equals(reference, node, StringComparison.Ordinal) && - candidates.Contains(reference)) - { - return true; - } - } - } - - foreach (var (source, sourceReferences) in references) - { - if (!string.Equals(source, node, StringComparison.Ordinal) && - candidates.Contains(source) && - sourceReferences.Contains(node)) - { - return true; - } - } - - return false; - } - - private static Dictionary> CloneReferences(IReadOnlyDictionary> references) - { - var clone = new Dictionary>(StringComparer.Ordinal); - foreach (var (name, referencedNames) in references) - { - clone.Add(name, new HashSet(referencedNames, StringComparer.Ordinal)); - } - - return clone; - } - - private static void AddDerivedModelReferences( - IReadOnlyList providers, - HashSet nodes, - Dictionary> references, - HashSet publicBaseModels, - HashSet generatedDiscriminatorBaseNames) - { - var modelProviders = new List(); - var discriminatorProviders = new List(); - var discriminatorBaseNames = new HashSet(StringComparer.Ordinal); - foreach (var provider in providers) - { - if (provider is not ModelProvider modelProvider || - !modelProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - continue; - } - - modelProviders.Add(modelProvider); - - if (modelProvider.DiscriminatorProperty != null) - { - discriminatorBaseNames.Add(GetProviderTypeName(modelProvider.Type)); - } - - if (!modelProvider.IsUnknownDiscriminatorModel && - (modelProvider.DiscriminatorProperty != null || modelProvider.DiscriminatorValue != null)) - { - discriminatorProviders.Add(modelProvider); - } - } - - discriminatorBaseNames.UnionWith(generatedDiscriminatorBaseNames); - var addedReference = true; - while (addedReference) - { - addedReference = false; - foreach (var provider in discriminatorProviders) - { - var providerName = GetProviderTypeName(provider.Type); - if (!nodes.Contains(providerName)) - { - continue; - } - - if (!publicBaseModels.Contains(providerName)) - { - continue; - } - - foreach (var derivedModel in provider.DerivedModels) - { - if (derivedModel.IsUnknownDiscriminatorModel || - !derivedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - continue; - } - - var before = references[providerName].Count; - AddTypeReference(references[providerName], derivedModel.Type, nodes); - var derivedName = GetProviderTypeName(derivedModel.Type); - if (nodes.Contains(derivedName) && publicBaseModels.Add(derivedName) || references[providerName].Count != before) - { - addedReference = true; - } - } - } - - foreach (var provider in modelProviders) - { - if (provider.IsUnknownDiscriminatorModel || - !provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - continue; - } - - var providerName = GetProviderTypeName(provider.Type); - if (!nodes.Contains(providerName)) - { - continue; - } - - var baseTypeName = provider.BaseType == null ? null : GetProviderTypeName(provider.BaseType); - if (baseTypeName == null || - !discriminatorBaseNames.Contains(baseTypeName) || - !nodes.Contains(baseTypeName) || - !publicBaseModels.Contains(baseTypeName)) - { - continue; - } - - var before = references[baseTypeName].Count; - references[baseTypeName].Add(providerName); - if (publicBaseModels.Add(providerName) || references[baseTypeName].Count != before) - { - addedReference = true; - } - } - } - } - - private static void AddBasePreservedReferences( - IReadOnlyList providers, - HashSet nodes, - IReadOnlyDictionary> references, - HashSet reachableTypes) - { - var basePreservedRoots = new HashSet(StringComparer.Ordinal); - var addedRoot = true; - while (addedRoot) - { - addedRoot = false; - foreach (var provider in GetGeneratedProviders(providers)) - { - var providerName = GetProviderTypeName(provider.Type); - if (!nodes.Contains(providerName) || reachableTypes.Contains(providerName) || basePreservedRoots.Contains(providerName)) - { - continue; - } - - var baseTypeName = provider.BaseType == null ? null : GetProviderTypeName(provider.BaseType); - if (baseTypeName == null || !reachableTypes.Contains(baseTypeName)) - { - continue; - } - - if (basePreservedRoots.Add(providerName)) - { - addedRoot = true; - } - } - - if (addedRoot) - { - reachableTypes.UnionWith(GetReachableTypes(basePreservedRoots, references)); - } - } - } - - private static IReadOnlyList GetGeneratedProviders(IReadOnlyList providers) - { - var generatedProviders = new List(); - var visited = new HashSet(); - foreach (var provider in providers) - { - AddGeneratedProvider(generatedProviders, visited, provider); - } - - return generatedProviders; - } - - private static void AddGeneratedProvider(List generatedProviders, HashSet visited, TypeProvider provider) - { - if (!visited.Add(provider)) - { - return; - } - - generatedProviders.Add(provider); - foreach (var nestedType in provider.NestedTypes) - { - AddGeneratedProvider(generatedProviders, visited, nestedType); - } - - foreach (var serializationProvider in provider.SerializationProviders) - { - AddGeneratedProvider(generatedProviders, visited, serializationProvider); - } - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs deleted file mode 100644 index ac67a94f7c7..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.Helpers.cs +++ /dev/null @@ -1,915 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.CodeAnalysis; -using Microsoft.TypeSpec.Generator.Primitives; -using Microsoft.TypeSpec.Generator.Providers; - -namespace Microsoft.TypeSpec.Generator -{ - internal static partial class ProviderReferenceMapAnalyzer - { - private static bool IsKept(CSharpType type, HashSet roots, HashSet nodes) - { - var providerName = GetProviderTypeName(type); - return IsKeptName(providerName, type.Name, roots, nodes); - } - - private static bool IsKeptName(string providerName, HashSet roots, HashSet nodes) - { - return IsKeptName(providerName, StripGenericArity(GetSimpleName(providerName)), roots, nodes); - } - - private static bool IsKeptName(string providerName, string simpleName, HashSet roots, HashSet nodes) - { - return MatchesGeneratedNode(providerName, simpleName, roots, nodes); - } - - private static bool MatchesGeneratedNode( - string providerName, - string simpleName, - HashSet candidateNames, - HashSet nodes, - bool ignoreGenericArity = true) - { - if (candidateNames.Contains(providerName) && nodes.Contains(providerName)) - { - return true; - } - - var simpleNameLookup = ignoreGenericArity - ? _simpleNameLookupCache.GetValue(nodes, BuildSimpleNameLookup) - : _metadataSimpleNameLookupCache.GetValue(nodes, BuildMetadataSimpleNameLookup); - if (!simpleNameLookup.TryGetValue(simpleName, out var matches) || matches.Length != 1) - { - return false; - } - - var matchingNode = matches[0]; - return (string.Equals(providerName, simpleName, StringComparison.Ordinal) || - string.Equals(providerName, matchingNode, StringComparison.Ordinal)) && - (candidateNames.Contains(matchingNode) || candidateNames.Contains(simpleName)); - } - - private static bool IsClientProviderRoot(TypeProvider provider, bool publicOnly) => - provider.IsClientProvider && - (!publicOnly || provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - - private static bool IsAdditionalRootProvider(TypeProvider provider, HashSet roots, HashSet nodes) - { - return provider.DeclaringTypeProvider == null && IsKept(provider.Type, roots, nodes); - } - - private static bool IsModelFactoryProvider(TypeProvider provider) - => provider is ModelFactoryProvider; - - private static bool IsGeneratedInternalHelperDeclaration(TypeProvider provider) - { - if (provider is ModelProvider || - provider is EnumProvider || - IsModelFactoryProvider(provider) || - provider.DeclaringTypeProvider != null || - provider.SerializationProviders.Count > 0 || - IsModelSerializationProviderDeclaration(provider)) - { - return false; - } - - return !string.Equals(provider.RelativeFilePath, Path.Combine("src", "Generated", "Models", $"{provider.Name}.cs"), StringComparison.Ordinal); - } - - private static bool IsModelSerializationProviderDeclaration(TypeProvider provider) => - provider.SerializationProviderOwner != null; - - private static HashSet GetHelperRootNames( - IReadOnlyList providers, - HashSet nodes, - HashSet reachableTypes, - IReadOnlyDictionary>? references = null, - bool includeModelSerializationProviders = false) - { - var roots = new HashSet(StringComparer.Ordinal); - var generatedHelperNames = references == null ? null : GetGeneratedHelperNames(providers, nodes, includeModelSerializationProviders); - foreach (var provider in GetGeneratedProviders(providers)) - { - var providerName = GetProviderTypeName(provider.Type); - var isModelFactory = IsModelFactoryProvider(provider); - if (!reachableTypes.Contains(providerName) && !isModelFactory) - { - continue; - } - - AddHelperDependencies(roots, provider.HelperDependencyTypes, nodes, references == null ? null : references[providerName], provider.Type.Namespace); - if (references != null) - { - AddReferencedHelperRoots(roots, references[providerName], generatedHelperNames!); - } - - foreach (var property in provider.Properties) - { - AddInitializationHelperRoot(roots, property.Type, nodes); - AddParameterValidationHelperRoot(roots, property.AsParameter, nodes); - } - - foreach (var field in provider.Fields) - { - AddParameterValidationHelperRoot(roots, field.AsParameter, nodes); - } - - foreach (var constructor in provider.Constructors) - { - foreach (var parameter in constructor.Signature.Parameters) - { - AddParameterValidationHelperRoot(roots, parameter, nodes); - } - } - - foreach (var method in provider.Methods) - { - // Only factory methods for reachable models can instantiate collection helpers. - if (isModelFactory && - (method.Signature.ReturnType == null || !reachableTypes.Contains(GetProviderTypeName(method.Signature.ReturnType)))) - { - continue; - } - - foreach (var parameter in method.Signature.Parameters) - { - AddParameterValidationHelperRoot(roots, parameter, nodes); - if (isModelFactory) - { - AddModelFactoryCollectionInitializationHelperRoot(roots, parameter.Type, nodes); - } - } - } - } - - return roots; - } - - private static HashSet GetGeneratedHelperNames(IReadOnlyList providers, HashSet nodes, bool includeModelSerializationProviders) - { - var helpers = new HashSet(StringComparer.Ordinal); - foreach (var provider in GetGeneratedProviders(providers)) - { - if (!IsGeneratedInternalHelperDeclaration(provider) && - (!includeModelSerializationProviders || !IsModelSerializationProviderDeclaration(provider))) - { - continue; - } - - var providerName = GetProviderTypeName(provider.Type); - if (nodes.Contains(providerName)) - { - helpers.Add(providerName); - } - } - - return helpers; - } - - private static void AddReferencedHelperRoots(HashSet roots, HashSet referencedNames, HashSet generatedHelperNames) - { - foreach (var referencedName in referencedNames) - { - if (generatedHelperNames.Contains(referencedName)) - { - roots.Add(referencedName); - } - } - } - - private static void AddParameterValidationHelperRoot(HashSet roots, ParameterProvider parameter, HashSet nodes) - { - if (parameter.Validation != ParameterValidationType.None) - { - AddTypeReference(roots, new ArgumentDefinition().Type, nodes); - } - } - - private static void AddHelperDependencies( - HashSet roots, - IReadOnlyList dependencies, - HashSet nodes, - HashSet? referencedNames, - string? providerNamespace) - { - foreach (var dependency in dependencies) - { - var matches = new HashSet(StringComparer.Ordinal); - AddTypeReference(matches, dependency, nodes); - AddProviderNamespaceDependencyMatches(matches, dependency, providerNamespace, nodes); - foreach (var match in matches) - { - roots.Add(match); - } - } - } - - private static void AddProviderNamespaceDependencyMatches(HashSet matches, CSharpType? dependency, string? providerNamespace, HashSet nodes) - { - if (dependency == null || string.IsNullOrEmpty(providerNamespace)) - { - return; - } - - AddNamespaceBodyDependencyName(matches, providerNamespace, dependency, nodes); - foreach (var argument in dependency.Arguments) - { - AddProviderNamespaceDependencyMatches(matches, argument, providerNamespace, nodes); - } - } - - private static void AddInitializationHelperRoot(HashSet roots, CSharpType? type, HashSet nodes) - { - if (type == null) - { - return; - } - - var initializationType = type.PropertyInitializationType; - if (!string.Equals(initializationType.FullyQualifiedName, type.FullyQualifiedName, StringComparison.Ordinal)) - { - AddMatchingName(roots, initializationType.Name, nodes); - } - - if (type is { IsList: true, IsReadOnlyMemory: false }) - { - AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.ListInitializationType, nodes); - } - - if (type.IsDictionary) - { - AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType, nodes); - } - - foreach (var argument in type.Arguments) - { - AddInitializationHelperRoot(roots, argument, nodes); - } - } - - private static void AddModelFactoryCollectionInitializationHelperRoot(HashSet roots, CSharpType? type, HashSet nodes) - { - if (type == null) - { - return; - } - - if (type is { IsList: true, IsReadOnlyMemory: false }) - { - AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.ListInitializationType, nodes); - } - - if (type.IsDictionary) - { - AddTypeReference(roots, CodeModelGenerator.Instance.TypeFactory.DictionaryInitializationType, nodes); - } - - foreach (var argument in type.Arguments) - { - AddModelFactoryCollectionInitializationHelperRoot(roots, argument, nodes); - } - } - - private static void AddMatchingName(HashSet target, string name, HashSet nodes) - { - if (nodes.Contains(name)) - { - target.Add(name); - return; - } - - var simpleNameLookup = _simpleNameLookupCache.GetValue(nodes, BuildSimpleNameLookup); - if (!simpleNameLookup.TryGetValue(name, out var matches)) - { - return; - } - - foreach (var match in matches) - { - target.Add(match); - } - } - - private static void AddUnambiguousMatchingName(HashSet target, string name, HashSet nodes) - { - if (nodes.Contains(name)) - { - target.Add(name); - return; - } - - var simpleNameLookup = _simpleNameLookupCache.GetValue(nodes, BuildSimpleNameLookup); - if (simpleNameLookup.TryGetValue(name, out var matches) && matches.Length == 1) - { - target.Add(matches[0]); - } - } - - private static void AddMatchingNamesWithSimpleNameSuffix(HashSet target, string suffix, HashSet nodes) - { - foreach (var node in nodes) - { - if (GetSimpleName(node).EndsWith(suffix, StringComparison.Ordinal)) - { - target.Add(node); - } - } - } - - private static Dictionary BuildSimpleNameLookup(HashSet nodes) - => BuildSimpleNameLookup(nodes, ignoreGenericArity: true); - - private static Dictionary BuildMetadataSimpleNameLookup(HashSet nodes) - => BuildSimpleNameLookup(nodes, ignoreGenericArity: false); - - private static Dictionary BuildSimpleNameLookup( - HashSet nodes, - bool ignoreGenericArity) - { - var lookup = new Dictionary>(StringComparer.Ordinal); - foreach (var node in nodes) - { - if (IsNestedNode(node, nodes)) - { - continue; - } - - var simpleName = GetSimpleName(node); - if (ignoreGenericArity) - { - simpleName = StripGenericArity(simpleName); - } - if (!lookup.TryGetValue(simpleName, out var matchingNodes)) - { - matchingNodes = []; - lookup.Add(simpleName, matchingNodes); - } - - matchingNodes.Add(node); - } - - var result = new Dictionary(StringComparer.Ordinal); - foreach (var (simpleName, matchingNodes) in lookup) - { - result.Add(simpleName, [.. matchingNodes]); - } - - return result; - } - - private static bool IsNestedNode(string node, HashSet nodes) - { - var dotIndex = node.IndexOf('.'); - while (dotIndex >= 0) - { - if (nodes.Contains(node.Substring(0, dotIndex))) - { - return true; - } - - dotIndex = node.IndexOf('.', dotIndex + 1); - } - - return false; - } - - private static HashSet GetReachableTypes(HashSet roots, IReadOnlyDictionary> references) - { - return GetReachableTypes(roots, references, expandableNodes: null); - } - - private static HashSet GetReachableTypes( - HashSet roots, - IReadOnlyDictionary> references, - HashSet? expandableNodes) - { - var reachable = new HashSet(StringComparer.Ordinal); - var queue = new Queue(roots); - while (queue.Count > 0) - { - var current = queue.Dequeue(); - if (!reachable.Add(current)) - { - continue; - } - - if (expandableNodes != null && !expandableNodes.Contains(current)) - { - continue; - } - - if (!references.TryGetValue(current, out var children)) - { - continue; - } - - foreach (var child in children) - { - queue.Enqueue(child); - } - } - - return reachable; - } - - private static bool HasPublicApiPredecessor( - string name, - IReadOnlyDictionary> references, - HashSet publicReachable, - HashSet generatedImplementationInternalDeclarations) - => HasPublicApiPredecessor(name, references, publicReachable, excludedPredecessors: null, generatedImplementationInternalDeclarations); - - private static bool HasPublicApiPredecessor( - string name, - IReadOnlyDictionary> references, - HashSet publicReachable, - HashSet? excludedPredecessors, - HashSet generatedImplementationInternalDeclarations) - { - foreach (var (owner, children) in references) - { - if (!publicReachable.Contains(owner) || - string.Equals(owner, name, StringComparison.Ordinal) || - excludedPredecessors?.Contains(owner) == true || - generatedImplementationInternalDeclarations.Contains(owner) || - !children.Contains(name)) - { - continue; - } - - return true; - } - - return false; - } - - private static HashSet GetRootNames( - IReadOnlyList providers, - HashSet nodes, - HashSet helperRoots, - bool includeModelFactory, - bool includeAdditionalRoots, - bool publicClientRootsOnly) - { - var generator = CodeModelGenerator.Instance; - var roots = new HashSet(StringComparer.Ordinal); - var modelFactoryName = GetProviderTypeName(generator.OutputLibrary.ModelFactory.Value.Type); - - foreach (var provider in providers) - { - var name = GetProviderTypeName(provider.Type); - if (IsClientProviderRoot(provider, publicClientRootsOnly) || - includeAdditionalRoots && IsAdditionalRootProvider(provider, generator.AdditionalRootTypes, nodes) || - includeModelFactory && string.Equals(name, modelFactoryName, StringComparison.Ordinal) || - includeModelFactory && helperRoots.Contains(name)) - { - roots.Add(name); - } - } - - return roots; - } - - private static void RemoveMethodsFromModelFactory(HashSet namesToRemove, HashSet nodes) - { - if (namesToRemove.Count == 0) - { - return; - } - - var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; - _preWriteModelFactory = modelFactory; - _preWriteModelFactoryMethods ??= [.. modelFactory.Methods]; - var removedLeadingMethod = false; - var methodsToKeep = new List(); - for (int i = 0; i < modelFactory.Methods.Count; i++) - { - var method = modelFactory.Methods[i]; - if (!ShouldRemoveModelFactoryMethod(method, namesToRemove, nodes)) - { - methodsToKeep.Add(method); - continue; - } - - if (i == 0) - { - removedLeadingMethod = true; - } - } - - if (removedLeadingMethod && methodsToKeep.Count > 0) - { - modelFactory.PreserveLeadingMethodSeparator = true; - } - - modelFactory.Update(methods: methodsToKeep); - } - - private static bool ShouldRemoveModelFactoryMethod( - MethodProvider method, - HashSet namesToRemove, - HashSet nodes) - { - if (method.Signature.ReturnType == null) - { - return MatchesGeneratedNode( - method.Signature.Name, - method.Signature.Name, - namesToRemove, - nodes); - } - - var returnTypeName = GetProviderTypeName(method.Signature.ReturnType); - return MatchesGeneratedNode( - returnTypeName, - StripGenericArity(GetSimpleName(returnTypeName)), - namesToRemove, - nodes); - } - - private static HashSet GetGeneratedDeclaredNodes(IReadOnlyList providers, HashSet nodes, bool publicOnly) - { - var generator = CodeModelGenerator.Instance; - var declaredNodes = new HashSet(StringComparer.Ordinal); - foreach (var provider in GetGeneratedProviders(providers)) - { - if (IsModelFactoryProvider(provider)) - { - continue; - } - - if (publicOnly && !provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - continue; - } - - var name = GetProviderTypeName(provider.Type); - if (!nodes.Contains(name)) - { - continue; - } - - declaredNodes.Add(name); - } - - return declaredNodes; - } - - private static HashSet GetCustomCodeGeneratedTypeRoots(IReadOnlyList providers, HashSet generatedTypeNames) - { - var roots = new HashSet(StringComparer.Ordinal); - foreach (var customCodeView in GetCustomCodeViews(providers)) - { - AddCustomCodeViewGeneratedTypeRoot(roots, customCodeView, generatedTypeNames); - AddCustomCodeViewRoots(roots, customCodeView, generatedTypeNames, publicOnly: false); - } - - return roots; - } - - private static HashSet GetCustomCodePublicGeneratedTypeRoots(IReadOnlyList providers, HashSet generatedTypeNames) - { - var roots = new HashSet(StringComparer.Ordinal); - foreach (var customCodeView in GetCustomCodeViews(providers)) - { - if (!customCodeView.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - continue; - } - - AddCustomCodeViewGeneratedTypeRoot(roots, customCodeView, generatedTypeNames); - AddCustomCodeViewRoots(roots, customCodeView, generatedTypeNames, publicOnly: true); - } - - return roots; - } - - private static IEnumerable GetCustomCodeViews(IReadOnlyList providers) - { - var visited = new HashSet(StringComparer.Ordinal); - var modelFactoryCustomCodeView = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value.CustomCodeView; - if (modelFactoryCustomCodeView != null && visited.Add(GetCustomCodeViewIdentity(modelFactoryCustomCodeView))) - { - yield return modelFactoryCustomCodeView; - } - - foreach (var provider in providers) - { - var customCodeView = provider.CustomCodeView; - if (customCodeView == null || !visited.Add(GetCustomCodeViewIdentity(customCodeView))) - { - continue; - } - - yield return customCodeView; - } - - foreach (var customTypeProvider in CodeModelGenerator.Instance.SourceInputModel.CustomizationTypeProviders) - { - if (visited.Add(GetCustomCodeViewIdentity(customTypeProvider))) - { - yield return customTypeProvider; - } - } - } - - private static string GetCustomCodeViewIdentity(TypeProvider customCodeView) => - customCodeView is NamedTypeSymbolProvider namedTypeSymbolProvider - ? namedTypeSymbolProvider.MetadataName - : GetProviderTypeName(customCodeView.Type); - - private static void AddCustomCodeViewGeneratedTypeRoot(HashSet roots, TypeProvider customCodeView, HashSet generatedTypeNames) - { - if (customCodeView is NamedTypeSymbolProvider namedTypeSymbolProvider) - { - AddExactMetadataNameMatch(roots, namedTypeSymbolProvider.MetadataName, generatedTypeNames); - return; - } - - AddTypeReference(roots, customCodeView.Type, generatedTypeNames); - } - - private static void AddCustomCodeViewRoots( - HashSet roots, - TypeProvider customCodeView, - HashSet generatedTypeNames, - bool publicOnly) - { - var containingProviderTypeName = NormalizeMetadataTypeName(GetCustomCodeViewIdentity(customCodeView)); - var contextualTypeExclusions = customCodeView.Type.Arguments - .Select(argument => argument.Name) - .ToHashSet(StringComparer.Ordinal); - AddTypeReference(roots, customCodeView.BaseType, generatedTypeNames); - AddProviderBodyDependencyTypes(roots, customCodeView.SignatureDependencyTypes, generatedTypeNames, includeUnqualifiedSimpleNameReferences: true); - if (!publicOnly) - { - AddProviderBodyDependencyTypes(roots, customCodeView.BodyDependencyTypes, generatedTypeNames); - AddCustomCodeViewNamespaceBodyDependencyTypes(roots, customCodeView, generatedTypeNames); - AddAttributes(roots, customCodeView.Attributes, generatedTypeNames, serializationProviderNamesByType: null, includeArguments: true); - } - - foreach (var implementedType in customCodeView.Implements) - { - AddTypeReference(roots, implementedType, generatedTypeNames); - } - - foreach (var constructor in customCodeView.Constructors) - { - if (publicOnly && !IsPublic(constructor.Signature.Modifiers)) - { - continue; - } - - AddSignatureReferences( - roots, - constructor.Signature, - generatedTypeNames, - serializationProviderNamesByType: null, - includeAttributes: !publicOnly, - containingProviderTypeName: containingProviderTypeName, - contextualTypeExclusions: contextualTypeExclusions); - } - - foreach (var method in customCodeView.Methods) - { - if (publicOnly && !IsPublic(method.Signature.Modifiers)) - { - continue; - } - - AddSignatureReferences( - roots, - method.Signature, - generatedTypeNames, - serializationProviderNamesByType: null, - includeAttributes: !publicOnly, - containingProviderTypeName: containingProviderTypeName, - contextualTypeExclusions: contextualTypeExclusions); - } - - foreach (var property in customCodeView.Properties) - { - if (publicOnly && !IsPublic(property.Modifiers)) - { - continue; - } - - AddTypeReference( - roots, - property.Type, - generatedTypeNames, - containingProviderTypeName: containingProviderTypeName, - contextualTypeExclusions: contextualTypeExclusions); - AddTypeReference(roots, property.ExplicitInterface, generatedTypeNames); - if (!publicOnly) - { - AddAttributes(roots, property.Attributes, generatedTypeNames, serializationProviderNamesByType: null, includeArguments: true); - } - } - - foreach (var field in customCodeView.Fields) - { - if (publicOnly && !IsPublic(field.Modifiers)) - { - continue; - } - - AddTypeReference( - roots, - field.Type, - generatedTypeNames, - containingProviderTypeName: containingProviderTypeName, - contextualTypeExclusions: contextualTypeExclusions); - if (!publicOnly) - { - AddAttributes(roots, field.Attributes, generatedTypeNames, serializationProviderNamesByType: null, includeArguments: true); - } - } - } - - private static void AddCustomCodeViewNamespaceBodyDependencyTypes(HashSet roots, TypeProvider customCodeView, HashSet generatedTypeNames) - { - var customNamespace = customCodeView.Type.Namespace; - if (string.IsNullOrEmpty(customNamespace)) - { - return; - } - - var customMemberNames = GetCustomCodeViewMemberNames(customCodeView); - foreach (var dependency in customCodeView.BodyDependencyTypes) - { - AddNamespaceBodyDependencyType(roots, dependency, customNamespace, customMemberNames, generatedTypeNames); - } - } - - private static void AddNamespaceBodyDependencyType(HashSet roots, CSharpType? dependency, string customNamespace, HashSet customMemberNames, HashSet generatedTypeNames) - { - if (dependency == null) - { - return; - } - - var dependencyName = GetProviderTypeName(dependency); - var simpleDependencyName = StripGenericArity(GetSimpleName(dependencyName)); - if (string.IsNullOrEmpty(dependency.Namespace) && - !customMemberNames.Contains(simpleDependencyName)) - { - for (var namespaceCandidate = customNamespace; namespaceCandidate != null; namespaceCandidate = GetNamespaceName(namespaceCandidate)) - { - AddExactMetadataNameMatch(roots, $"{namespaceCandidate}.{dependencyName}", generatedTypeNames); - if (!string.Equals(simpleDependencyName, dependencyName, StringComparison.Ordinal)) - { - AddExactMetadataNameMatch(roots, $"{namespaceCandidate}.{simpleDependencyName}", generatedTypeNames); - } - } - } - - foreach (var argument in dependency.Arguments) - { - AddNamespaceBodyDependencyType(roots, argument, customNamespace, customMemberNames, generatedTypeNames); - } - } - - private static HashSet GetCustomCodeViewMemberNames(TypeProvider customCodeView) - { - var memberNames = new HashSet(StringComparer.Ordinal); - foreach (var property in customCodeView.Properties) - { - memberNames.Add(property.Name); - } - - foreach (var field in customCodeView.Fields) - { - memberNames.Add(field.Name); - } - - foreach (var method in customCodeView.Methods) - { - memberNames.Add(method.Signature.Name); - } - - return memberNames; - } - - /// - /// Matches internal custom declarations to the generated provider identities whose accessibility - /// they constrain. Metadata names preserve nested-type identity when available. - /// - private static HashSet GetCustomCodeInternalGeneratedTypeDeclarations(IReadOnlyList providers, HashSet generatedTypeNames) - { - var declarations = new HashSet(StringComparer.Ordinal); - foreach (var customCodeView in GetCustomCodeViews(providers)) - { - if (!customCodeView.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) - { - continue; - } - - if (customCodeView is NamedTypeSymbolProvider namedTypeSymbolProvider) - { - AddExactMetadataNameMatch(declarations, namedTypeSymbolProvider.MetadataName, generatedTypeNames); - } - else - { - AddTypeReference(declarations, customCodeView.Type, generatedTypeNames); - } - } - - return declarations; - } - - private static bool AddExactMetadataNameMatch(HashSet target, string metadataName, HashSet generatedTypeNames) - { - var normalizedName = NormalizeMetadataTypeName(metadataName); - if (!string.IsNullOrEmpty(normalizedName) && generatedTypeNames.Contains(normalizedName)) - { - target.Add(normalizedName); - return true; - } - - return false; - } - - private static string NormalizeMetadataTypeName(string metadataName) - { - var arrayIndex = metadataName.IndexOf('[', StringComparison.Ordinal); - if (arrayIndex > 0) - { - metadataName = metadataName.Substring(0, arrayIndex); - } - - return metadataName.Replace('+', '.'); - } - - private static HashSet GetGeneratedPersistableModelProxyTypeNames(IReadOnlyList providers, HashSet generatedTypeNames) - { - var proxyTypes = new HashSet(StringComparer.Ordinal); - foreach (var provider in GetGeneratedProviders(providers)) - { - if (!provider.ShouldAnalyzeAttributesInReferenceMap) - { - continue; - } - - if (provider.Attributes.Any(static attribute => IsAttributeNamed(attribute, "PersistableModelProxy"))) - { - AddTypeReference(proxyTypes, provider.Type, generatedTypeNames); - } - } - - return proxyTypes; - } - - private static HashSet GetGeneratedInternalTypeDeclarations( - IReadOnlyList providers, - HashSet generatedTypeNames) - { - var declarations = new HashSet(StringComparer.Ordinal); - var nonInternalDeclarations = new HashSet(StringComparer.Ordinal); - foreach (var provider in GetGeneratedProviders(providers)) - { - if (provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)) - { - AddTypeReference(declarations, provider.Type, generatedTypeNames); - } - else - { - AddTypeReference(nonInternalDeclarations, provider.Type, generatedTypeNames); - } - } - - declarations.ExceptWith(nonInternalDeclarations); - return declarations; - } - - private static HashSet GetGeneratedImplementationInternalTypeDeclarations( - IReadOnlyList providers, - HashSet generatedInternalDeclarations) - { - var implementationDeclarations = new HashSet(StringComparer.Ordinal); - foreach (var provider in GetGeneratedProviders(providers)) - { - if (!provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Static) && - !IsGeneratedInternalImplementation(provider)) - { - continue; - } - - AddTypeReference(implementationDeclarations, provider.Type, generatedInternalDeclarations); - } - - return implementationDeclarations; - } - - private static bool IsGeneratedInternalImplementation(TypeProvider provider) - => provider.RelativeFilePath.Contains( - $"{Path.DirectorySeparatorChar}Generated{Path.DirectorySeparatorChar}Internal{Path.DirectorySeparatorChar}", - StringComparison.Ordinal); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs deleted file mode 100644 index 25382973239..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapAnalyzer.cs +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; -using Microsoft.TypeSpec.Generator.Expressions; -using Microsoft.TypeSpec.Generator.Primitives; -using Microsoft.TypeSpec.Generator.Providers; -using Microsoft.TypeSpec.Generator.Statements; - -namespace Microsoft.TypeSpec.Generator -{ - internal static partial class ProviderReferenceMapAnalyzer - { - private static ProviderReferenceMapResult? _latestResult; - private static readonly ConditionalWeakTable, Dictionary> _simpleNameLookupCache = new(); - private static readonly ConditionalWeakTable, Dictionary> _metadataSimpleNameLookupCache = new(); - private static TypeProvider? _preWriteModelFactory; - private static MethodProvider[]? _preWriteModelFactoryMethods; - - public static ProviderReferenceMapResult? LatestResult => _latestResult; - - public static ProviderReferenceMapSession PrepareForGeneration(IReadOnlyList providers) - { - ResetPreWriteAccessibility(); - ApplyPreWriteAccessibility(providers); - Analyze(providers); - return new ProviderReferenceMapSession(); - } - - public static bool ShouldWriteProvider(TypeProvider provider) => - _latestResult?.RemoveCandidates.Contains(GetProviderTypeName(provider.Type)) != true; - - public static bool IsResolvableBuildableType(CSharpType type) - { - if (TryGetProvider(type, exact: true, out var provider)) - { - return IsResolvableBuildableProvider(provider); - } - - if (MatchesRemovedProvider(type)) - { - return false; - } - - return !TryGetProvider(type, exact: false, out provider) || - IsResolvableBuildableProvider(provider); - } - - private static bool IsResolvableBuildableProvider(TypeProvider provider) => - provider is not SystemObjectModelProvider && - provider is not ModelProvider { IsExternal: true } && - ShouldWriteProvider(provider); - - private static bool TryGetProvider(CSharpType type, bool exact, out TypeProvider provider) - { - var outputProvider = FindOutputProviderByName( - CodeModelGenerator.Instance.OutputLibrary.TypeProviders, - GetProviderTypeName(type)); - if (outputProvider != null) - { - provider = outputProvider; - return true; - } - - if (!exact && string.IsNullOrEmpty(type.Namespace)) - { - if (_latestResult != null) - { - var simpleNameLookup = _metadataSimpleNameLookupCache.GetValue(_latestResult.Nodes, BuildMetadataSimpleNameLookup); - var simpleName = GetSimpleName(GetProviderTypeName(type)); - if (!simpleNameLookup.TryGetValue(simpleName, out var matches) || - matches.Length != 1) - { - provider = null!; - return false; - } - - outputProvider = FindOutputProviderByName( - CodeModelGenerator.Instance.OutputLibrary.TypeProviders, - matches[0]); - if (outputProvider != null) - { - provider = outputProvider; - return true; - } - } - else if (CodeModelGenerator.Instance.TypeFactory.TypeProvidersByName.TryGetValue(type.Name, out var mappedProvider)) - { - provider = mappedProvider; - return true; - } - } - - provider = null!; - return false; - } - - private static TypeProvider? FindOutputProviderByName(IEnumerable providers, string name) - { - foreach (var provider in providers) - { - if (string.Equals(GetProviderTypeName(provider.Type), name, StringComparison.Ordinal)) - { - return provider; - } - - var nestedProvider = FindOutputProviderByName(provider.NestedTypes, name); - if (nestedProvider != null) - { - return nestedProvider; - } - - var serializationProvider = FindOutputProviderByName(provider.SerializationProviders, name); - if (serializationProvider != null) - { - return serializationProvider; - } - } - - return null; - } - - private static bool MatchesRemovedProvider(CSharpType type) - { - if (_latestResult == null || _latestResult.RemoveCandidates.Count == 0) - { - return false; - } - - var providerName = GetProviderTypeName(type); - if (_latestResult.RemoveCandidates.Contains(providerName)) - { - return true; - } - - return string.IsNullOrEmpty(type.Namespace) && - MatchesGeneratedNode( - providerName, - GetSimpleName(providerName), - _latestResult.RemoveCandidates, - _latestResult.Nodes, - ignoreGenericArity: false); - } - - public static void ResetPreWriteAccessibility() - { - RestorePreWriteModelFactoryMethods(); - _latestResult = null; - } - - public static void ApplyPreWriteAccessibility(IReadOnlyList providers) - { - if (Configuration.UnreferencedTypesHandling == Configuration.UnreferencedTypesHandlingOption.KeepAll) - { - return; - } - - // Accessibility has to be adjusted before files are written. Roslyn can remove files - // later, but it cannot safely change provider declarations or model factory signatures. - var (internalizeCandidates, publicCandidates, nodes) = GetPreWriteAccessibilityCandidates(providers); - foreach (var provider in GetGeneratedProviders(providers)) - { - var providerName = GetProviderTypeName(provider.Type); - if (internalizeCandidates.Contains(providerName)) - { - if (provider.DeclaringTypeProvider is null) - { - provider.PreserveXmlDocs(); - } - provider.Update(modifiers: MakeInternal(provider.DeclarationModifiers)); - } - else if (publicCandidates.Contains(providerName) && !IsGeneratedInternalImplementation(provider)) - { - provider.Update(modifiers: MakePublic(provider.DeclarationModifiers)); - } - } - - RemoveMethodsFromModelFactory(internalizeCandidates, nodes); - } - - public static void RestorePreWriteModelFactoryMethods() - { - if (_preWriteModelFactory == null || _preWriteModelFactoryMethods == null) - { - return; - } - - _preWriteModelFactory.Update(methods: _preWriteModelFactoryMethods); - _preWriteModelFactory = null; - _preWriteModelFactoryMethods = null; - } - - public static void Analyze(IReadOnlyList providers) - { - var generatedProviders = GetGeneratedProviders(providers); - - // Build two graphs from provider metadata: the full implementation graph for removal, - // and the public-surface graph for accessibility decisions. - var graph = BuildGraph(generatedProviders); - var publicGraph = BuildGraph(generatedProviders, publicOnly: true); - - var customPublicRoots = GetCustomCodePublicGeneratedTypeRoots(generatedProviders, graph.Nodes); - var customCodeRemovalRoots = GetCustomCodeGeneratedTypeRoots(generatedProviders, graph.Nodes); - var customRemovalRoots = new HashSet(customCodeRemovalRoots, StringComparer.Ordinal); - var customInternalDeclarations = GetCustomCodeInternalGeneratedTypeDeclarations(generatedProviders, graph.Nodes); - var generatedInternalDeclarations = GetGeneratedInternalTypeDeclarations(generatedProviders, graph.Nodes); - - // Helper types are rooted after an initial reachability pass so unused infrastructure - // such as change-tracking dictionaries can still be removed when no reachable type needs them. - var generatedDiscriminatorBaseNames = GetGeneratedPersistableModelProxyTypeNames(generatedProviders, publicGraph.Nodes); - var (internalizeCandidates, publicCandidates, _) = GetAccessibilityCandidates( - providers, - generatedProviders, - graph, - publicGraph, - customPublicRoots, - customInternalDeclarations, - generatedInternalDeclarations, - generatedDiscriminatorBaseNames); - - var removeCandidates = new HashSet(StringComparer.Ordinal); - if (Configuration.UnreferencedTypesHandling == Configuration.UnreferencedTypesHandlingOption.RemoveOrInternalize) - { - // Body-only generated dependencies are needed to avoid deleting helper files, but they do - // not contribute to public API reachability for internalization. - AddGeneratedBodyReferences(providers, graph); - removeCandidates = GetRemovalCandidates( - providers, - generatedProviders, - graph, - customRemovalRoots, - generatedDiscriminatorBaseNames); - } - - _latestResult = new ProviderReferenceMapResult( - internalizeCandidates, - publicCandidates, - removeCandidates, - graph.Nodes); - if (Configuration.UnreferencedTypesHandling == Configuration.UnreferencedTypesHandlingOption.RemoveOrInternalize) - { - RemoveMethodsFromModelFactory(removeCandidates, graph.Nodes); - } - } - - private static (HashSet InternalizeCandidates, HashSet PublicCandidates, HashSet Nodes) GetPreWriteAccessibilityCandidates(IReadOnlyList providers) - { - var generatedProviders = GetGeneratedProviders(providers); - var graph = BuildGraph(generatedProviders); - var publicGraph = BuildGraph(generatedProviders, publicOnly: true); - var customPublicRoots = GetCustomCodePublicGeneratedTypeRoots(generatedProviders, graph.Nodes); - var customInternalDeclarations = GetCustomCodeInternalGeneratedTypeDeclarations(generatedProviders, graph.Nodes); - var generatedInternalDeclarations = GetGeneratedInternalTypeDeclarations(generatedProviders, graph.Nodes); - var generatedDiscriminatorBaseNames = new HashSet(StringComparer.Ordinal); - - var (internalizeCandidates, publicCandidates, _) = GetAccessibilityCandidates( - providers, - generatedProviders, - graph, - publicGraph, - customPublicRoots, - customInternalDeclarations, - generatedInternalDeclarations, - generatedDiscriminatorBaseNames); - - return (internalizeCandidates, publicCandidates, graph.Nodes); - } - - /// - /// Computes accessibility changes by traversing public signatures from explicit API roots, - /// then propagating internal boundaries and determining which reachable declarations must be public. - /// - private static (HashSet InternalizeCandidates, HashSet PublicCandidates, HashSet InternalizeHelperRoots) GetAccessibilityCandidates( - IReadOnlyList providers, - IReadOnlyList generatedProviders, - ProviderReferenceGraph graph, - ProviderReferenceGraph publicGraph, - HashSet customPublicRoots, - HashSet customInternalDeclarations, - HashSet generatedInternalDeclarations, - HashSet generatedDiscriminatorBaseNames) - { - var internalizeReferences = CloneReferences(publicGraph.References); - - // Build the public API roots and add derived-model edges that are known only after traversal. - var internalizeRoots = GetRootNames( - providers, - graph.Nodes, - helperRoots: [], - includeModelFactory: false, - includeAdditionalRoots: true, - publicClientRootsOnly: true); - - var generatedPublicReachable = GetReachableTypes(internalizeRoots, internalizeReferences); - AddDerivedModelReferences(providers, publicGraph.Nodes, internalizeReferences, generatedPublicReachable, generatedDiscriminatorBaseNames); - internalizeRoots.UnionWith(customPublicRoots); - var internalizeReachableWithoutHelpers = GetReachableTypes(internalizeRoots, internalizeReferences); - AddDerivedModelReferences(providers, publicGraph.Nodes, internalizeReferences, internalizeReachableWithoutHelpers, generatedDiscriminatorBaseNames); - internalizeReachableWithoutHelpers = GetReachableTypes(internalizeRoots, internalizeReferences); - var publicRoots = new HashSet(internalizeRoots, StringComparer.Ordinal); - var publicApiReferences = CloneReferences(publicGraph.References); - var internalizeHelperRoots = GetHelperRootNames(generatedProviders, graph.Nodes, internalizeReachableWithoutHelpers, graph.References); - internalizeRoots.UnionWith(internalizeHelperRoots); - var internalizeDeclaredNodes = GetGeneratedDeclaredNodes(generatedProviders, graph.Nodes, publicOnly: true); - var customInternalBoundaryNodes = GetCustomInternalBoundaryNodes(publicGraph, customInternalDeclarations); - var publicDeclaredNodes = GetPublicDeclaredNodes(generatedProviders, graph.Nodes); - var generatedImplementationInternalDeclarations = GetGeneratedImplementationInternalTypeDeclarations(generatedProviders, generatedInternalDeclarations); - var publicApiTraversalNodes = GetPublicApiTraversalNodes( - internalizeDeclaredNodes, - publicDeclaredNodes, - generatedInternalDeclarations, - generatedImplementationInternalDeclarations); - - // First determine everything that cannot remain public, including transitive internal-only - // dependencies and nested types whose declaring type becomes internal. - var publicReachable = GetReachableTypes(publicRoots, internalizeReferences, publicApiTraversalNodes); - var internalizeCandidates = GetInternalizeCandidates( - internalizeDeclaredNodes, - publicReachable, - customInternalDeclarations, - generatedInternalDeclarations, - customInternalBoundaryNodes, - customPublicRoots, - publicRoots, - graph.Nodes, - internalizeReferences); - AddNestedInternalizeCandidates(generatedProviders, internalizeCandidates, graph.Nodes); - AddInternalOnlyDependencyCandidates( - internalizeDeclaredNodes, - internalizeCandidates, - customInternalDeclarations, - generatedInternalDeclarations, - publicRoots, - internalizeReferences, - generatedImplementationInternalDeclarations); - RemovePublicApiExposedCandidates( - internalizeDeclaredNodes, - internalizeCandidates, - customInternalDeclarations, - internalizeReferences); - AddNestedInternalizeCandidates(generatedProviders, internalizeCandidates, graph.Nodes); - - // Recompute reachability without internalized roots, then promote only declarations that - // are still exposed by a public predecessor. - publicRoots.ExceptWith(internalizeCandidates); - publicReachable = GetReachableTypes(publicRoots, internalizeReferences, publicApiTraversalNodes); - var publicRootExclusions = GetRootNames( - providers, - graph.Nodes, - helperRoots: [], - includeModelFactory: true, - includeAdditionalRoots: true, - publicClientRootsOnly: true); - var publicCandidates = GetPublicCandidates( - publicDeclaredNodes, - publicReachable, - customInternalDeclarations, - customInternalBoundaryNodes, - internalizeHelperRoots, - publicRootExclusions, - generatedInternalDeclarations, - publicRoots, - publicApiReferences, - internalizeReferences, - generatedImplementationInternalDeclarations); - return (internalizeCandidates, publicCandidates, internalizeHelperRoots); - } - - private static ProviderReferenceGraph BuildGraph(IReadOnlyList generatedProviders, bool publicOnly = false) - { - // Each generated provider becomes a node, and provider metadata supplies the edges: - // inheritance, signatures, properties, fields, nested/serialization providers, attributes, - // and selected implementation dependencies. This avoids parsing generated C# just to - // rediscover generated-to-generated references. - var serializationProviderNamesByType = GetSerializationProviderNamesByType(generatedProviders); - IReadOnlyDictionary? serializationReferenceNamesByType = publicOnly ? null : serializationProviderNamesByType; - var nodes = new HashSet(StringComparer.Ordinal); - var references = new Dictionary>(StringComparer.Ordinal); - foreach (var provider in generatedProviders) - { - var providerName = GetProviderTypeName(provider.Type); - if (nodes.Add(providerName)) - { - references.Add(providerName, new HashSet(StringComparer.Ordinal)); - } - } - - foreach (var provider in generatedProviders) - { - var current = GetProviderTypeName(provider.Type); - var providerNamespace = provider.Type.Namespace; - AddTypeReference(references[current], provider.Type, nodes, serializationReferenceNamesByType, providerNamespace); - AddTypeReference(references[current], provider.BaseType, nodes, serializationReferenceNamesByType, providerNamespace); - AddTypeReference(references[current], provider.DeclaringTypeProvider?.Type, nodes, serializationReferenceNamesByType, providerNamespace); - - if (publicOnly && !provider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)) - { - continue; - } - - if (!publicOnly && IsKept(provider.Type, CodeModelGenerator.Instance.NonRootTypes, nodes)) - { - continue; - } - - // Model factory signatures mention many models, but methods for unreachable models - // are removed with those models. Only helper dependencies contribute reachability. - if (IsModelFactoryProvider(provider)) - { - continue; - } - - foreach (var implementedType in provider.Implements) - { - AddTypeReference(references[current], implementedType, nodes, serializationReferenceNamesByType, providerNamespace); - } - - if (!publicOnly) - { - foreach (var nestedType in provider.NestedTypes) - { - AddTypeReference(references[current], nestedType.Type, nodes, serializationReferenceNamesByType, providerNamespace); - } - } - - if (!publicOnly) - { - foreach (var serializationProvider in provider.SerializationProviders) - { - AddTypeReference(references[current], serializationProvider.Type, nodes, serializationReferenceNamesByType, providerNamespace); - } - } - - foreach (var signatureDependency in provider.SignatureDependencyTypes) - { - AddTypeReference(references[current], signatureDependency, nodes, serializationReferenceNamesByType, providerNamespace); - } - - foreach (var property in provider.Properties) - { - if (publicOnly && !IsPublic(property.Modifiers)) - { - continue; - } - - AddTypeReference(references[current], property.Type, nodes, serializationReferenceNamesByType, providerNamespace); - AddTypeReference(references[current], property.ExplicitInterface, nodes, serializationReferenceNamesByType, providerNamespace); - if (!publicOnly) - { - AddAttributes(references[current], property.Attributes, nodes, serializationReferenceNamesByType, includeArguments: false); - } - } - - foreach (var field in provider.Fields) - { - if (publicOnly && !field.Modifiers.HasFlag(FieldModifiers.Public)) - { - continue; - } - - AddTypeReference(references[current], field.Type, nodes, serializationReferenceNamesByType, providerNamespace); - if (!publicOnly) - { - AddAttributes(references[current], field.Attributes, nodes, serializationReferenceNamesByType, includeArguments: false); - } - } - - foreach (var constructor in provider.Constructors) - { - if (publicOnly && !IsPublic(constructor.Signature.Modifiers)) - { - continue; - } - - AddSignatureReferences(references[current], constructor.Signature, nodes, serializationReferenceNamesByType, includeAttributes: !publicOnly, includeAttributeArguments: false, providerNamespace: providerNamespace); - } - - foreach (var method in provider.Methods) - { - if (method.IsMethodSuppressed()) - { - continue; - } - - if (publicOnly && !IsPublic(method.Signature.Modifiers)) - { - continue; - } - - AddSignatureReferences(references[current], method.Signature, nodes, serializationReferenceNamesByType, includeAttributes: !publicOnly, includeAttributeArguments: false, providerNamespace: providerNamespace); - } - } - - return new ProviderReferenceGraph(nodes, references); - } - - private static Dictionary GetSerializationProviderNamesByType(IReadOnlyList generatedProviders) - { - var namesByType = new Dictionary>(StringComparer.Ordinal); - foreach (var provider in generatedProviders) - { - if (provider.SerializationProviderOwner is { } owner) - { - AddSerializationProviderName(owner.Type, provider.Type); - } - - if (provider.SerializationProviders.Count == 0) - { - continue; - } - - foreach (var serializationProvider in provider.SerializationProviders) - { - AddSerializationProviderName(provider.Type, serializationProvider.Type); - } - } - - var result = new Dictionary(StringComparer.Ordinal); - foreach (var (providerName, serializationProviderNames) in namesByType) - { - result.Add(providerName, [.. serializationProviderNames]); - } - - return result; - - void AddSerializationProviderName(CSharpType ownerType, CSharpType serializationProviderType) - { - var ownerName = GetProviderTypeName(ownerType); - if (!namesByType.TryGetValue(ownerName, out var serializationProviderNames)) - { - serializationProviderNames = new HashSet(StringComparer.Ordinal); - namesByType.Add(ownerName, serializationProviderNames); - } - - serializationProviderNames.Add(GetProviderTypeName(serializationProviderType)); - } - } - - private static bool IsPublic(MethodSignatureModifiers modifiers) => modifiers.HasFlag(MethodSignatureModifiers.Public); - private static bool IsPublic(FieldModifiers modifiers) => modifiers.HasFlag(FieldModifiers.Public); - - private static TypeSignatureModifiers MakeInternal(TypeSignatureModifiers modifiers) - => (modifiers & ~(TypeSignatureModifiers.Public | TypeSignatureModifiers.Private | TypeSignatureModifiers.Protected)) | TypeSignatureModifiers.Internal; - - private static TypeSignatureModifiers MakePublic(TypeSignatureModifiers modifiers) - => (modifiers & ~(TypeSignatureModifiers.Internal | TypeSignatureModifiers.Private | TypeSignatureModifiers.Protected)) | TypeSignatureModifiers.Public; - - private sealed record ProviderReferenceGraph( - HashSet Nodes, - Dictionary> References); - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs deleted file mode 100644 index 30519d304e2..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapResult.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; - -namespace Microsoft.TypeSpec.Generator -{ - internal sealed record ProviderReferenceMapResult( - HashSet InternalizeCandidates, - HashSet PublicCandidates, - HashSet RemoveCandidates, - HashSet Nodes) - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs deleted file mode 100644 index 54be2cd1d43..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/ReferenceMap/ProviderReferenceMapSession.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Microsoft.TypeSpec.Generator.Providers; - -namespace Microsoft.TypeSpec.Generator -{ - internal sealed class ProviderReferenceMapSession : IDisposable - { - private bool _disposed; - - public bool ShouldWriteProvider(TypeProvider provider) => ProviderReferenceMapAnalyzer.ShouldWriteProvider(provider); - - public void RestorePreWriteModelFactoryMethods() => ProviderReferenceMapAnalyzer.RestorePreWriteModelFactoryMethods(); - - public void Dispose() - { - if (_disposed) - { - return; - } - - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - _disposed = true; - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs index 74f26fa321d..05359e3abc8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputHelper.cs @@ -24,23 +24,7 @@ internal static IEnumerable GetSymbols(INamespaceSymbol namespaceSy foreach (INamedTypeSymbol symbol in namespaceSymbol.GetTypeMembers()) { - foreach (var type in GetSymbols(symbol)) - { - yield return type; - } - } - } - - private static IEnumerable GetSymbols(INamedTypeSymbol typeSymbol) - { - yield return typeSymbol; - - foreach (var nestedTypeSymbol in typeSymbol.GetTypeMembers()) - { - foreach (var type in GetSymbols(nestedTypeSymbol)) - { - yield return type; - } + yield return symbol; } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs index 00133c450df..a329166ee4b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/SourceInput/SourceInputModel.cs @@ -22,7 +22,6 @@ public class SourceInputModel public ApiCompatBaseline ApiCompatBaseline { get; } private readonly Lazy> _nameMap; - private readonly Lazy> _customizationTypeProviders; public SourceInputModel(Compilation? customization, Compilation? lastContract) : this(customization, lastContract, ApiCompatBaseline.Empty) @@ -36,7 +35,6 @@ public SourceInputModel(Compilation? customization, Compilation? lastContract, A ApiCompatBaseline = apiCompatBaseline ?? ApiCompatBaseline.Empty; _nameMap = new(PopulateNameMap); - _customizationTypeProviders = new(PopulateCustomizationTypeProviders); } private IReadOnlyDictionary PopulateNameMap() @@ -69,33 +67,32 @@ private IReadOnlyDictionary PopulateNameMap() public TypeProvider? FindForTypeInLastContract(string ns, string name, string? declaringTypeName = null) { - return FindTypeInCustomization(LastContract, ns, name, true, declaringTypeName, includeInternal: false); + return FindTypeInCompilation(LastContract, ns, name, true, declaringTypeName, includeInternal: false); } - private IReadOnlyList PopulateCustomizationTypeProviders() + private TypeProvider? FindTypeInCompilation( + Compilation? compilation, + string ns, + string name, + bool includeReferencedAssemblies, + string? declaringTypeName, + bool includeInternal = true) { - var providers = new List(); - if (Customization == null) + if (compilation == null) { - return providers; + return null; } + string fullyQualifiedMetadataName = GetFullyQualifiedMetadataName(ns, name, declaringTypeName); - foreach (IModuleSymbol module in Customization.Assembly.Modules) + var type = FindNamedTypeSymbol(compilation, includeReferencedAssemblies, fullyQualifiedMetadataName); + if (!includeInternal && type != null && type.DeclaredAccessibility != Accessibility.Public) { - foreach (var type in SourceInputHelper.GetSymbols(module.GlobalNamespace)) - { - if (type is INamedTypeSymbol namedTypeSymbol) - { - providers.Add(new NamedTypeSymbolProvider(namedTypeSymbol, Customization)); - } - } + type = null; } - return providers; + return type != null ? new NamedTypeSymbolProvider(type, compilation) : null; } - internal IReadOnlyList CustomizationTypeProviders => _customizationTypeProviders.Value; - private static INamedTypeSymbol? FindNamedTypeSymbol(Compilation compilation, bool includeReferencedAssemblies, string fullyQualifiedMetadataName) => includeReferencedAssemblies ? compilation.GetTypeByMetadataName(fullyQualifiedMetadataName) @@ -111,8 +108,7 @@ private static string GetFullyQualifiedMetadataName(string ns, string name, stri string ns, string name, bool includeReferencedAssemblies, - string? declaringTypeName = null, - bool includeInternal = true) + string? declaringTypeName = null) { if (compilation == null) { @@ -121,24 +117,10 @@ private static string GetFullyQualifiedMetadataName(string ns, string name, stri var fullyQualifiedMetadataName = GetFullyQualifiedMetadataName(ns, name, declaringTypeName); - // Either find by the CodeGenType attribute in customization or by the actual type name. - INamedTypeSymbol? type = null; - if (ReferenceEquals(compilation, Customization) && - _nameMap.Value.TryGetValue(name, out var mappedType) && - IsContainingTypeMatch(mappedType, ns, declaringTypeName)) - { - type = mappedType; - } - - if (type == null) + // Either find by the CodeGenType attribute or by the actual type name. + if (!_nameMap.Value.TryGetValue(name, out var type)) { type = FindNamedTypeSymbol(compilation, includeReferencedAssemblies, fullyQualifiedMetadataName); - type ??= FindNestedNamedTypeSymbol(compilation, ns, name, declaringTypeName); - } - - if (!includeInternal && type != null && type.DeclaredAccessibility != Accessibility.Public) - { - type = null; } return type != null ? new NamedTypeSymbolProvider(type, compilation) : null; @@ -168,47 +150,5 @@ private bool TryGetName(ISymbol symbol, [NotNullWhen(true)] out string? name) return name != null; } - - private static INamedTypeSymbol? FindNestedNamedTypeSymbol(Compilation compilation, string ns, string name, string? declaringTypeName) - { - if (declaringTypeName == null) - { - return null; - } - - foreach (var module in compilation.Assembly.Modules) - { - foreach (var type in SourceInputHelper.GetSymbols(module.GlobalNamespace)) - { - if (type is not INamedTypeSymbol namedTypeSymbol || - !string.Equals(namedTypeSymbol.Name, name, StringComparison.Ordinal) || - !string.Equals(GetContainingTypeName(namedTypeSymbol), declaringTypeName, StringComparison.Ordinal) || - !string.Equals(namedTypeSymbol.ContainingNamespace.ToDisplayString(), ns, StringComparison.Ordinal)) - { - continue; - } - - return namedTypeSymbol; - } - } - - return null; - } - - private static string? GetContainingTypeName(INamedTypeSymbol symbol) - { - if (symbol.ContainingType is null) - { - return null; - } - - var parentName = GetContainingTypeName(symbol.ContainingType); - return parentName is null - ? symbol.ContainingType.MetadataName - : $"{parentName}+{symbol.ContainingType.MetadataName}"; - } - - private static bool IsContainingTypeMatch(INamedTypeSymbol symbol, string ns, string? declaringTypeName) - => string.Equals(GetContainingTypeName(symbol), declaringTypeName, StringComparison.Ordinal); } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs index 110f92af48e..cfca3c2db7b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Statements/XmlDocStatement.cs @@ -217,8 +217,6 @@ public static string EscapeLine(string s) "", "", "", - "", - "", "", "", " _optionalProvider ??= new(); - private Dictionary InputTypeToModelProvider { get; } = []; public IDictionary CSharpTypeMap { get; } = new Dictionary(CSharpType.IgnoreNullableComparer); @@ -41,6 +38,8 @@ public class TypeFactory private IReadOnlyList Visitors => CodeModelGenerator.Instance.Visitors; private Dictionary> SerializationsCache { get; } = []; + internal HashSet UnionVariantTypesToKeep { get; } = []; + protected internal TypeFactory() { } @@ -98,6 +97,11 @@ protected internal TypeFactory() if (unionInput != null) { unionInputs.Add(unionInput); + // we only keep the type if it is not framework type and not literal + if (!unionInput.IsFrameworkType && !unionInput.IsLiteral) + { + UnionVariantTypesToKeep.Add(unionInput.Name); + } } } type = CSharpType.FromUnion(unionInputs); @@ -295,15 +299,15 @@ protected virtual ModelFactoryProvider CreateModelFactoryCore(IEnumerable enumProvider, }; + if (enumType.Access == "public") + { + CodeModelGenerator.Instance.AddTypeToKeep(enumProvider); + } + EnumCache.Add(enumCacheKey, enumProvider); if (enumProvider != null) { - if (enumType.Access == "public") - { - CodeModelGenerator.Instance.AddTypeToKeep(enumProvider); - } - CSharpTypeMap[enumProvider.Type] = enumProvider; TypeProvidersByName[enumProvider.Type.Name] = enumProvider; } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs index 65924a3c308..8af371a063c 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/TypeSymbolExtensions.cs @@ -43,9 +43,6 @@ public static bool IsSameType(this INamedTypeSymbol symbol, CSharpType type) } public static CSharpType GetCSharpType(this ITypeSymbol typeSymbol) - => GetCSharpType(typeSymbol, new HashSet(SymbolEqualityComparer.Default)); - - private static CSharpType GetCSharpType(this ITypeSymbol typeSymbol, HashSet visited) { var fullyQualifiedName = GetFullyQualifiedName(typeSymbol); var namedTypeSymbol = typeSymbol as INamedTypeSymbol; @@ -58,20 +55,20 @@ private static CSharpType GetCSharpType(this ITypeSymbol typeSymbol, HashSet GetCSharpType(t, visited))]); + return result.MakeGenericType([.. namedTypeSymbol.TypeArguments.Select(GetCSharpType)]); } return result; @@ -157,16 +154,11 @@ public static string GetFullyQualifiedName(this ITypeSymbol typeSymbol) return GetNonNullableGenericTypeName(namedTypeSymbol); } - var constructedFrom = namedTypeSymbol.ConstructedFrom; - var ns = constructedFrom.ContainingNamespace.GetFullyQualifiedNameFromDisplayString(); - var name = constructedFrom.MetadataName; - var tickIndex = name.IndexOf('`', StringComparison.Ordinal); - if (tickIndex >= 0) - { - name = name.Substring(0, tickIndex); - } - - return $"{(string.IsNullOrEmpty(ns) ? name : $"{ns}.{name}")}`{namedTypeSymbol.TypeArguments.Length}"; + var typeNameSpan = namedTypeSymbol.ConstructedFrom.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat).AsSpan(); + var start = typeNameSpan.IndexOf(':') + 2; + var end = typeNameSpan.IndexOf('<'); + typeNameSpan = typeNameSpan.Slice(start, end - start); + return $"{typeNameSpan}`{namedTypeSymbol.TypeArguments.Length}"; } } @@ -183,14 +175,8 @@ public static string GetFullyQualifiedNameFromDisplayString(this ISymbol typeSym private static CSharpType ConstructCSharpTypeFromSymbol( ITypeSymbol typeSymbol, string fullyQualifiedName, - INamedTypeSymbol? namedTypeSymbol, - HashSet visited) + INamedTypeSymbol? namedTypeSymbol) { - if (!visited.Add(typeSymbol)) - { - return ConstructShallowCSharpTypeFromSymbol(typeSymbol, fullyQualifiedName); - } - var typeArg = namedTypeSymbol?.TypeArguments.FirstOrDefault(); bool isValueType = typeSymbol.IsValueType; bool isNullable = fullyQualifiedName.StartsWith(NullableTypeName); @@ -207,7 +193,7 @@ private static CSharpType ConstructCSharpTypeFromSymbol( if (namedTypeSymbol?.IsGenericType == true && (!isNullable || (namedTypeArg?.IsGenericType == true))) { - arguments.AddRange(namedTypeSymbol.TypeArguments.Select(t => GetCSharpType(t, visited))); + arguments.AddRange(namedTypeSymbol.TypeArguments.Select(GetCSharpType)); } // handle nullables @@ -221,9 +207,9 @@ private static CSharpType ConstructCSharpTypeFromSymbol( string ns = string.Join('.', pieces.Take(pieces.Length - 1)); CSharpType? containingType = null; - if (typeSymbol.ContainingType != null && typeSymbol.TypeKind != TypeKind.TypeParameter) + if (typeSymbol.ContainingType != null) { - containingType = GetCSharpType(typeSymbol.ContainingType, visited); + containingType = GetCSharpType(typeSymbol.ContainingType); ns = string.Join('.', pieces.Take(pieces.Length - 2)); } @@ -233,10 +219,10 @@ private static CSharpType ConstructCSharpTypeFromSymbol( !isNullableUnknownType && !ContainsTypeAsArgument(typeSymbol.BaseType, typeSymbol)) { - baseType = GetCSharpType(typeSymbol.BaseType, visited); + baseType = GetCSharpType(typeSymbol.BaseType); } - var result = new CSharpType( + return new CSharpType( name, ns, isValueType, @@ -247,25 +233,8 @@ private static CSharpType ConstructCSharpTypeFromSymbol( isValueType && !isEnum, baseType: baseType, underlyingEnumType: enumUnderlyingType != null - ? GetCSharpType(enumUnderlyingType, visited).FrameworkType + ? GetCSharpType(enumUnderlyingType).FrameworkType : null); - visited.Remove(typeSymbol); - return result; - } - - private static CSharpType ConstructShallowCSharpTypeFromSymbol(ITypeSymbol typeSymbol, string fullyQualifiedName) - { - // Break recursive symbol graphs without recursively materializing arguments, bases, or containing types. - string[] pieces = fullyQualifiedName.Split('`')[0].Split('.'); - return new CSharpType( - typeSymbol.Name, - string.Join('.', pieces.Take(pieces.Length - 1)), - typeSymbol.IsValueType, - fullyQualifiedName.StartsWith(NullableTypeName), - null, - [], - typeSymbol.DeclaredAccessibility == Accessibility.Public, - typeSymbol.IsValueType && typeSymbol.TypeKind != TypeKind.Enum); } internal static bool ContainsTypeAsArgument(ITypeSymbol potentialGenericType, ITypeSymbol targetType) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs index 49b40624443..f716aad5ab3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/OutputLibraryVisitorTests.cs @@ -331,40 +331,6 @@ public async Task SerializationProviderConstructorIsFilteredWhenMatchingCustomCo Assert.AreEqual(0, serializationProvider.Constructors.Count, "Serialization provider constructor should be filtered when matching custom code"); } - [Test] - public async Task NestedProviderConstructorIsFilteredWhenMatchingCustomCode() - { - var typeProvider = new TestTypeProvider(ns: "Sample"); - var customNestedProvider = new TestConstructorTypeProvider("NestedType", "Sample"); - customNestedProvider.ConstructorProviders = - [ - new ConstructorProvider( - new ConstructorSignature(customNestedProvider.Type, $"", MethodSignatureModifiers.Public, [new ParameterProvider("param1", $"", typeof(string))]), - Snippet.Throw(Snippet.Null), customNestedProvider) - ]; - var nestedProvider = new TestConstructorTypeProvider("NestedType", "Sample", typeProvider, customNestedProvider); - var constructor = new ConstructorProvider( - new ConstructorSignature(nestedProvider.Type, $"", MethodSignatureModifiers.Public, [new ParameterProvider("param1", $"", typeof(string))]), - Snippet.Throw(Snippet.Null), nestedProvider); - nestedProvider.ConstructorProviders = [constructor]; - typeProvider.NestedTypesInternal = [nestedProvider]; - - var generator = await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(typeProvider)); - - foreach (var type in generator.Object.OutputLibrary.TypeProviders) - { - type.EnsureBuilt(); - } - - Assert.AreEqual(1, nestedProvider.Constructors.Count, "Nested provider should have 1 constructor before filtering"); - Assert.IsNotNull(nestedProvider.CustomCodeView, "Nested provider custom code view should be found"); - - CSharpGen.FilterAllCustomizedMembers(generator.Object.OutputLibrary); - - Assert.AreEqual(0, nestedProvider.Constructors.Count, "Nested provider constructor should be filtered when matching custom code"); - } - [Test] public async Task MatchingPropertyIsFilteredAfterVisitorMutation() { @@ -554,34 +520,5 @@ private class TestSerializationTypeProvider : TypeProvider protected override string BuildNamespace() => "Test"; protected internal override ConstructorProvider[] BuildConstructors() => ConstructorProviders; } - - private class TestConstructorTypeProvider : TypeProvider - { - private readonly string _name; - private readonly string _namespace; - private readonly TypeProvider? _declaringTypeProvider; - - public TestConstructorTypeProvider(string name, string @namespace, TypeProvider? declaringTypeProvider = null) - : this(name, @namespace, declaringTypeProvider, customCodeView: null) - { - } - - public TestConstructorTypeProvider(string name, string @namespace, TypeProvider? declaringTypeProvider, TypeProvider? customCodeView) - { - _name = name; - _namespace = @namespace; - _declaringTypeProvider = declaringTypeProvider; - _customCodeView = customCodeView; - } - - private readonly TypeProvider? _customCodeView; - public ConstructorProvider[] ConstructorProviders { get; set; } = []; - protected override string BuildRelativeFilePath() => $"{Name}.cs"; - protected override string BuildName() => _name; - protected override string BuildNamespace() => _namespace; - protected override TypeProvider? BuildDeclaringTypeProvider() => _declaringTypeProvider; - private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; - protected internal override ConstructorProvider[] BuildConstructors() => ConstructorProviders; - } } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs new file mode 100644 index 00000000000..28981148a4d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/PostProcessorTests.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.TypeSpec.Generator.Tests.Common; +using NUnit.Framework; + +namespace Microsoft.TypeSpec.Generator.Tests.PostProcessing +{ + public class PostProcessorTests + { + [Test] + public async Task RemovesInvalidUsings() + { + MockHelpers.LoadMockGenerator(); + var workspace = new AdhocWorkspace(); + var projectInfo = ProjectInfo.Create( + ProjectId.CreateNewId(), + VersionStamp.Create(), + name: "TestProj", + assemblyName: "TestProj", + language: LanguageNames.CSharp) + .WithMetadataReferences(new[] + { + MetadataReference.CreateFromFile(typeof(object).Assembly.Location) + }); + + var project = workspace.AddProject(projectInfo); + var folder = Helpers.GetAssetFileOrDirectoryPath(false); + project = project.AddDocument( + "RemovesInvalidUsings.cs", + File.ReadAllText(Path.Join(folder, "RemovesInvalidUsings.cs"))).Project; + project = project.AddDocument( + "Model.cs", + File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; + var postProcessor = new TestPostProcessor("RemovesInvalidUsings.cs"); + + var resultProject = await postProcessor.RemoveAsync(project); + var doc= resultProject.Documents + .Single(d => d.Name == "RemovesInvalidUsings.cs"); + var root = await doc.GetSyntaxRootAsync(); + var compilation = (CompilationUnitSyntax)root!; + + var typeNames = compilation + .DescendantNodes() + .OfType() + .Select(t => t.Identifier.Text) + .ToList(); + CollectionAssert.Contains(typeNames, "KeepMe"); + + var usings = compilation.Usings.Select(u => u.Name!.ToString()).ToList(); + // The invalid using should be removed + CollectionAssert.DoesNotContain(usings, "Sample.Models"); + CollectionAssert.Contains(usings, "System"); + } + + + [Test] + public async Task DoesNotRemoveValidUsings() + { + MockHelpers.LoadMockGenerator(); + var workspace = new AdhocWorkspace(); + var projectInfo = ProjectInfo.Create( + ProjectId.CreateNewId(), + VersionStamp.Create(), + name: "TestProj", + assemblyName: "TestProj", + language: LanguageNames.CSharp) + .WithMetadataReferences(new[] + { + MetadataReference.CreateFromFile(typeof(object).Assembly.Location) + }); + + var project = workspace.AddProject(projectInfo); + var folder = Helpers.GetAssetFileOrDirectoryPath(false); + project = project.AddDocument( + "DoesNotRemoveValidUsings.cs", + File.ReadAllText(Path.Join(folder, "DoesNotRemoveValidUsings.cs"))).Project; + project = project.AddDocument( + "Model.cs", + File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; + var postProcessor = new TestPostProcessor("DoesNotRemoveValidUsings.cs"); + + var resultProject = await postProcessor.RemoveAsync(project); + var doc= resultProject.Documents + .Single(d => d.Name == "DoesNotRemoveValidUsings.cs"); + var root = await doc.GetSyntaxRootAsync(); + var compilation = (CompilationUnitSyntax)root!; + + var typeNames = compilation + .DescendantNodes() + .OfType() + .Select(t => t.Identifier.Text) + .ToList(); + CollectionAssert.Contains(typeNames, "KeepMe"); + + var usings = compilation.Usings.Select(u => u.Name!.ToString()).ToList(); + CollectionAssert.Contains(usings, "Sample.Models"); + CollectionAssert.Contains(usings, "System"); + } + + [Test] + public async Task RemovesInvalidAttributes() + { + MockHelpers.LoadMockGenerator(); + var workspace = new AdhocWorkspace(); + var projectInfo = ProjectInfo.Create( + ProjectId.CreateNewId(), + VersionStamp.Create(), + name: "TestProj", + assemblyName: "TestProj", + language: LanguageNames.CSharp) + .WithMetadataReferences(new[] + { + MetadataReference.CreateFromFile(typeof(object).Assembly.Location), + MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) + }); + + var project = workspace.AddProject(projectInfo); + var folder = Helpers.GetAssetFileOrDirectoryPath(false); + const string removesInvalidAttributesFileName = "RemovesInvalidAttributes.cs"; + project = project.AddDocument( + removesInvalidAttributesFileName, + File.ReadAllText(Path.Join(folder, removesInvalidAttributesFileName))).Project; + project = project.AddDocument( + "Model.cs", + File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; + project = project.AddDocument( + "RootClass.cs", + File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; + var postProcessor = new TestPostProcessor("RootClass.cs", nonRootTypes: ["Sample.KeepMe"]); + + var resultProject = await postProcessor.RemoveAsync(project); + var doc= resultProject.Documents + .Single(d => d.Name == removesInvalidAttributesFileName); + var root = await doc.GetSyntaxRootAsync(); + var compilation = (CompilationUnitSyntax)root!; + + var namespaceDeclaration = compilation + .DescendantNodes() + .OfType() + .SingleOrDefault(t => t.Name.ToString() == "Sample"); + var output = namespaceDeclaration!.ToString(); + + Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); + } + + [Test] + public async Task RemovesInvalidAttributesAndKeepsValidAttributes() + { + MockHelpers.LoadMockGenerator(); + var workspace = new AdhocWorkspace(); + var projectInfo = ProjectInfo.Create( + ProjectId.CreateNewId(), + VersionStamp.Create(), + name: "TestProj", + assemblyName: "TestProj", + language: LanguageNames.CSharp) + .WithMetadataReferences(new[] + { + MetadataReference.CreateFromFile(typeof(object).Assembly.Location), + MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) + }); + + var project = workspace.AddProject(projectInfo); + var folder = Helpers.GetAssetFileOrDirectoryPath(false); + const string removesInvalidAttributesFileName = "RemovesInvalidAttributesAndKeepsValidAttributes.cs"; + project = project.AddDocument( + removesInvalidAttributesFileName, + File.ReadAllText(Path.Join(folder, removesInvalidAttributesFileName))).Project; + project = project.AddDocument( + "Model.cs", + File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; + project = project.AddDocument( + "RootClass.cs", + File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; + var postProcessor = new TestPostProcessor("RootClass.cs", nonRootTypes: ["Sample.KeepMe"]); + + var resultProject = await postProcessor.RemoveAsync(project); + var doc= resultProject.Documents + .Single(d => d.Name == removesInvalidAttributesFileName); + var root = await doc.GetSyntaxRootAsync(); + var compilation = (CompilationUnitSyntax)root!; + + var namespaceDeclaration = compilation + .DescendantNodes() + .OfType() + .SingleOrDefault(t => t.Name.ToString() == "Sample"); + var output = namespaceDeclaration!.ToString(); + + Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); + } + + [Test] + public async Task RemovesInvalidAttributesAndKeepsValidAttributesNoDocs() + { + MockHelpers.LoadMockGenerator(); + var workspace = new AdhocWorkspace(); + var projectInfo = ProjectInfo.Create( + ProjectId.CreateNewId(), + VersionStamp.Create(), + name: "TestProj", + assemblyName: "TestProj", + language: LanguageNames.CSharp) + .WithMetadataReferences(new[] + { + MetadataReference.CreateFromFile(typeof(object).Assembly.Location), + MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) + }); + + var project = workspace.AddProject(projectInfo); + var folder = Helpers.GetAssetFileOrDirectoryPath(false); + const string removesInvalidAttributesFileName = "RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs"; + project = project.AddDocument( + removesInvalidAttributesFileName, + File.ReadAllText(Path.Join(folder, removesInvalidAttributesFileName))).Project; + project = project.AddDocument( + "Model.cs", + File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; + project = project.AddDocument( + "RootClass.cs", + File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; + var postProcessor = new TestPostProcessor("RootClass.cs", nonRootTypes: ["Sample.KeepMe"]); + + var resultProject = await postProcessor.RemoveAsync(project); + var doc= resultProject.Documents + .Single(d => d.Name == removesInvalidAttributesFileName); + var root = await doc.GetSyntaxRootAsync(); + var compilation = (CompilationUnitSyntax)root!; + + var namespaceDeclaration = compilation + .DescendantNodes() + .OfType() + .SingleOrDefault(t => t.Name.ToString() == "Sample"); + var output = namespaceDeclaration!.ToString(); + + Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); + } + + [Test] + public async Task DoesNotRemoveValidAttributes() + { + MockHelpers.LoadMockGenerator(); + var workspace = new AdhocWorkspace(); + var projectInfo = ProjectInfo.Create( + ProjectId.CreateNewId(), + VersionStamp.Create(), + name: "TestProj", + assemblyName: "TestProj", + language: LanguageNames.CSharp) + .WithMetadataReferences(new[] + { + MetadataReference.CreateFromFile(typeof(object).Assembly.Location), + MetadataReference.CreateFromFile(typeof(ModelReaderWriterBuildableAttribute).Assembly.Location) + }); + + var project = workspace.AddProject(projectInfo); + var folder = Helpers.GetAssetFileOrDirectoryPath(false); + const string doesNotRemoveValidAttributesFileName = "DoesNotRemoveValidAttributes.cs"; + project = project.AddDocument( + doesNotRemoveValidAttributesFileName, + File.ReadAllText(Path.Join(folder, doesNotRemoveValidAttributesFileName))).Project; + project = project.AddDocument( + "Model.cs", + File.ReadAllText(Path.Join(folder, "Model.cs"))).Project; + project = project.AddDocument( + "RootClass.cs", + File.ReadAllText(Path.Join(folder, "RootClass.cs"))).Project; + var postProcessor = new TestPostProcessor("RootClass.cs"); + + var resultProject = await postProcessor.RemoveAsync(project); + var doc= resultProject.Documents + .Single(d => d.Name == doesNotRemoveValidAttributesFileName); + var root = await doc.GetSyntaxRootAsync(); + var compilation = (CompilationUnitSyntax)root!; + + var namespaceDeclaration = compilation + .DescendantNodes() + .OfType() + .SingleOrDefault(t => t.Name.ToString() == "Sample"); + var output = namespaceDeclaration!.ToString(); + + Assert.AreEqual(Helpers.GetExpectedFromFile().TrimEnd(), output, "The output should match the expected content."); + } + + private class TestPostProcessor : PostProcessor + { + private readonly string _rootFile; + + public TestPostProcessor(string rootFile, IEnumerable? nonRootTypes = null) : base([], additionalNonRootTypeNames: nonRootTypes) + { + _rootFile = rootFile; + } + + protected override Task IsRootDocument(Document document) + { + return document.Name == _rootFile ? Task.FromResult(true) : Task.FromResult(false); + } + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs new file mode 100644 index 00000000000..0ee90baa775 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes.cs @@ -0,0 +1,11 @@ +namespace Sample +{ + /// + /// Class docs that should be kept. + /// + [ModelReaderWriterBuildable(typeof(Model))] + public class KeepMe + { + public void Foo() => Console.WriteLine(""hello""); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs new file mode 100644 index 00000000000..e44051470ab --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/DoesNotRemoveValidAttributes.cs @@ -0,0 +1,15 @@ +using System; +using System.ClientModel.Primitives; +using Sample.Models; + +namespace Sample +{ + /// + /// Class docs that should be kept. + /// + [ModelReaderWriterBuildable(typeof(Model))] + public class KeepMe + { + public void Foo() => Console.WriteLine(""hello""); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs new file mode 100644 index 00000000000..20f76bb882a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/Model.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public class Model + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs new file mode 100644 index 00000000000..b799f680532 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidAttributes/RootClass.cs @@ -0,0 +1,7 @@ +namespace Sample +{ + public class RootClass + { + public void Foo() => (new KeepMe()).Foo(); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs new file mode 100644 index 00000000000..ba2ed5a94b2 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/DoesNotRemoveValidUsings.cs @@ -0,0 +1,11 @@ +using System; +using Sample.Models; + +namespace Sample +{ + public class KeepMe + { + public Model Foo() => new Model(); + } +} +"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs new file mode 100644 index 00000000000..20f76bb882a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/DoesNotRemoveValidUsings/Model.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public class Model + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs new file mode 100644 index 00000000000..11498989c01 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes.cs @@ -0,0 +1,10 @@ +namespace Sample +{ + /// + /// Class docs that should be kept. + /// + public class KeepMe + { + public void Foo() => Console.WriteLine(""hello""); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs new file mode 100644 index 00000000000..20f76bb882a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/Model.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public class Model + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs new file mode 100644 index 00000000000..e44051470ab --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RemovesInvalidAttributes.cs @@ -0,0 +1,15 @@ +using System; +using System.ClientModel.Primitives; +using Sample.Models; + +namespace Sample +{ + /// + /// Class docs that should be kept. + /// + [ModelReaderWriterBuildable(typeof(Model))] + public class KeepMe + { + public void Foo() => Console.WriteLine(""hello""); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs new file mode 100644 index 00000000000..b799f680532 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributes/RootClass.cs @@ -0,0 +1,7 @@ +namespace Sample +{ + public class RootClass + { + public void Foo() => (new KeepMe()).Foo(); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs new file mode 100644 index 00000000000..a0eda596240 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes.cs @@ -0,0 +1,11 @@ +namespace Sample +{ + /// + /// Class docs that should be kept. + /// + [ModelReaderWriterBuildable(typeof(object))] + public class KeepMe + { + public void Foo() => Console.WriteLine("hello"); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs new file mode 100644 index 00000000000..20f76bb882a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/Model.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public class Model + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs new file mode 100644 index 00000000000..afa5fb8d462 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RemovesInvalidAttributesAndKeepsValidAttributes.cs @@ -0,0 +1,16 @@ +using System; +using System.ClientModel.Primitives; +using Sample.Models; + +namespace Sample +{ + /// + /// Class docs that should be kept. + /// + [ModelReaderWriterBuildable(typeof(Model))] + [ModelReaderWriterBuildable(typeof(object))] + public class KeepMe + { + public void Foo() => Console.WriteLine("hello"); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs new file mode 100644 index 00000000000..b799f680532 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributes/RootClass.cs @@ -0,0 +1,7 @@ +namespace Sample +{ + public class RootClass + { + public void Foo() => (new KeepMe()).Foo(); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs new file mode 100644 index 00000000000..4ffad5d191e --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs @@ -0,0 +1,8 @@ +namespace Sample +{ + [ModelReaderWriterBuildable(typeof(object))] + public class KeepMe + { + public void Foo() => Console.WriteLine("hello"); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs new file mode 100644 index 00000000000..20f76bb882a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/Model.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public class Model + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs new file mode 100644 index 00000000000..1b99245b052 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs.cs @@ -0,0 +1,13 @@ +using System; +using System.ClientModel.Primitives; +using Sample.Models; + +namespace Sample +{ + [ModelReaderWriterBuildable(typeof(Model))] + [ModelReaderWriterBuildable(typeof(object))] + public class KeepMe + { + public void Foo() => Console.WriteLine("hello"); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs new file mode 100644 index 00000000000..b799f680532 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidAttributesAndKeepsValidAttributesNoDocs/RootClass.cs @@ -0,0 +1,7 @@ +namespace Sample +{ + public class RootClass + { + public void Foo() => (new KeepMe()).Foo(); + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs new file mode 100644 index 00000000000..20f76bb882a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/Model.cs @@ -0,0 +1,6 @@ +namespace Sample.Models +{ + public class Model + { + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs new file mode 100644 index 00000000000..c8e295f4ef6 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/PostProcessing/TestData/PostProcessorTests/RemovesInvalidUsings/RemovesInvalidUsings.cs @@ -0,0 +1,11 @@ +using System; +using Sample.Models; // initially valid + +namespace Sample +{ + public class KeepMe + { + public void Foo() => Console.WriteLine(""hello""); + } +} +"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs index 4a9a35dea67..4fd64c9b4c6 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs @@ -334,7 +334,7 @@ public void ExtensibleFloatEnum_HasOnlyNonNullableImplicitOperator() } [Test] - public void PublicEnumsAreIncludedInAdditionalRootTypes() + public void PublicModelsAreIncludedInAdditionalRootTypes() { var inputEnum = InputFactory.StringEnum( "StringEnum", @@ -349,11 +349,6 @@ public void PublicEnumsAreIncludedInAdditionalRootTypes() var rootTypes = CodeModelGenerator.Instance.AdditionalRootTypes; Assert.IsTrue(rootTypes.Contains("Sample.Models.StringEnum")); - - using var session = ProviderReferenceMapAnalyzer.PrepareForGeneration( - CodeModelGenerator.Instance.OutputLibrary.TypeProviders.ToList()); - Assert.IsTrue(enumProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(enumProvider)); } [Test] diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs index c35f1968d76..1bdf4020167 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/ModelFactoriesCustomizationTests.cs @@ -177,32 +177,6 @@ public async Task OmitsModelFactoryMethodIfParamTypeInternal() Assert.IsNull(modelFactory); } - // This test validates that a derived model customized to be internal does not get a - // public model factory method just because its base model remains public. - [Test] - public async Task OmitsModelFactoryMethodIfDerivedModelTypeInternal() - { - var baseModel = InputFactory.Model( - "baseModel", - properties: [InputFactory.Property("BaseProp", InputPrimitiveType.String)]); - var derivedModel = InputFactory.Model( - "derivedModel", - properties: [InputFactory.Property("DerivedProp", InputPrimitiveType.String)], - baseModel: baseModel); - - var mockGenerator = await MockHelpers.LoadMockGeneratorAsync( - inputModelTypes: [baseModel, derivedModel], - compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); - var csharpGen = new CSharpGen(); - - await csharpGen.ExecuteAsync(); - - var modelFactory = mockGenerator.Object.OutputLibrary.TypeProviders.SingleOrDefault(t => t is ModelFactoryProvider); - Assert.IsNotNull(modelFactory); - CollectionAssert.Contains(modelFactory!.Methods.Select(m => m.Signature.Name), "BaseModel"); - CollectionAssert.DoesNotContain(modelFactory.Methods.Select(m => m.Signature.Name), "DerivedModel"); - } - [TestCase(true)] [TestCase(false)] public async Task CanCustomizeModelFullConstructor(bool extraParameters) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs deleted file mode 100644 index bdb2034f5f0..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelFactories/TestData/ModelFactoriesCustomizationTests/OmitsModelFactoryMethodIfDerivedModelTypeInternal/DerivedModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Sample.Models -{ - internal partial class DerivedModel - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs index d96e98a9d8e..7f3ea5cd1ff 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ClientCustomizationTests.cs @@ -405,7 +405,7 @@ private class ClientTypeProvider : TypeProvider public MethodProvider[] MethodProviders { get; set; } = []; public ConstructorProvider[] ConstructorProviders { get; set; } = []; - protected override string BuildRelativeFilePath() => $"{Name}.cs"; + protected override string BuildRelativeFilePath() => "."; protected override string BuildName() => "MockInputClient"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs index 336318f812a..9f9945a2360 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs @@ -1538,11 +1538,6 @@ public void PublicModelsAreIncludedInAdditionalRootTypes() var rootTypes = CodeModelGenerator.Instance.AdditionalRootTypes; Assert.IsTrue(rootTypes.Contains("Sample.Models.MockInputModel")); - - using var session = ProviderReferenceMapAnalyzer.PrepareForGeneration( - CodeModelGenerator.Instance.OutputLibrary.TypeProviders.ToList()); - Assert.IsTrue(modelProvider!.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(modelProvider)); } [Test] @@ -1582,11 +1577,12 @@ public void KeepSetsReflectTypeProvidersAddedAfterFirstAccess() // Regression test for two complementary fixes: // - // 1. ModelProvider no longer registers itself with AddTypeToKeep from its constructor, - // so construction does not dispatch a virtual call chain - // (AddTypeToKeep -> TypeProvider.Type -> BaseType -> virtual BuildBaseType()) on a - // partially-constructed derived ModelProvider whose override reads derived-class fields - // that are still uninitialized. + // 1. ModelProvider no longer registers itself with AddTypeToKeep from its constructor; + // registration is performed by TypeFactory.CreateModel after construction completes. + // This mirrors the EnumProvider lifecycle and prevents a virtual call chain + // (AddTypeToKeep -> TypeProvider.Type -> BaseType -> virtual BuildBaseType()) from + // being dispatched on a partially-constructed derived ModelProvider whose override + // reads derived-class fields that are still uninitialized. // // 2. AddTypeToKeep(TypeProvider) defers FQN resolution until the keep set is consumed, // so even ctor-time callers cannot force premature TypeProvider.Type evaluation. diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs index 2310e2ea7b6..9ceee883bd4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/NamedTypeSymbolProviderTests.cs @@ -6,11 +6,9 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; using Microsoft.TypeSpec.Generator.Expressions; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Providers; -using Microsoft.TypeSpec.Generator.SourceInput; using Microsoft.TypeSpec.Generator.Tests.Common; using NUnit.Framework; using static Microsoft.TypeSpec.Generator.Snippets.Snippet; @@ -95,31 +93,6 @@ public async Task ValidateSelfReferentialGenericBaseType() Assert.IsNull(namedTypeSymbolProvider.Type.BaseType); } - [Test] - public void ValidateGenericTypeAndMethodArguments() - { - var compilation = CSharpCompilation.Create( - "Customization", - [CSharpSyntaxTree.ParseText(""" - namespace Sample - { - public class GenericType - { - public TMethod Convert(TType value, TMethod fallback) => fallback; - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var symbol = compilation.GetTypeByMetadataName("Sample.GenericType`1"); - Assert.IsNotNull(symbol); - - var provider = new NamedTypeSymbolProvider(symbol!, compilation); - var method = provider.Methods.Single(method => method.Signature.Name == "Convert"); - - Assert.AreEqual("TType", provider.Type.Arguments.Single().Name); - Assert.AreEqual("TMethod", method.Signature.GenericArguments!.Single().Name); - } - [Test] public void ValidateNamespaceNestedType() { @@ -397,68 +370,6 @@ public async Task ValidatePartialMethodWithBodyIsNotDetectedAsPartialDeclaration Assert.IsFalse(doIt.IsPartialMethod, "Partial methods with bodies should not be treated as customization signals."); } - [Test] - public async Task BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "CustomClient")!; - var provider = new NamedTypeSymbolProvider(symbol, compilation); - - Assert.IsTrue(provider.BodyDependencyTypes.Any(type => type.FullyQualifiedName == "Sample.Models.ReferencedModel")); - } - - [Test] - public async Task PublicInterfaceMemberSignatureDependenciesAreIncluded() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "ICustomApi")!; - var provider = new NamedTypeSymbolProvider(symbol, compilation); - - Assert.IsTrue(provider.SignatureDependencyTypes.Any(type => type.FullyQualifiedName == "Sample.Models.GeneratedModel")); - } - - [Test] - public async Task PublicNestedMemberSignatureDependenciesAreIncluded() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "CustomApi")!; - var provider = new NamedTypeSymbolProvider(symbol, compilation); - - Assert.IsTrue(provider.SignatureDependencyTypes.Any(type => type.FullyQualifiedName == "Sample.Models.GeneratedModel")); - } - - [Test] - public async Task SourceInputHelperYieldsNestedSymbols() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - - var symbols = Microsoft.TypeSpec.Generator.SourceInput.SourceInputHelper.GetSymbols(compilation.Assembly.Modules.First().GlobalNamespace); - - Assert.IsTrue(symbols.Any(symbol => symbol.MetadataName == "Nested")); - } - - [Test] - public async Task SourceInputLookupUsesFullNestedDeclaringTypeName() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - var sourceInputModel = new SourceInputModel(compilation, lastContract: null); - - var nestedType = sourceInputModel.FindForTypeInCustomization("Sample", "Target", "Outer+Middle"); - - Assert.IsNotNull(nestedType); - Assert.AreEqual("Sample.Outer+Middle+Target", ((NamedTypeSymbolProvider)nestedType!).MetadataName); - } - - [Test] - public async Task MetadataNamePreservesGenericArity() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - var symbol = CompilationHelper.GetSymbol(compilation.Assembly.Modules.First().GlobalNamespace, "CustomModel`1")!; - var provider = new NamedTypeSymbolProvider(symbol, compilation); - - Assert.AreEqual("Sample.Models.CustomModel`1", provider.MetadataName); - } - // Operator signatures parsed from a customization partial must compare equal to the corresponding generated signatures. [Test] public async Task ValidateOperatorSignaturesMatchGenerated() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs deleted file mode 100644 index 01ad16aa4ac..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/BodyDependenciesIncludeUsingNamespaceCandidatesForUnresolvedTypeSyntax/CustomClient.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Sample.Models; - -namespace Sample -{ - public partial class CustomClient - { - public void Test(object response) - { - ReferencedModel result = (ReferencedModel)response; - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs deleted file mode 100644 index 0499f0d3f56..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/MetadataNamePreservesGenericArity/CustomModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample.Models -{ - public partial class CustomModel - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs deleted file mode 100644 index 61c46fefacf..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicInterfaceMemberSignatureDependenciesAreIncluded/CustomApi.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Sample.Models; - -namespace Sample -{ - public partial interface ICustomApi - { - GeneratedModel Item { get; } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs deleted file mode 100644 index bee92bb5c88..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/PublicNestedMemberSignatureDependenciesAreIncluded/CustomApi.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Sample.Models; - -namespace Sample -{ - public partial class CustomApi - { - public class Nested - { - public GeneratedModel Item { get; } - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs deleted file mode 100644 index 7116cc92bfe..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputHelperYieldsNestedSymbols/CustomApi.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Sample -{ - public partial class CustomApi - { - public class Nested - { - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs deleted file mode 100644 index 8e4353bc359..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/NamedTypeSymbolProviders/TestData/NamedTypeSymbolProviderTests/SourceInputLookupUsesFullNestedDeclaringTypeName/NestedTypes.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Sample -{ - public partial class Outer - { - public partial class Middle - { - public class Target - { - } - } - } - - public partial class Other - { - public class Target - { - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs index c55dc7aadab..34e119f008a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs @@ -900,7 +900,7 @@ public void TestCanUpdateAttributes() new MethodSignature("TestMethod", $"", MethodSignatureModifiers.Public, null, $"", []), Snippet.Throw(Snippet.Null), new TestTypeProvider())]); typeProvider.Update(attributes: [ - new AttributeStatement(typeof(ObsoleteAttribute)) + new(typeof(ObsoleteAttribute)) ]); Assert.IsNotNull(typeProvider.Attributes); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs deleted file mode 100644 index 945f24e2d9f..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/ProviderReferenceMapAnalyzerTests.cs +++ /dev/null @@ -1,1464 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.TypeSpec.Generator.Expressions; -using Microsoft.TypeSpec.Generator.Input; -using Microsoft.TypeSpec.Generator.Primitives; -using Microsoft.TypeSpec.Generator.Providers; -using Microsoft.TypeSpec.Generator.Tests.Common; -using Microsoft.TypeSpec.Generator.Statements; -using Microsoft.TypeSpec.Generator.Tests.Providers.NamedTypeSymbolProviders; -using Microsoft.TypeSpec.Generator.Tests.TestHelpers; -using NUnit.Framework; -using static Microsoft.TypeSpec.Generator.Snippets.Snippet; - -namespace Microsoft.TypeSpec.Generator.Tests.ReferenceMap -{ - public class ProviderReferenceMapAnalyzerTests - { - [SetUp] - public void SetUp() - { - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - } - - [TearDown] - public void TearDown() - { - ProviderReferenceMapAnalyzer.ResetPreWriteAccessibility(); - } - - [Test] - public void NonRootKeptTypesKeepTheirAccessibility() - { - var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(context)); - CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([context]); - - Assert.IsTrue(context.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(context.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public void NonRootKeptTypesAreWrittenWithoutRootingOtherTypes() - { - var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); - var unusedModel = new TestTypeProvider("UnusedModel", TypeSignatureModifiers.Public); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(context, unusedModel)); - CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.Analyze([context, unusedModel]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(context)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(unusedModel)); - } - - [Test] - public void ProviderNamedClientProviderIsNotTreatedAsClientWithoutCapability() - { - var sameNamedProvider = new ClientProvider(); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(sameNamedProvider)); - - ProviderReferenceMapAnalyzer.Analyze([sameNamedProvider]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(sameNamedProvider)); - } - - [Test] - public void RootedTypeWithInternalPartialDeclarationRemainsPublic() - { - var model = new ModelProvider(InputFactory.Model("PublicModel", "Sample.Models", access: "public")); - var internalPartial = new TestTypeProvider( - "PublicModel", - TypeSignatureModifiers.Internal | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class, - ns: "Sample.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(model, internalPartial)); - CodeModelGenerator.Instance.AddTypeToKeep(model); - - using var session = ProviderReferenceMapAnalyzer.PrepareForGeneration([model, internalPartial]); - - Assert.IsTrue(model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void AmbiguousNamespaceLessCustomCodeBodyDependencyDoesNotRootGeneratedTypeBySimpleName() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", CreateNamedType("Error", string.Empty)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var generatedError = new TestTypeProvider("Error", TypeSignatureModifiers.Public, ns: "Sample.Models"); - var otherGeneratedError = new TestTypeProvider("Error", TypeSignatureModifiers.Public, ns: "Other.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedError, otherGeneratedError)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, generatedError, otherGeneratedError]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedError)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(otherGeneratedError)); - } - - [Test] - public void NamespaceLessCustomCodeBodyDependencyRootsGeneratedTypeInCustomCodeNamespace() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("ReferencedModel", string.Empty)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var referencedModel = new TestTypeProvider("ReferencedModel", TypeSignatureModifiers.Public, ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, referencedModel)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, referencedModel]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(referencedModel)); - } - - [Test] - public void NamespaceLessCustomCodeBodyDependencyRootsGeneratedTypeInParentNamespace() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample.Child", CreateNamedType("ReferencedModel", string.Empty)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample.Child"); - var referencedModel = new TestTypeProvider("ReferencedModel", TypeSignatureModifiers.Public, ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, referencedModel)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, referencedModel]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(referencedModel)); - } - - [Test] - public void NamespaceLessCustomCodeGenericBodyDependencyRootsGeneratedTypeInCustomCodeNamespace() - { - var genericArgument = CreateNamedType("T", string.Empty); - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("ErrorResult", string.Empty, genericArgument)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var errorResult = new GenericTestTypeProvider("ErrorResult", TypeSignatureModifiers.Internal, "Sample", genericArgument); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, errorResult)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, errorResult]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(errorResult)); - } - - [Test] - public void NamespaceLessGeneratedGenericBodyDependencyRootsGeneratedTypeInProviderNamespace() - { - var genericArgument = CreateNamedType("T", string.Empty); - var provider = new BodyDependencyTestTypeProvider("ClientPipelineExtensions", "Sample", CreateNamedType("ErrorResult", "Microsoft.TypeSpec.Generator.ClientModel.Providers", genericArgument)); - var errorResult = new GenericTestTypeProvider("ErrorResult", TypeSignatureModifiers.Internal, "Sample", genericArgument); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(provider, errorResult)); - CodeModelGenerator.Instance.AddTypeToKeep(provider.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([provider, errorResult]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(provider)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(errorResult)); - } - - [Test] - public void UnionVariantPropertyReferenceOnlyMatchesFullyQualifiedModelName() - { - var keptVariant = new ModelProvider(InputFactory.Model("Variant", "Sample")); - var collidingVariant = new ModelProvider(InputFactory.Model("Variant", "Other")); - var client = new ClientTestTypeProvider("SampleClient", "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, keptVariant, collidingVariant)); - client.Update(properties: - [ - new PropertyProvider( - $"", - MethodSignatureModifiers.Public, - CSharpType.FromUnion([keptVariant.Type, typeof(string)]), - "Value", - new AutoPropertyBody(false), - client) - ]); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, keptVariant, collidingVariant]); - - Assert.IsTrue(keptVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(collidingVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void UnionVariantEnumRemainsPublicWhenReferencedByPublicProperty() - { - var inputEnum = InputFactory.StringEnum( - "Variant", - [("One", "one")], - access: null!, - clientNamespace: "Sample"); - MockHelpers.LoadMockGenerator(inputEnumTypes: [inputEnum]); - var variant = CodeModelGenerator.Instance.OutputLibrary.TypeProviders - .OfType() - .Single(provider => provider.Name == "Variant"); - var client = new ClientTestTypeProvider("SampleClient", "Sample"); - client.Update(properties: - [ - new PropertyProvider( - $"", - MethodSignatureModifiers.Public, - CSharpType.FromUnion([variant.Type, typeof(string)]), - "Value", - new AutoPropertyBody(false), - client) - ]); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, variant]); - - Assert.IsTrue(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public void DisconnectedUnionVariantIsNotPublicRoot() - { - var inputVariant = InputFactory.Model("Variant", "Sample", access: null!); - var variant = new ModelProvider(inputVariant); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(variant)); - CodeModelGenerator.Instance.TypeFactory.CreateCSharpType( - InputFactory.Union([inputVariant, InputPrimitiveType.String])); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([variant]); - - Assert.IsTrue(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(variant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void KnownDiscriminatorVariantRemainsPublicWhenBaseIsRooted() - { - var discriminator = InputFactory.Property( - "kind", - InputPrimitiveType.String, - isRequired: true, - isDiscriminator: true); - var derivedInput = InputFactory.Model( - "KnownVariant", - "Sample", - access: null!, - discriminatedKind: "known"); - var baseInput = InputFactory.Model( - "BaseModel", - "Sample", - access: null!, - properties: [discriminator], - derivedModels: [derivedInput], - discriminatorProperty: discriminator); - MockHelpers.LoadMockGenerator(inputModelTypes: [baseInput, derivedInput]); - var providers = CodeModelGenerator.Instance.OutputLibrary.TypeProviders; - var baseProvider = providers.OfType().Single(provider => provider.Name == "BaseModel"); - var derivedProvider = providers.OfType().Single(provider => provider.Name == "KnownVariant"); - CodeModelGenerator.Instance.AddTypeToKeep(baseProvider); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(providers); - - Assert.IsTrue(baseProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(derivedProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void DisconnectedKnownDiscriminatorVariantIsNotPublicRoot() - { - var discriminator = InputFactory.Property( - "kind", - InputPrimitiveType.String, - isRequired: true, - isDiscriminator: true); - var derivedInput = InputFactory.Model( - "KnownVariant", - "Sample", - access: null!, - discriminatedKind: "known"); - var baseInput = InputFactory.Model( - "BaseModel", - "Sample", - access: null!, - properties: [discriminator], - derivedModels: [derivedInput], - discriminatorProperty: discriminator); - MockHelpers.LoadMockGenerator(inputModelTypes: [baseInput, derivedInput]); - var providers = CodeModelGenerator.Instance.OutputLibrary.TypeProviders; - var baseProvider = providers.OfType().Single(provider => provider.Name == "BaseModel"); - var derivedProvider = providers.OfType().Single(provider => provider.Name == "KnownVariant"); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility(providers); - - Assert.IsTrue(baseProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(derivedProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public void CollectionUnionVariantPropertyReferenceOnlyMatchesFullyQualifiedModelName() - { - var keptVariant = new ModelProvider(InputFactory.Model("Variant", "Sample")); - var collidingVariant = new ModelProvider(InputFactory.Model("Variant", "Other")); - var client = new ClientTestTypeProvider("SampleClient", "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, keptVariant, collidingVariant)); - client.Update(properties: - [ - new PropertyProvider( - $"", - MethodSignatureModifiers.Public, - new CSharpType(typeof(IList<>), CSharpType.FromUnion([keptVariant.Type, typeof(string)])), - "Values", - new AutoPropertyBody(false), - client) - ]); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, keptVariant, collidingVariant]); - - Assert.IsTrue(keptVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(collidingVariant.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void QualifiedExternalBuildableTypeDoesNotMatchRemovedGeneratedTypeBySimpleName() - { - var generatedFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Sample"); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => new TestOutputLibrary(generatedFoo), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - - ProviderReferenceMapAnalyzer.Analyze([generatedFoo]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedFoo)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.IsResolvableBuildableType(CreateNamedType("Foo", "Contoso"))); - Assert.IsFalse(ProviderReferenceMapAnalyzer.IsResolvableBuildableType(CreateNamedType("Foo", string.Empty))); - } - - [Test] - public void AmbiguousUnqualifiedBuildableTypeDoesNotMatchRemovedProviderBySimpleName() - { - var keptFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Kept"); - var removedFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Removed"); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => new TestOutputLibrary(removedFoo, keptFoo), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - CodeModelGenerator.Instance.AddTypeToKeep(keptFoo.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([keptFoo, removedFoo]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(keptFoo)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedFoo)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.IsResolvableBuildableType(CreateNamedType("Foo", string.Empty))); - } - - [Test] - public void UnqualifiedGenericBuildableTypeUsesArityWhenMatchingRemovedProvider() - { - var genericArgument = CreateNamedType("T", string.Empty); - var keptFoo = new GeneratedModelTestTypeProvider("Foo", TypeSignatureModifiers.Public, ns: "Kept"); - var removedGenericFoo = new GenericTestTypeProvider( - "Foo`1", - TypeSignatureModifiers.Public, - "Removed", - genericArgument); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => new TestOutputLibrary(keptFoo, removedGenericFoo), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - CodeModelGenerator.Instance.AddTypeToKeep(keptFoo.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([keptFoo, removedGenericFoo]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedGenericFoo)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.IsResolvableBuildableType( - CreateNamedType("Foo", string.Empty, genericArgument))); - } - - [Test] - public void HelperRootBodyDependencyRootsGeneratedGenericDependency() - { - var genericArgument = CreateNamedType("T", string.Empty); - var client = new HelperDependencyTestTypeProvider("SampleClient", "Sample", CreateNamedType("ClientPipelineExtensions", "Microsoft.TypeSpec.Generator.ClientModel.Providers")); - var pipelineExtensions = new BodyDependencyTestTypeProvider("ClientPipelineExtensions", "Sample", CreateNamedType("ErrorResult", "Microsoft.TypeSpec.Generator.ClientModel.Providers", genericArgument)); - var errorResult = new GenericTestTypeProvider("ErrorResult", TypeSignatureModifiers.Internal, "Sample", genericArgument); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, pipelineExtensions, errorResult)); - CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([client, pipelineExtensions, errorResult]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(client)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pipelineExtensions)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(errorResult)); - } - - [Test] - public void UnreferencedHelperDependencyDoesNotKeepUnreferencedSiblingHelper() - { - var client = new HelperDependencyTestTypeProvider("SampleClient", "Sample", CreateNamedType("ClientPipelineExtensions", "Sample")); - var pipelineExtensions = new TestTypeProvider("ClientPipelineExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); - var cancellationTokenExtensions = new TestTypeProvider("CancellationTokenExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, pipelineExtensions, cancellationTokenExtensions)); - CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([client, pipelineExtensions, cancellationTokenExtensions]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(client)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pipelineExtensions)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(cancellationTokenExtensions)); - } - - [Test] - public async Task LastContractInternalHelperDoesNotRootAbsentGeneratedHelper() - { - var lastContractCompilation = CSharpCompilation.Create( - "LastContract", - [CSharpSyntaxTree.ParseText(""" - namespace Sample - { - internal static class ClientPipelineExtensions - { - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var client = new TestTypeProvider("SampleClient", TypeSignatureModifiers.Public, ns: "Sample"); - var pipelineExtensions = new TestTypeProvider("ClientPipelineExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(client, pipelineExtensions), - lastContractCompilation: () => Task.FromResult(lastContractCompilation)); - CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([client, pipelineExtensions]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(client)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pipelineExtensions)); - } - - [Test] - public void NamespaceLessCustomCodeBodyDependencyDoesNotRootGeneratedTypeInDifferentNamespace() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("ReferencedModel", string.Empty)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var referencedModel = new TestTypeProvider("ReferencedModel", TypeSignatureModifiers.Public, ns: "Other.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, referencedModel)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, referencedModel]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(referencedModel)); - } - - [Test] - public void NamespaceLessCustomCodeBodyDependencyDoesNotRootInternalModelWithSameNamespaceMemberName() - { - var customCodeView = new BodyDependencyTestTypeProvider( - "CustomSetting", - "Sample", - [CreateNamedType("Key", string.Empty)], - [new PropertyProvider($"", MethodSignatureModifiers.Public, typeof(string), "Key", new AutoPropertyBody(true), TestTypeProvider.Empty)]); - var customType = new CustomizableTestTypeProvider("CustomSetting", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var generatedKey = new TestTypeProvider("Key", TypeSignatureModifiers.Internal, ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedKey)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, generatedKey]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedKey)); - } - - [Test] - public void CustomCodeBodyDependencyOnExternalTypeDoesNotRootGeneratedTypeBySimpleName() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("OperationState", "Azure")); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var generatedOperationState = new TestTypeProvider("OperationState", TypeSignatureModifiers.Internal, ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedOperationState)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, generatedOperationState]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(customType)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(generatedOperationState)); - } - - [Test] - public void UnregisteredCustomCodeMethodDependencyDoesNotRootGeneratedExtensionProvider() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("SetValue", string.Empty)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var extensionProvider = new ExtensionMethodTestTypeProvider("GeneratedExtensions", "SetValue", ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, extensionProvider)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, extensionProvider]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(extensionProvider)); - } - - [Test] - public void AmbiguousCustomCodeExtensionMethodDependencyDoesNotRootGeneratedProvider() - { - var customCodeView = new BodyDependencyTestTypeProvider("CustomType", "Sample", CreateNamedType("SetValue", string.Empty)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var firstExtensionProvider = new ExtensionMethodTestTypeProvider("FirstExtensions", "SetValue", ns: "Sample"); - var secondExtensionProvider = new ExtensionMethodTestTypeProvider("SecondExtensions", "SetValue", ns: "Sample"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, firstExtensionProvider, secondExtensionProvider)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([customType, firstExtensionProvider, secondExtensionProvider]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(firstExtensionProvider)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(secondExtensionProvider)); - } - - [Test] - public void GeneratedBodyExtensionCallRootsProviderByMethodAndReceiverType() - { - var requestContextType = CreateNamedType("RequestContext", "Azure"); - var otherContextType = CreateNamedType("OtherContext", "Azure"); - var client = new ClientTestTypeProvider("SampleClient", "Sample"); - client.Update(methods: - [ - new MethodProvider( - new MethodSignature("Process", $"", MethodSignatureModifiers.Public, typeof(void), $"", []), - new InvokeMethodExpression(new VariableExpression(requestContextType, "context"), "Parse", []), - client) - ]); - var requestContextExtensions = new ExtensionMethodTestTypeProvider("RequestContextExtensions", "Parse", "Sample", requestContextType); - var otherContextExtensions = new ExtensionMethodTestTypeProvider("OtherContextExtensions", "Parse", "Sample", otherContextType); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, requestContextExtensions, otherContextExtensions)); - CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([client, requestContextExtensions, otherContextExtensions]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(requestContextExtensions)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(otherContextExtensions)); - } - - [Test] - public async Task CustomCodeTypeDoesNotRootGeneratedExtensionsTypeByNamingConvention() - { - var customCompilation = CSharpCompilation.Create( - "Customization", - [CSharpSyntaxTree.ParseText(""" - namespace Sample - { - public partial class Widget - { - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var client = new ClientTestTypeProvider("SampleClient", "Sample"); - var widgetExtensions = new TestTypeProvider("WidgetExtensions", TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: "Sample"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(client, widgetExtensions), - compilation: () => Task.FromResult(customCompilation)); - CodeModelGenerator.Instance.AddTypeToKeep(client.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([client, widgetExtensions]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(widgetExtensions)); - } - - [Test] - public void PublicCustomSignatureExternalTypeDoesNotPublicizeGeneratedTypeBySimpleName() - { - var customCodeView = new SignatureDependencyTestTypeProvider( - "CustomType", - TypeSignatureModifiers.Public, - CreateNamedType("Action", "System")); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Sample"); - var generatedAction = new TestTypeProvider("Action", TypeSignatureModifiers.Internal, ns: "Sample.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedAction)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - CodeModelGenerator.Instance.AddTypeToKeep(generatedAction.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([customType, generatedAction]); - - Assert.IsTrue(generatedAction.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(generatedAction.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void InternalizeModeDoesNotRemoveUnreferencedProviders() - { - var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); - var unusedModel = new TestTypeProvider("UnusedModel", TypeSignatureModifiers.Public); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => new TestOutputLibrary(context, unusedModel), - configuration: "{\"unreferenced-types-handling\":\"internalize\"}"); - CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.Analyze([context, unusedModel]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(context)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(unusedModel)); - Assert.IsEmpty(ProviderReferenceMapAnalyzer.LatestResult!.RemoveCandidates); - } - - [Test] - public void SerializationProviderInfrastructureRootsUseProviderBodyDependencies() - { - var optional = new TestTypeProvider("Optional", TypeSignatureModifiers.Public); - var modelSerializationExtensions = new TestTypeProvider("ModelSerializationExtensions", TypeSignatureModifiers.Public); - var serializationProvider = new BodyDependencyTestTypeProvider( - "SampleModelSerializer", - ns: null, - optional.Type, - modelSerializationExtensions.Type); - var model = new ClientTestTypeProvider("SampleModel", serializationProvider); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary( - model, - serializationProvider, - optional, - modelSerializationExtensions)); - - ProviderReferenceMapAnalyzer.Analyze([model, serializationProvider, optional, modelSerializationExtensions]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(serializationProvider)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(optional)); - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(modelSerializationExtensions)); - } - - [Test] - public async Task InternalCustomizationTypeDoesNotInternalizeGeneratedTypeWithSameSimpleName() - { - var customCompilation = CompilationHelper.LoadCompilation( - [new TestTypeProvider("Error", TypeSignatureModifiers.Internal, ns: "Custom.Models")]); - var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); - var generatedError = new TestTypeProvider("Error", TypeSignatureModifiers.Public, ns: "Generated.Models"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(context, generatedError), - compilation: () => Task.FromResult(customCompilation)); - CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName); - CodeModelGenerator.Instance.AddTypeToKeep(generatedError.Type.FullyQualifiedName); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([context, generatedError]); - - Assert.IsTrue(generatedError.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(generatedError.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public async Task PublicGenericCustomizationDoesNotPublicizeGeneratedNonGenericTypeWithSameSimpleName() - { - var customCompilation = CSharpCompilation.Create( - "TestAssembly", - [CSharpSyntaxTree.ParseText(""" - namespace Generated.Models - { - public partial class SearchResult - { - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var context = new TestTypeProvider("SampleContext", TypeSignatureModifiers.Public); - var generatedSearchResult = new TestTypeProvider("SearchResult", TypeSignatureModifiers.Internal, ns: "Generated.Models"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(context, generatedSearchResult), - compilation: () => Task.FromResult(customCompilation)); - CodeModelGenerator.Instance.AddTypeToKeep(context.Type.FullyQualifiedName); - CodeModelGenerator.Instance.AddTypeToKeep(generatedSearchResult.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([context, generatedSearchResult]); - - Assert.IsTrue(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void PublicGenericCustomSignatureDoesNotRootGeneratedNonGenericTypeBySimpleName() - { - var genericArgument = CreateNamedType("T", string.Empty); - var customCodeView = new SignatureDependencyTestTypeProvider( - "CustomType", - TypeSignatureModifiers.Public, - CreateNamedType("SearchResult", "Generated.Models", genericArgument)); - var customType = new CustomizableTestTypeProvider("CustomType", TypeSignatureModifiers.Public, customCodeView, ns: "Generated.Models"); - var generatedSearchResult = new TestTypeProvider("SearchResult", TypeSignatureModifiers.Internal, ns: "Generated.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(customType, generatedSearchResult)); - CodeModelGenerator.Instance.AddTypeToKeep(customType.Type.FullyQualifiedName); - CodeModelGenerator.Instance.AddTypeToKeep(generatedSearchResult.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([customType, generatedSearchResult]); - - Assert.IsTrue(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(generatedSearchResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void PublicProviderSignatureDependencyKeepsNonRootTypePublic() - { - var client = new ClientTestTypeProvider( - "SampleClient", - "Sample", - signatureDependencyTypes: CreateNamedType("GeneratedModel", "Sample.Models")); - var generatedModel = new GeneratedModelTestTypeProvider("GeneratedModel", TypeSignatureModifiers.Public, ns: "Sample.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, generatedModel)); - CodeModelGenerator.Instance.AddTypeToKeep(generatedModel.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, generatedModel]); - - Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public void PublicProviderMethodWithNamespaceLessSignatureKeepsNonRootTypePublic() - { - var client = new ClientTestTypeProvider("SampleClient", "Sample"); - var generatedModel = new GeneratedModelTestTypeProvider("GeneratedModel", TypeSignatureModifiers.Public, ns: "Sample"); - client.Update(methods: - [ - new MethodProvider( - new MethodSignature( - "GetModel", - $"", - MethodSignatureModifiers.Public, - CreateNamedType("GeneratedModel", string.Empty), - $"", - []), - MethodBodyStatement.Empty, - client) - ]); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, generatedModel)); - CodeModelGenerator.Instance.AddTypeToKeep(generatedModel.Type.FullyQualifiedName, isRoot: false); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, generatedModel]); - - Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public async Task LastContractGenericDeclarationDoesNotRootGeneratedType() - { - var lastContractCompilation = CSharpCompilation.Create( - "LastContract", - [CSharpSyntaxTree.ParseText(""" - namespace Sample.Models - { - public partial class PageResult - { - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - - var genericArgument = CreateNamedType("T", string.Empty); - var genericPageResult = new GenericTestTypeProvider("PageResult", TypeSignatureModifiers.Public, "Sample.Models", genericArgument); - var nonGenericPageResult = new GeneratedModelTestTypeProvider("PageResult", TypeSignatureModifiers.Public, ns: "Sample.Models"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(genericPageResult, nonGenericPageResult), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", - lastContractCompilation: () => Task.FromResult(lastContractCompilation)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([genericPageResult, nonGenericPageResult]); - - Assert.IsTrue(genericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(genericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(nonGenericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(nonGenericPageResult.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public async Task LastContractNestedPublicDeclarationDoesNotRootGeneratedType() - { - var lastContractCompilation = CSharpCompilation.Create( - "LastContract", - [CSharpSyntaxTree.ParseText(""" - namespace Sample.Models - { - public partial class OuterModel - { - public partial class InnerModel - { - } - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - - var outerModel = new TestTypeProvider("OuterModel", TypeSignatureModifiers.Public, ns: "Sample.Models"); - var innerModel = new NestedTestTypeProvider("InnerModel", TypeSignatureModifiers.Public, outerModel, ns: "Sample.Models"); - outerModel.NestedTypesInternal = [innerModel]; - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(outerModel), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", - lastContractCompilation: () => Task.FromResult(lastContractCompilation)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([outerModel]); - - Assert.IsTrue(outerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(outerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(innerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(innerModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void DependenciesOfInternalizedClientAreNotPublicizedFromClientRootTraversal() - { - var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); - var client = new ClientTestTypeProvider( - "SampleClient", - "Sample", - new SignatureDependencyTestTypeProvider("SampleClient", TypeSignatureModifiers.Internal, ns: "Sample"), - signatureDependencyTypes: clientOptions.Type); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, clientOptions)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); - - Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void PublicConstructorOnInternalClientDoesNotPublicizeGeneratedOptions() - { - var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); - var customCodeView = new SignatureDependencyTestTypeProvider("SampleClient", TypeSignatureModifiers.Internal, ns: "Sample"); - var client = new ConstructorDependencyTestTypeProvider( - "SampleClient", - TypeSignatureModifiers.Public, - customCodeView, - ns: "Sample", - constructorParameterTypes: [CreateNamedType("SampleClientOptions", "Sample")]); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(client, clientOptions)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); - - Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public async Task LastContractInternalDeclarationsDoNotChangeProviderAccessibility() - { - var lastContractCompilation = CSharpCompilation.Create( - "LastContract", - [CSharpSyntaxTree.ParseText(""" - namespace Sample - { - internal partial class SampleClient - { - } - - internal partial class SampleClientOptions - { - internal enum ServiceVersion - { - V1 = 1 - } - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); - clientOptions.NestedTypesInternal = - [ - new NestedTestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, clientOptions, ns: "Sample") - ]; - var client = new ClientTestTypeProvider("SampleClient", "Sample", signatureDependencyTypes: CreateNamedType("SampleClientOptions", "Sample")); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(client, clientOptions), - lastContractCompilation: () => Task.FromResult(lastContractCompilation)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); - - Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public async Task LastContractInternalDeclarationDoesNotOverridePublicCustomPartial() - { - var lastContractCompilation = CSharpCompilation.Create( - "LastContract", - [CSharpSyntaxTree.ParseText(""" - namespace Sample - { - internal abstract partial class AbstractModel - { - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var customCodeView = new TestTypeProvider("AbstractModel", TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract, ns: "Sample"); - var model = new CustomizableTestTypeProvider("AbstractModel", TypeSignatureModifiers.Public | TypeSignatureModifiers.Abstract, customCodeView, ns: "Sample"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(model), - lastContractCompilation: () => Task.FromResult(lastContractCompilation)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([model]); - - Assert.IsTrue(model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(model.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public async Task TopLevelTypeWithSameNameAsNestedTypeDoesNotPublicizeDeclaringType() - { - var lastContractCompilation = CSharpCompilation.Create( - "LastContract", - [CSharpSyntaxTree.ParseText(""" - namespace Sample - { - public enum ServiceVersion - { - V1 = 1 - } - - internal partial class SampleClientOptions - { - internal enum ServiceVersion - { - V1 = 1 - } - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var publicServiceVersion = new TestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, ns: "Sample"); - var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); - clientOptions.NestedTypesInternal = - [ - new NestedTestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, clientOptions, ns: "Sample") - ]; - var customPublicApi = new SignatureDependencyTestTypeProvider( - "CustomPublicApi", - TypeSignatureModifiers.Public, - ns: "Sample", - CreateNamedType("ServiceVersion", "Sample")); - var generatedPublicApi = new CustomizableTestTypeProvider( - "CustomPublicApi", - TypeSignatureModifiers.Public, - customPublicApi, - ns: "Sample"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(publicServiceVersion, clientOptions, generatedPublicApi), - lastContractCompilation: () => Task.FromResult(lastContractCompilation)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([publicServiceVersion, clientOptions, generatedPublicApi]); - - Assert.IsTrue(publicServiceVersion.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(publicServiceVersion.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(generatedPublicApi.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(generatedPublicApi.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public async Task ExistingGeneratedSourceDoesNotChangeAccessibilityWithoutLastContract() - { - var outputPath = Path.Combine(TestContext.CurrentContext.WorkDirectory, "ReferenceMap", nameof(ExistingGeneratedSourceDoesNotChangeAccessibilityWithoutLastContract)); - var projectPath = Path.Combine(outputPath, "src"); - Directory.CreateDirectory(projectPath); - await File.WriteAllTextAsync(Path.Combine(projectPath, "SampleClient.cs"), """ - namespace Sample - { - internal partial class SampleClient - { - } - } - """); - await File.WriteAllTextAsync(Path.Combine(projectPath, "SampleClientOptions.cs"), """ - namespace Sample - { - internal partial class SampleClientOptions - { - internal enum ServiceVersion - { - V1 = 1 - } - } - } - """); - var clientOptions = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); - clientOptions.NestedTypesInternal = - [ - new NestedTestTypeProvider("ServiceVersion", TypeSignatureModifiers.Public | TypeSignatureModifiers.Enum, clientOptions, ns: "Sample") - ]; - var client = new ClientTestTypeProvider("SampleClient", "Sample", signatureDependencyTypes: CreateNamedType("SampleClientOptions", "Sample")); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(client, clientOptions), - configuration: "{}", - outputPath: outputPath); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, clientOptions]); - - Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(clientOptions.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsTrue(clientOptions.NestedTypes[0].DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public async Task LastContractModelFactorySignaturesDoNotRootGeneratedModels() - { - MockHelpers.LoadMockGenerator(); - var lastContract = await Helpers.GetCompilationFromDirectoryAsync(); - var pagedModel = new TestTypeProvider("PagedWidget", TypeSignatureModifiers.Public, ns: "Sample"); - var requestModel = new TestTypeProvider("WidgetRequest", TypeSignatureModifiers.Public, ns: "Sample"); - await MockHelpers.LoadMockGeneratorAsync( - createOutputLibrary: () => new TestOutputLibrary(pagedModel, requestModel), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}", - lastContractCompilation: () => Task.FromResult(lastContract)); - var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; - Assert.IsNotNull(modelFactory.LastContractView, modelFactory.Name); - - ProviderReferenceMapAnalyzer.Analyze([pagedModel, requestModel, modelFactory]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(pagedModel)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(requestModel)); - } - - [Test] - public void ApiDirectoryDoesNotChangePublicClientRootsWithoutLastContract() - { - var outputPath = Path.Combine(TestContext.CurrentContext.WorkDirectory, "ReferenceMap", nameof(ApiDirectoryDoesNotChangePublicClientRootsWithoutLastContract)); - Directory.CreateDirectory(Path.Combine(outputPath, "api")); - MockHelpers.LoadMockGenerator( - configuration: "{}", - outputPath: Path.Combine(outputPath, "src")); - var options = new TestTypeProvider("SampleClientOptions", TypeSignatureModifiers.Public, ns: "Sample"); - var client = new ClientTestTypeProvider("SampleClient", "Sample", signatureDependencyTypes: options.Type); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([client, options]); - - Assert.IsTrue(client.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(options.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void PublicCustomCodeArraySignatureKeepsGeneratedTypePublic() - { - var customCodeView = new SignatureDependencyTestTypeProvider("PublicCustomApi", TypeSignatureModifiers.Public, CreateNamedType("GeneratedModel", string.Empty)); - var generatedModel = new CustomizableTestTypeProvider("GeneratedModel", TypeSignatureModifiers.Public, customCodeView, ns: "Generated.Models"); - MockHelpers.LoadMockGenerator(createOutputLibrary: () => new TestOutputLibrary(generatedModel)); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([generatedModel]); - - Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsFalse(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - } - - [Test] - public void InternalGeneratedPredecessorDoesNotPublicizeItsInternalDependency() - { - var dependency = new GeneratedModelTestTypeProvider("InternalDependency", TypeSignatureModifiers.Internal, ns: "Sample.Models"); - var internalModel = new GeneratedModelTestTypeProvider( - "InternalModel", - TypeSignatureModifiers.Internal, - ns: "Sample.Models"); - var publicRoot = new GeneratedModelTestTypeProvider( - "PublicRoot", - TypeSignatureModifiers.Public, - ns: "Sample.Models"); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => new TestOutputLibrary(publicRoot, internalModel, dependency), - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - CodeModelGenerator.Instance.AddTypeToKeep(publicRoot.Type.FullyQualifiedName); - CodeModelGenerator.Instance.AddTypeToKeep(internalModel.Type.FullyQualifiedName); - CodeModelGenerator.Instance.AddTypeToKeep(dependency.Type.FullyQualifiedName); - - publicRoot.Update(properties: [ - new PropertyProvider($"", MethodSignatureModifiers.Public, internalModel.Type, "InternalModel", new AutoPropertyBody(false), publicRoot) - ]); - internalModel.Update(properties: [ - new PropertyProvider($"", MethodSignatureModifiers.Public, dependency.Type, "Dependency", new AutoPropertyBody(false), internalModel) - ]); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([publicRoot, internalModel, dependency]); - - Assert.IsTrue(internalModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(internalModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsTrue(dependency.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(dependency.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - } - - [Test] - public void InternalizedGenericModelRemovesAritylessModelFactoryMethod() - { - var genericArgument = CreateNamedType("T", string.Empty); - var genericModel = new GenericTestTypeProvider( - "GenericModel`1", - TypeSignatureModifiers.Public, - "Sample.Models", - genericArgument); - var outputLibrary = new TestOutputLibrary(genericModel); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => outputLibrary, - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; - modelFactory.Update(methods: - [ - new MethodProvider( - new MethodSignature( - "GenericModel", - $"", - MethodSignatureModifiers.Static | MethodSignatureModifiers.Public, - genericModel.Type, - $"", - []), - MethodBodyStatement.Empty, - modelFactory) - ]); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([genericModel]); - - Assert.IsTrue(genericModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - Assert.IsFalse(genericModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Public)); - Assert.IsEmpty(modelFactory.Methods.Select(m => m.Signature.Name)); - } - - [Test] - public void RemovedModelDoesNotRemoveFactoryMethodForSameNamedModel() - { - var keptModel = new GeneratedModelTestTypeProvider("Widget", TypeSignatureModifiers.Public, ns: "Kept"); - var removedModel = new GeneratedModelTestTypeProvider("Widget", TypeSignatureModifiers.Public, ns: "Removed"); - var outputLibrary = new TestOutputLibrary(keptModel, removedModel); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => outputLibrary, - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - CodeModelGenerator.Instance.AddTypeToKeep(keptModel.Type.FullyQualifiedName); - var modelFactory = CodeModelGenerator.Instance.OutputLibrary.ModelFactory.Value; - modelFactory.Update(methods: - [ - new MethodProvider( - new MethodSignature( - "Widget", - $"", - MethodSignatureModifiers.Static | MethodSignatureModifiers.Public, - keptModel.Type, - $"", - []), - MethodBodyStatement.Empty, - modelFactory) - ]); - - ProviderReferenceMapAnalyzer.Analyze([keptModel, removedModel, modelFactory]); - - Assert.IsTrue(ProviderReferenceMapAnalyzer.ShouldWriteProvider(keptModel)); - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedModel)); - Assert.AreEqual(new[] { "Widget" }, modelFactory.Methods.Select(m => m.Signature.Name)); - } - - [Test] - public void GeneratedTypeDoesNotPreserveLastContractTypeAttributes() - { - var lastContractView = new AttributedTestTypeProvider( - "GeneratedModel", - TypeSignatureModifiers.Internal, - ns: "Sample", - new AttributeStatement(typeof(ExperimentalAttribute), Literal("TEST001"))); - var generatedModel = new ContractedTestTypeProvider( - "GeneratedModel", - TypeSignatureModifiers.Internal, - lastContractView, - ns: "Sample"); - var outputLibrary = new TestOutputLibrary(generatedModel); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => outputLibrary, - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - - ProviderReferenceMapAnalyzer.ApplyPreWriteAccessibility([generatedModel]); - - Assert.IsTrue(generatedModel.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); - var codeFile = new TypeProviderWriter(generatedModel).Write(); - StringAssert.DoesNotContain("[global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute(\"TEST001\")]", codeFile.Content); - StringAssert.Contains("internal partial class GeneratedModel", codeFile.Content); - } - - [Test] - public void GeneratedTypeDoesNotPreserveLastContractAttributeReferencingRemovedGeneratedType() - { - var removedModel = new GeneratedModelTestTypeProvider("RemovedModel", TypeSignatureModifiers.Internal, ns: "Sample"); - var lastContractView = new AttributedTestTypeProvider( - "GeneratedModel", - TypeSignatureModifiers.Internal, - ns: "Sample", - new AttributeStatement(typeof(ExperimentalAttribute), TypeOf(CreateNamedType("RemovedModel", "Sample")))); - var generatedModel = new ContractedTestTypeProvider( - "GeneratedModel", - TypeSignatureModifiers.Internal, - lastContractView, - ns: "Sample"); - var outputLibrary = new TestOutputLibrary(generatedModel, removedModel); - MockHelpers.LoadMockGenerator( - createOutputLibrary: () => outputLibrary, - configuration: "{\"unreferenced-types-handling\":\"removeOrInternalize\"}"); - - ProviderReferenceMapAnalyzer.Analyze([generatedModel, removedModel]); - - Assert.IsFalse(ProviderReferenceMapAnalyzer.ShouldWriteProvider(removedModel)); - var codeFile = new TypeProviderWriter(generatedModel).Write(); - StringAssert.DoesNotContain("RemovedModel", codeFile.Content); - StringAssert.Contains("internal partial class GeneratedModel", codeFile.Content); - } - - private sealed class BodyDependencyTestTypeProvider : TestTypeProvider - { - private readonly CSharpType[] _bodyDependencyTypes; - - public BodyDependencyTestTypeProvider(string name, params CSharpType[] bodyDependencyTypes) - : this(name, bodyDependencyTypes, ns: null) - { - } - - public BodyDependencyTestTypeProvider(string name, string? ns, params CSharpType[] bodyDependencyTypes) - : this(name, bodyDependencyTypes, ns) - { - } - - public BodyDependencyTestTypeProvider(string name, string? ns, CSharpType[] bodyDependencyTypes, PropertyProvider[] properties) - : base(name, TypeSignatureModifiers.Public, properties: properties, ns: ns) - { - _bodyDependencyTypes = bodyDependencyTypes; - } - - public BodyDependencyTestTypeProvider(string name, CSharpType[] bodyDependencyTypes, string? ns) - : base(name, TypeSignatureModifiers.Public, ns: ns) - { - _bodyDependencyTypes = bodyDependencyTypes; - } - - protected internal override IReadOnlyList BuildBodyDependencyTypes() => _bodyDependencyTypes; - } - - private sealed class HelperDependencyTestTypeProvider : TestTypeProvider - { - private readonly CSharpType[] _helperDependencyTypes; - - public HelperDependencyTestTypeProvider(string name, string? ns, params CSharpType[] helperDependencyTypes) - : base(name, TypeSignatureModifiers.Public, ns: ns) - { - _helperDependencyTypes = helperDependencyTypes; - } - - protected internal override IReadOnlyList BuildHelperDependencyTypes() => _helperDependencyTypes; - } - - private sealed class ExtensionMethodTestTypeProvider : TestTypeProvider - { - private readonly string _methodName; - private readonly CSharpType? _receiverType; - - public ExtensionMethodTestTypeProvider(string name, string methodName, string ns, CSharpType? receiverType = null) - : base(name, TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static, ns: ns) - { - _methodName = methodName; - _receiverType = receiverType; - } - - protected internal override MethodProvider[] BuildMethods() => - [ - new MethodProvider( - new MethodSignature( - _methodName, - $"", - MethodSignatureModifiers.Internal | MethodSignatureModifiers.Static | MethodSignatureModifiers.Extension, - typeof(void), - $"", - _receiverType == null ? [] : [new ParameterProvider("value", $"", _receiverType)]), - MethodBodyStatement.Empty, - this) - ]; - } - - private sealed class SignatureDependencyTestTypeProvider : TestTypeProvider - { - private readonly CSharpType[] _signatureDependencyTypes; - - public SignatureDependencyTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, params CSharpType[] signatureDependencyTypes) - : this(name, declarationModifiers, ns: null, signatureDependencyTypes) - { - } - - public SignatureDependencyTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string? ns, params CSharpType[] signatureDependencyTypes) - : base(name, declarationModifiers, ns: ns) - { - _signatureDependencyTypes = signatureDependencyTypes; - } - - protected internal override IReadOnlyList BuildSignatureDependencyTypes() => _signatureDependencyTypes; - } - - private sealed class CustomizableTestTypeProvider : TestTypeProvider - { - private readonly TypeProvider _customCodeView; - - public CustomizableTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider customCodeView, string ns) - : base(name, declarationModifiers, ns: ns) - { - _customCodeView = customCodeView; - } - - private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; - } - - private sealed class AttributedTestTypeProvider : TestTypeProvider - { - private readonly AttributeStatement[] _attributes; - - public AttributedTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string ns, params AttributeStatement[] attributes) - : base(name, declarationModifiers, ns: ns) - { - _attributes = attributes; - } - - protected override IReadOnlyList BuildAttributes() => _attributes; - } - - private sealed class ContractedTestTypeProvider : TestTypeProvider - { - private readonly TypeProvider _lastContractView; - - public ContractedTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider lastContractView, string ns) - : base(name, declarationModifiers, ns: ns) - { - _lastContractView = lastContractView; - } - - private protected override TypeProvider? BuildLastContractView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _lastContractView; - } - - private sealed class ConstructorDependencyTestTypeProvider : TestTypeProvider - { - private readonly TypeProvider _customCodeView; - private readonly CSharpType[] _constructorParameterTypes; - - public ConstructorDependencyTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider customCodeView, string ns, params CSharpType[] constructorParameterTypes) - : base(name, declarationModifiers, ns: ns) - { - _customCodeView = customCodeView; - _constructorParameterTypes = constructorParameterTypes; - } - - protected internal override ConstructorProvider[] BuildConstructors() - { - var parameters = _constructorParameterTypes - .Select((type, index) => new ParameterProvider($"p{index}", $"", type)) - .ToArray(); - return - [ - new ConstructorProvider( - new ConstructorSignature(Type, $"", MethodSignatureModifiers.Public, parameters), - MethodBodyStatement.Empty, - this) - ]; - } - - private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; - } - - private sealed class NestedTestTypeProvider : TestTypeProvider - { - private readonly TypeProvider _declaringTypeProvider; - - public NestedTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, TypeProvider declaringTypeProvider, string ns) - : base(name, declarationModifiers, ns: ns) - { - _declaringTypeProvider = declaringTypeProvider; - } - - protected override TypeProvider? BuildDeclaringTypeProvider() => _declaringTypeProvider; - } - - private sealed class GeneratedModelTestTypeProvider : TypeProvider - { - private readonly string _name; - private readonly string _namespace; - private readonly TypeSignatureModifiers _declarationModifiers; - - public GeneratedModelTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string ns) - { - _name = name; - _namespace = ns; - _declarationModifiers = declarationModifiers; - } - - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Models", $"{Name}.cs"); - protected override string BuildName() => _name; - protected override string BuildNamespace() => _namespace; - protected override TypeSignatureModifiers BuildDeclarationModifiers() => _declarationModifiers; - } - - private sealed class GenericTestTypeProvider : TestTypeProvider - { - private readonly CSharpType[] _typeArguments; - - public GenericTestTypeProvider(string name, TypeSignatureModifiers declarationModifiers, string ns, params CSharpType[] typeArguments) - : base(name, declarationModifiers, ns: ns) - { - _typeArguments = typeArguments; - } - - protected override CSharpType[] GetTypeArguments() => _typeArguments; - } - - private sealed class ClientTestTypeProvider : TestTypeProvider - { - private readonly TypeProvider[] _serializationProviders; - private readonly TypeProvider? _customCodeView; - private readonly CSharpType[] _signatureDependencyTypes; - - public ClientTestTypeProvider(string name, params TypeProvider[] serializationProviders) - : this(name, ns: null, customCodeView: null, serializationProviders: serializationProviders) - { - } - - public ClientTestTypeProvider(string name, string? ns, TypeProvider? customCodeView = null, TypeProvider[]? serializationProviders = null, params CSharpType[] signatureDependencyTypes) - : base(name, TypeSignatureModifiers.Public, ns: ns) - { - _serializationProviders = serializationProviders ?? []; - _customCodeView = customCodeView; - _signatureDependencyTypes = signatureDependencyTypes; - } - - protected internal override bool IsClientProvider => true; - protected override TypeProvider[] BuildSerializationProviders() => _serializationProviders; - private protected override TypeProvider? BuildCustomCodeView(string? generatedTypeName = default, string? generatedTypeNamespace = default) => _customCodeView; - protected internal override IReadOnlyList BuildSignatureDependencyTypes() => _signatureDependencyTypes; - } - - private sealed class ClientProvider : TestTypeProvider - { - public ClientProvider() - : base("SameNamedProvider", TypeSignatureModifiers.Public, ns: "Sample") - { - } - } - - private static CSharpType CreateNamedType(string name, string ns, params CSharpType[] arguments) - { - var constructor = typeof(CSharpType).GetConstructor( - BindingFlags.Instance | BindingFlags.NonPublic, - binder: null, - [typeof(string), typeof(string), typeof(bool), typeof(bool), typeof(CSharpType), typeof(IReadOnlyList), typeof(bool), typeof(bool), typeof(CSharpType), typeof(Type)], - modifiers: null)!; - - return (CSharpType)constructor.Invoke([name, ns, false, false, null, arguments, true, false, null, null]); - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs deleted file mode 100644 index b91419eb56e..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/ReferenceMap/TestData/ProviderReferenceMapAnalyzerTests/LastContractModelFactorySignaturesDoNotRootGeneratedModels/LastContract.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Sample -{ - internal class PagedWidget - { - } - - internal class WidgetRequest - { - } - - public static class SampleModelFactory - { - public static PagedWidget PagedWidget() => throw null; - - public static WidgetRequest WidgetRequest() => throw null; - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs index 7490c2f41e5..00119db05dd 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/TestHelpers/TestOutputLibrary.cs @@ -14,11 +14,6 @@ public TestOutputLibrary(TypeProvider typeProvider) _types = [typeProvider]; } - public TestOutputLibrary(params TypeProvider[] typeProviders) - { - _types = typeProviders; - } - protected override TypeProvider[] BuildTypeProviders() => _types; } } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs deleted file mode 100644 index 27bd4cf11cd..00000000000 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TestData/TypeSymbolExtensionsTests/TypeParameterDoesNotResolveContainingGenericType/GenericContainer.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Sample -{ - public class GenericContainer - { - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs index e8fcf0bb0fb..3884f8d584e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Utilities/TypeSymbolExtensionsTests.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; using Microsoft.TypeSpec.Generator.Primitives; using Microsoft.TypeSpec.Generator.Tests.Common; using Moq; @@ -84,46 +83,6 @@ public async Task NonNullableKnownFrameworkTypeResolvesUnchanged() Assert.IsFalse(csharpType.IsNullable); } - [Test] - public async Task TypeParameterDoesNotResolveContainingGenericType() - { - var compilation = await Helpers.GetCompilationFromDirectoryAsync(); - var typeSymbol = compilation.GetTypeByMetadataName("Sample.GenericContainer`1"); - Assert.IsNotNull(typeSymbol, "Failed to resolve generic type symbol from compiled source."); - - var csharpType = typeSymbol!.TypeParameters[0].GetCSharpType(); - - Assert.AreEqual("T", csharpType.Name); - Assert.IsNull(csharpType.DeclaringType); - } - - [Test] - public void CollectionGenericSymbolWithoutAngleBracketDisplayNameGetsFullyQualifiedMetadataName() - { - var compilation = CSharpCompilation.Create( - "TestAssembly", - [CSharpSyntaxTree.ParseText(""" - using System.Collections.Generic; - - namespace Sample - { - public class Container - { - public IReadOnlyList GetResult() => null; - } - } - """)], - [MetadataReference.CreateFromFile(typeof(object).Assembly.Location)]); - var method = compilation.GetTypeByMetadataName("Sample.Container")! - .GetMembers("GetResult") - .OfType() - .Single(); - - var name = method.ReturnType.GetFullyQualifiedName(); - - Assert.AreEqual("System.Collections.Generic.IReadOnlyList`1", name); - } - private static IPropertySymbol GetPropertySymbol(Compilation compilation, string containerName, string propertyName) { var typeSymbol = compilation.GetTypeByMetadataName($"Sample.{containerName}"); diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs index b594d3e6f15..d21f56d38b7 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/Models/ParametersBasicContext.cs @@ -4,6 +4,7 @@ using System.ClientModel.Primitives; using Parameters.Basic._ExplicitBody; +using Parameters.Basic._ImplicitBody; namespace Parameters.Basic { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs index c17dda5eaec..06d44d34bc1 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Generated/ParametersBasicModelFactory.cs @@ -3,6 +3,7 @@ #nullable disable using Parameters.Basic._ExplicitBody; +using Parameters.Basic._ImplicitBody; namespace Parameters.Basic { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs index 334e0eb3cb1..fca7b7b5ee9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/Models/ParametersSpreadContext.cs @@ -3,6 +3,7 @@ #nullable disable using System.ClientModel.Primitives; +using Parameters.Spread._Alias; using Parameters.Spread._Model; namespace Parameters.Spread diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs index 4e494c2f2ec..775c933bc6b 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Generated/ParametersSpreadModelFactory.cs @@ -2,6 +2,8 @@ #nullable disable +using System.Collections.Generic; +using Parameters.Spread._Alias; using Parameters.Spread._Model; namespace Parameters.Spread diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs index 2e915db6195..48490ff12b9 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/Models/PayloadMultiPartContext.cs @@ -3,6 +3,7 @@ #nullable disable using System.ClientModel.Primitives; +using Payload.MultiPart._FormData.File; namespace Payload.MultiPart { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs index e5c87b994a6..6d036b01c86 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Generated/PayloadMultiPartModelFactory.cs @@ -2,6 +2,7 @@ #nullable disable +using System; using System.ClientModel; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs index 9a53d9a8f3d..347e4c01fa3 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/Models/PayloadPageableContext.cs @@ -3,7 +3,10 @@ #nullable disable using System.ClientModel.Primitives; +using Payload.Pageable._PageSize; +using Payload.Pageable._ServerDrivenPagination; using Payload.Pageable._ServerDrivenPagination.AlternateInitialVerb; +using Payload.Pageable._ServerDrivenPagination.ContinuationToken; namespace Payload.Pageable { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs index 9f8c3ce6d6d..0b66e798a05 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Generated/PayloadPageableModelFactory.cs @@ -2,7 +2,12 @@ #nullable disable +using System; +using System.Collections.Generic; +using Payload.Pageable._PageSize; +using Payload.Pageable._ServerDrivenPagination; using Payload.Pageable._ServerDrivenPagination.AlternateInitialVerb; +using Payload.Pageable._ServerDrivenPagination.ContinuationToken; namespace Payload.Pageable { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs index 9469e8aa953..42db04881c2 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/Models/SpecialWordsContext.cs @@ -5,6 +5,7 @@ using System.ClientModel.Primitives; using SpecialWords._ModelProperties; using SpecialWords._Models; +using SpecialWords._ReservedOperationBodyParams; namespace SpecialWords { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs index 43aca8db259..1abb2114c9a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/Generated/SpecialWordsModelFactory.cs @@ -2,8 +2,10 @@ #nullable disable +using System.Collections.Generic; using SpecialWords._ModelProperties; using SpecialWords._Models; +using SpecialWords._ReservedOperationBodyParams; namespace SpecialWords { From 39f8f0230bb59b17464d8173b6bff4ddee8082a1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Jul 2026 12:57:34 -0400 Subject: [PATCH 023/249] Backmerge release/july-2026 into main [skip chg] (#11283) Backmerges `release/july-2026` into `main` to bring hotfix commits back to the development branch. ## Changes from release/july-2026 - **fix(typespec-vscode):** prevent shell injection in tsp compile task (#11275) - **fix(spector):** prevent unauthenticated remote server stop (#11274) - **chore:** version bumps for hotfixes (#11281) --------- Co-authored-by: Timothee Guerin Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- ...vider-shell-injection-2026-7-16-12-45-0.md | 7 +++ packages/spector/CHANGELOG.md | 7 +++ packages/spector/docs/using-spector.md | 3 + packages/spector/package.json | 2 +- packages/spector/src/server/server.ts | 11 +++- packages/typespec-vscode/CHANGELOG.md | 7 +++ packages/typespec-vscode/package.json | 9 ++- packages/typespec-vscode/src/task-command.ts | 23 ++++++++ packages/typespec-vscode/src/task-provider.ts | 32 ++++++----- .../test/unit/task-command.test.ts | 56 +++++++++++++++++++ 10 files changed, 138 insertions(+), 19 deletions(-) create mode 100644 .chronus/changes/fix-task-provider-shell-injection-2026-7-16-12-45-0.md create mode 100644 packages/typespec-vscode/src/task-command.ts create mode 100644 packages/typespec-vscode/test/unit/task-command.test.ts diff --git a/.chronus/changes/fix-task-provider-shell-injection-2026-7-16-12-45-0.md b/.chronus/changes/fix-task-provider-shell-injection-2026-7-16-12-45-0.md new file mode 100644 index 00000000000..c428d2c5fd5 --- /dev/null +++ b/.chronus/changes/fix-task-provider-shell-injection-2026-7-16-12-45-0.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "typespec-vscode" +--- + +Fix a shell command injection in the tsp compile task provider. Tasks now run via `vscode.ProcessExecution` with arguments passed as an array instead of `vscode.ShellExecution`, so workspace file paths and task arguments are no longer interpreted by the OS shell. The task `args` is now specified as an array of arguments. diff --git a/packages/spector/CHANGELOG.md b/packages/spector/CHANGELOG.md index 1955f3658b6..9a7150da209 100644 --- a/packages/spector/CHANGELOG.md +++ b/packages/spector/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - @typespec/spector +## 0.1.0-alpha.27 + +### Bug Fixes + +- [#11274](https://github.com/microsoft/typespec/pull/11274) Bind the mock server to the loopback interface (`127.0.0.1`) so the unauthenticated `/.admin/stop` endpoint can no longer be reached by other hosts on the network. The server is only reachable from the local host. + + ## 0.1.0-alpha.26 ### Bug Fixes diff --git a/packages/spector/docs/using-spector.md b/packages/spector/docs/using-spector.md index 96651da9bc6..bd62bb6a25f 100644 --- a/packages/spector/docs/using-spector.md +++ b/packages/spector/docs/using-spector.md @@ -34,6 +34,9 @@ tsp-spector serve ./path/to/scenarios --port 1234 tsp-spector serve ./path/to/scenarios --coverageFile ./path/to/spector-coverage.json ``` +> [!NOTE] +> The server always binds to the loopback interface (`127.0.0.1`), so it is only reachable from the local host and is not exposed to other machines on the network. + Alternative to start in background ```bash diff --git a/packages/spector/package.json b/packages/spector/package.json index 951d79b41a5..53edda6c41d 100644 --- a/packages/spector/package.json +++ b/packages/spector/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/spector", - "version": "0.1.0-alpha.26", + "version": "0.1.0-alpha.27", "description": "Typespec Core Tool to validate, run mock api, collect coverage.", "exports": { ".": { diff --git a/packages/spector/src/server/server.ts b/packages/spector/src/server/server.ts index 37570bd0eb7..274e728914b 100644 --- a/packages/spector/src/server/server.ts +++ b/packages/spector/src/server/server.ts @@ -10,6 +10,13 @@ export interface MockApiServerConfig { port: number; } +/** + * The mock server always binds to the loopback interface so it is only reachable + * from the local host. This keeps the unauthenticated admin endpoints (e.g. the + * server stop signal) from being exposed to other hosts on the network. + */ +const LOOPBACK_HOST = "127.0.0.1"; + const errorHandler: ErrorRequestHandler = (err, _req, res, _next) => { logger.error("Error", err); @@ -85,14 +92,14 @@ export class MockApiServer { this.app.use(errorHandler); return new Promise((resolve, reject) => { - const server = this.app.listen(this.config.port, () => { + const server = this.app.listen(this.config.port, LOOPBACK_HOST, () => { const resolvedPort = getPort(server); if (!resolvedPort) { logger.error("Failed to resolve port"); reject(new Error("Failed to resolve port")); return; } - logger.info(`Started server on ${resolvedPort}`); + logger.info(`Started server on ${LOOPBACK_HOST}:${resolvedPort}`); resolve(resolvedPort); }); diff --git a/packages/typespec-vscode/CHANGELOG.md b/packages/typespec-vscode/CHANGELOG.md index 17f4b06c10e..63f557d9396 100644 --- a/packages/typespec-vscode/CHANGELOG.md +++ b/packages/typespec-vscode/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - typespec-vscode +## 1.14.1 + +### Bug Fixes + +- [#11275](https://github.com/microsoft/typespec/pull/11275) Fix a shell command injection in the tsp compile task provider. Tasks now run via `vscode.ProcessExecution` with arguments passed as an array instead of `vscode.ShellExecution`, so workspace file paths and task arguments are no longer interpreted by the OS shell. The task `args` is now specified as an array of arguments. + + ## 1.14.0 No changes, version bump only. diff --git a/packages/typespec-vscode/package.json b/packages/typespec-vscode/package.json index a97a08f2891..d0ee77372ee 100644 --- a/packages/typespec-vscode/package.json +++ b/packages/typespec-vscode/package.json @@ -1,7 +1,7 @@ { "name": "typespec-vscode", "private": true, - "version": "1.14.0", + "version": "1.14.1", "author": "Microsoft Corporation", "description": "TypeSpec language support for VS Code", "homepage": "https://typespec.io", @@ -249,8 +249,11 @@ "description": "The path to trigger tsp compile" }, "args": { - "type": "string", - "description": "The arguments to tsp compile" + "type": "array", + "items": { + "type": "string" + }, + "description": "The arguments passed to tsp compile, where each element is a single argument." } } } diff --git a/packages/typespec-vscode/src/task-command.ts b/packages/typespec-vscode/src/task-command.ts new file mode 100644 index 00000000000..7ec7bbb9909 --- /dev/null +++ b/packages/typespec-vscode/src/task-command.ts @@ -0,0 +1,23 @@ +import type { Executable } from "vscode-languageclient/node"; +import { VSCodeVariableResolver } from "./vscode-variable-resolver.js"; + +/** + * Build the command and argument array for a tsp compile task. Arguments are passed + * as an array (never concatenated into a shell string) so they can be executed + * without invoking a shell, avoiding command injection through workspace paths or + * task arguments. + */ +export function resolveTaskCommand( + absoluteTargetPath: string, + args: string[], + cli: Executable, + workspaceFolder: string, +): { command: string; args: string[] } { + const variableResolver = new VSCodeVariableResolver({ + workspaceFolder, + workspaceRoot: workspaceFolder, // workspaceRoot is deprecated but we still support it for backwards compatibility. + }); + const resolve = (value: string) => variableResolver.resolve(value); + const commandArgs = [...(cli.args ?? []), "compile", absoluteTargetPath, ...args].map(resolve); + return { command: resolve(cli.command), args: commandArgs }; +} diff --git a/packages/typespec-vscode/src/task-provider.ts b/packages/typespec-vscode/src/task-provider.ts index 89722edffef..430f5ae44e6 100644 --- a/packages/typespec-vscode/src/task-provider.ts +++ b/packages/typespec-vscode/src/task-provider.ts @@ -4,6 +4,7 @@ import { Executable } from "vscode-languageclient/node"; import { StartFileName } from "./const.js"; import logger from "./log/logger.js"; import { normalizeSlashes } from "./path-utils.js"; +import { resolveTaskCommand } from "./task-command.js"; import { resolveTypeSpecCli } from "./tsp-executable-resolver.js"; import { VSCodeVariableResolver } from "./vscode-variable-resolver.js"; @@ -70,21 +71,26 @@ function getTaskPath(targetPath: string): { absoluteTargetPath: string; workspac return { absoluteTargetPath: targetPath, workspaceFolder }; } +/** + * Create a tsp compile {@link vscode.Task} that runs via {@link vscode.ProcessExecution} + * (no shell) so workspace paths and task arguments cannot be interpreted as shell + * commands. + */ function createTaskInternal( name: string, absoluteTargetPath: string, - args: string, + args: string[], cli: Executable, workspaceFolder: string, ) { - let cmd = `${cli.command} ${cli.args?.join(" ") ?? ""} compile "${absoluteTargetPath}" ${args}`; - const variableResolver = new VSCodeVariableResolver({ + const { command, args: commandArgs } = resolveTaskCommand( + absoluteTargetPath, + args, + cli, workspaceFolder, - workspaceRoot: workspaceFolder, // workspaceRoot is deprecated but we still support it for backwards compatibility. - }); - cmd = variableResolver.resolve(cmd); + ); logger.debug( - `Command of tsp compile task "${name}" is resolved to: ${cmd} with cwd "${workspaceFolder}"`, + `Command of tsp compile task "${name}" is resolved to: ${command} ${commandArgs.join(" ")} with cwd "${workspaceFolder}"`, ); return new vscode.Task( { @@ -96,18 +102,18 @@ function createTaskInternal( name, "tsp", workspaceFolder - ? new vscode.ShellExecution(cmd, { cwd: workspaceFolder }) - : new vscode.ShellExecution(cmd), + ? new vscode.ProcessExecution(command, commandArgs, { cwd: workspaceFolder }) + : new vscode.ProcessExecution(command, commandArgs), ); } -async function createTask(name: string, targetPath: string, args?: string) { +async function createTask(name: string, targetPath: string, args?: string[]) { const { absoluteTargetPath, workspaceFolder } = getTaskPath(targetPath); const cli = await resolveTypeSpecCli(absoluteTargetPath); if (!cli) { return undefined; } - return await createTaskInternal(name, absoluteTargetPath, args ?? "", cli, workspaceFolder); + return await createTaskInternal(name, absoluteTargetPath, args ?? [], cli, workspaceFolder); } async function createBuiltInTasks(targetPath: string): Promise { @@ -117,8 +123,8 @@ async function createBuiltInTasks(targetPath: string): Promise { return []; } return [ - { name: `compile - ${targetPath}`, args: "" }, - { name: `watch - ${targetPath}`, args: "--watch" }, + { name: `compile - ${targetPath}`, args: [] }, + { name: `watch - ${targetPath}`, args: ["--watch"] }, ].map(({ name, args }) => { return createTaskInternal(name, absoluteTargetPath, args, cli, workspaceFolder); }); diff --git a/packages/typespec-vscode/test/unit/task-command.test.ts b/packages/typespec-vscode/test/unit/task-command.test.ts new file mode 100644 index 00000000000..08f819dec4c --- /dev/null +++ b/packages/typespec-vscode/test/unit/task-command.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it } from "vitest"; +import { Executable } from "vscode-languageclient/node"; +import { resolveTaskCommand } from "../../src/task-command.js"; + +describe("resolveTaskCommand", () => { + const cli: Executable = { command: "node", args: ["/compiler/cmd/tsp.js"] }; + + it("passes the target path as a single literal argument", () => { + const { command, args } = resolveTaskCommand("/work/main.tsp", [], cli, "/work"); + expect(command).toBe("node"); + expect(args).toEqual(["/compiler/cmd/tsp.js", "compile", "/work/main.tsp"]); + }); + + it("does not interpret shell metacharacters in the path (injection is neutralized)", () => { + const malicious = "/work/$(rm -rf ~)`whoami`; echo pwned/main.tsp"; + const { args } = resolveTaskCommand(malicious, [], cli, "/work"); + // The whole path stays a single argument, untouched by any shell parsing. + expect(args).toContain(malicious); + expect(args).toEqual(["/compiler/cmd/tsp.js", "compile", malicious]); + }); + + it("appends the task arguments verbatim", () => { + const { args } = resolveTaskCommand( + "/work/main.tsp", + ["--watch", "--option", "out=/my folder"], + cli, + "/work", + ); + expect(args).toEqual([ + "/compiler/cmd/tsp.js", + "compile", + "/work/main.tsp", + "--watch", + "--option", + "out=/my folder", + ]); + }); + + it("resolves ${workspaceFolder} variables in each element", () => { + const cliWithVar: Executable = { command: "node", args: ["${workspaceFolder}/tsp.js"] }; + const { command, args } = resolveTaskCommand( + "${workspaceFolder}/main.tsp", + ["--output-dir", "${workspaceFolder}/out"], + cliWithVar, + "/work", + ); + expect(command).toBe("node"); + expect(args).toEqual([ + "/work/tsp.js", + "compile", + "/work/main.tsp", + "--output-dir", + "/work/out", + ]); + }); +}); From 9f51322d4d60e1fb98d26e5e2a58470f7c3159d8 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Fri, 17 Jul 2026 13:03:00 -0400 Subject: [PATCH 024/249] Migrate off source-map-support to native Node source maps (#11295) ## Summary Node has shipped native source-map support for stack traces since v14.6 via `process.setSourceMapsEnabled(true)`, and every workspace package now requires Node `>=22`. The third-party `source-map-support` dependency is therefore no longer needed. This replaces the `source-map-support/register.js` import with the native API in the CLI entrypoints and drops the dependency. ## Changes - Replace `source-map-support/register.js` with `process.setSourceMapsEnabled(true)` in the CLI entrypoints (removing the associated `try/catch` + `@ts-ignore`/eslint-disable): - `packages/compiler/src/core/cli/cli.ts` - `packages/pack/src/cli.ts` - `packages/tspd/src/cli.ts` - `packages/bundler/src/cli.ts` - `packages/spector/src/cli/cli.ts` - Remove `source-map-support` from the `pnpm-workspace.yaml` catalog and from the `package.json` of `@typespec/compiler`, `@typespec/pack`, `@typespec/tspd`, and `@typespec/spector`. - Refresh `pnpm-lock.yaml`. ## Out of scope `packages/http-client-*/package-lock.json` reference `source-map-support` only transitively via the **published** `@typespec/spector`; those npm-managed lockfiles regenerate separately when spector is republished. ## Validation - All affected packages build. - Lint (oxlint) and format (prettier) clean on touched files. - Remaining `pnpm-lock.yaml` hits are legitimate transitive deps (`@babel/register`, chronus tooling), not a direct dependency. --- ...off-source-map-support-2026-7-17-10-12-0.md | 11 +++++++++++ packages/bundler/src/cli.ts | 8 +------- packages/compiler/package.json | 1 - packages/compiler/src/core/cli/cli.ts | 8 +------- packages/graphql/package.json | 1 - packages/pack/package.json | 1 - packages/pack/src/cli.ts | 8 +------- packages/spector/package.json | 1 - packages/spector/src/cli/cli.ts | 3 ++- packages/tspd/package.json | 1 - packages/tspd/src/cli.ts | 8 +------- pnpm-lock.yaml | 18 ------------------ pnpm-workspace.yaml | 1 - 13 files changed, 17 insertions(+), 53 deletions(-) create mode 100644 .chronus/changes/migrate-off-source-map-support-2026-7-17-10-12-0.md diff --git a/.chronus/changes/migrate-off-source-map-support-2026-7-17-10-12-0.md b/.chronus/changes/migrate-off-source-map-support-2026-7-17-10-12-0.md new file mode 100644 index 00000000000..5f0b880c4de --- /dev/null +++ b/.chronus/changes/migrate-off-source-map-support-2026-7-17-10-12-0.md @@ -0,0 +1,11 @@ +--- +changeKind: internal +packages: + - "@typespec/compiler" + - "@typespec/tspd" + - "@typespec/spector" + - "@typespec/bundler" + - "@typespec/graphql" +--- + +Replace the `source-map-support` dependency with the native Node.js `process.setSourceMapsEnabled(true)` API in the CLI entrypoints. diff --git a/packages/bundler/src/cli.ts b/packages/bundler/src/cli.ts index 7424815b35b..03e6f97aa9e 100644 --- a/packages/bundler/src/cli.ts +++ b/packages/bundler/src/cli.ts @@ -3,13 +3,7 @@ import { resolvePath } from "@typespec/compiler"; import yargs from "yargs"; import { bundleTypeSpecLibrary } from "./bundler.js"; -try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - await import("source-map-support/register.js"); -} catch { - // package only present in dev. -} +process.setSourceMapsEnabled(true); async function main() { console.log(`TypeSpec Developer Tools`); diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 981f575f283..523cd2b2862 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -133,7 +133,6 @@ "@vitest/ui": "catalog:", "pathe": "catalog:", "rimraf": "catalog:", - "source-map-support": "catalog:", "tmlanguage-generator": "workspace:^", "typescript": "catalog:", "vitest": "catalog:", diff --git a/packages/compiler/src/core/cli/cli.ts b/packages/compiler/src/core/cli/cli.ts index a4aa9ba7089..4a6d92c752f 100644 --- a/packages/compiler/src/core/cli/cli.ts +++ b/packages/compiler/src/core/cli/cli.ts @@ -1,10 +1,4 @@ -try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - await import("source-map-support/register.js"); -} catch { - // package only present in dev. -} +process.setSourceMapsEnabled(true); import yargs from "yargs"; import { installTypeSpecDependencies } from "../../install/install.js"; diff --git a/packages/graphql/package.json b/packages/graphql/package.json index 63f34784230..81f20aa0789 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -69,7 +69,6 @@ "@typespec/mutator-framework": "workspace:~", "@typespec/tspd": "workspace:~", "rimraf": "catalog:", - "source-map-support": "catalog:", "typescript": "catalog:", "vitest": "catalog:" } diff --git a/packages/pack/package.json b/packages/pack/package.json index 82916c8522a..8d25b04143a 100644 --- a/packages/pack/package.json +++ b/packages/pack/package.json @@ -53,7 +53,6 @@ "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", "rimraf": "catalog:", - "source-map-support": "catalog:", "typescript": "catalog:", "vite": "catalog:", "vitest": "catalog:" diff --git a/packages/pack/src/cli.ts b/packages/pack/src/cli.ts index abc23376573..6b3f24fead4 100644 --- a/packages/pack/src/cli.ts +++ b/packages/pack/src/cli.ts @@ -1,10 +1,4 @@ -try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - await import("source-map-support/register.js"); -} catch { - // package only present in dev. -} +process.setSourceMapsEnabled(true); import { getDirectoryPath, logDiagnostics, NodeHost, normalizePath } from "@typespec/compiler"; import { mkdir, writeFile } from "fs/promises"; diff --git a/packages/spector/package.json b/packages/spector/package.json index 53edda6c41d..ef98b4a546a 100644 --- a/packages/spector/package.json +++ b/packages/spector/package.json @@ -48,7 +48,6 @@ "morgan": "catalog:", "multer": "catalog:", "picocolors": "catalog:", - "source-map-support": "catalog:", "yaml": "catalog:", "yargs": "catalog:" }, diff --git a/packages/spector/src/cli/cli.ts b/packages/spector/src/cli/cli.ts index f0ecef7be8d..99684a2ff2e 100644 --- a/packages/spector/src/cli/cli.ts +++ b/packages/spector/src/cli/cli.ts @@ -1,5 +1,4 @@ import { join, resolve } from "path"; -import "source-map-support/register.js"; import yargs from "yargs"; import { checkCoverage } from "../actions/check-coverage.js"; import { generateScenarioSummary } from "../actions/generate-scenario-summary.js"; @@ -12,6 +11,8 @@ import { validateMockApis } from "../actions/validate-mock-apis.js"; import { logger } from "../logger.js"; import { getCommit } from "../utils/misc-utils.js"; +process.setSourceMapsEnabled(true); + export const DEFAULT_PORT = 3000; async function main() { diff --git a/packages/tspd/package.json b/packages/tspd/package.json index 7fb51261986..596136a384c 100644 --- a/packages/tspd/package.json +++ b/packages/tspd/package.json @@ -80,7 +80,6 @@ "@vitest/coverage-v8": "catalog:", "@vitest/ui": "catalog:", "rimraf": "catalog:", - "source-map-support": "catalog:", "typescript": "catalog:", "vitest": "catalog:" } diff --git a/packages/tspd/src/cli.ts b/packages/tspd/src/cli.ts index 4ecdd3fa5d9..4291f3834ea 100644 --- a/packages/tspd/src/cli.ts +++ b/packages/tspd/src/cli.ts @@ -5,13 +5,7 @@ import yargs from "yargs"; import { generateExternSignatures } from "./gen-extern-signatures/gen-extern-signatures.js"; import { generateLibraryDocs } from "./ref-doc/experimental.js"; -try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - await import("source-map-support/register.js"); -} catch { - // package only present in dev. -} +process.setSourceMapsEnabled(true); function logExperimentalWarning(type: "log" | "error") { const log = diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89d3f8a9467..5709ac08f18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -408,9 +408,6 @@ catalogs: simple-git: specifier: ^3.36.0 version: 3.36.0 - source-map-support: - specifier: ^0.5.21 - version: 0.5.21 storybook: specifier: ^10.3.5 version: 10.4.6 @@ -845,9 +842,6 @@ importers: rimraf: specifier: 'catalog:' version: 6.1.3 - source-map-support: - specifier: 'catalog:' - version: 0.5.21 tmlanguage-generator: specifier: workspace:^ version: link:../tmlanguage-generator @@ -1000,9 +994,6 @@ importers: rimraf: specifier: 'catalog:' version: 6.1.3 - source-map-support: - specifier: 'catalog:' - version: 0.5.21 typescript: specifier: 'catalog:' version: 6.0.3 @@ -1824,9 +1815,6 @@ importers: rimraf: specifier: 'catalog:' version: 6.1.3 - source-map-support: - specifier: 'catalog:' - version: 0.5.21 typescript: specifier: 'catalog:' version: 6.0.3 @@ -2483,9 +2471,6 @@ importers: picocolors: specifier: 'catalog:' version: 1.1.1 - source-map-support: - specifier: 'catalog:' - version: 0.5.21 yaml: specifier: 'catalog:' version: 2.9.0 @@ -2767,9 +2752,6 @@ importers: rimraf: specifier: 'catalog:' version: 6.1.3 - source-map-support: - specifier: 'catalog:' - version: 0.5.21 typescript: specifier: 'catalog:' version: 6.0.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 842d2f5847a..951fdf5db5f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -141,7 +141,6 @@ catalog: semver: ^7.7.4 sharp: ^0.35.2 simple-git: ^3.36.0 - source-map-support: ^0.5.21 storybook: ^10.3.5 strip-json-comments: ^5.0.3 swagger-ui-dist: ^5.32.2 From 940a4ee52ef77fe5fea71d7935b18592d7abeaa8 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Fri, 17 Jul 2026 12:23:10 -0700 Subject: [PATCH 025/249] [http-client-csharp] Add query expansion and lossy duration Spector tests (#11298) ## Summary - add C# Spector coverage for exploded model query parameters - add C# Spector coverage for lossy integer duration encodings - regenerate the affected routes and duration clients ## Validation - `Test-Spector.ps1 -filter http/routes` (18 passed, 9 skipped) - `Test-Spector.ps1 -filter http/encode/duration` (58 passed) - `npm run build` - `npm run cop` Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Http/Encode/Duration/EncodeDurationTest.cs | 14 ++++++++++++++ .../Spector.Tests/Http/Routes/QueryTests.cs | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Encode/Duration/EncodeDurationTest.cs b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Encode/Duration/EncodeDurationTest.cs index 541566a83ab..0e55454d894 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Encode/Duration/EncodeDurationTest.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Encode/Duration/EncodeDurationTest.cs @@ -321,6 +321,20 @@ public Task QueryInt32MillisecondsArray() => Test(async (host) => Assert.AreEqual(204, result.GetRawResponse().Status); }); + [SpectorTest] + public Task LossyInt32Seconds() => Test(async (host) => + { + var result = await new DurationClient(host, null).GetLossyClient().IntSecondsAsync(TimeSpan.FromSeconds(36.25)); + Assert.AreEqual(204, result.GetRawResponse().Status); + }); + + [SpectorTest] + public Task LossyInt32Milliseconds() => Test(async (host) => + { + var result = await new DurationClient(host, null).GetLossyClient().IntMillisecondsAsync(TimeSpan.FromMilliseconds(36250.25)); + Assert.AreEqual(204, result.GetRawResponse().Status); + }); + [SpectorTest] public Task HeaderInt32Milliseconds() => Test(async (host) => { diff --git a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Routes/QueryTests.cs b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Routes/QueryTests.cs index 52f201fea31..52a0173e09a 100644 --- a/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Routes/QueryTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Routes/QueryTests.cs @@ -91,6 +91,16 @@ public Task QueryExpansionExplodeRecord() => Test(async (host) => Assert.AreEqual(204, response.GetRawResponse().Status); }); + [SpectorTest] + public Task QueryExpansionExplodeModel() => Test(async (host) => + { + var response = await new RoutesClient(host, null).GetQueryParametersClient() + .GetQueryParametersQueryExpansionClient() + .GetQueryParametersQueryExpansionExplodeClient() + .ModelAsync(new ExpandParameters("status", "active")); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + [SpectorTest] [Ignore("https://github.com/microsoft/typespec/issues/5139")] public Task QueryContinuationPrimitive() => Test(async (host) => From 50f74660d8e08b3022b06bd8b2dfe2da21aed51c Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Fri, 17 Jul 2026 13:28:30 -0700 Subject: [PATCH 026/249] Preserve internal C# helper types during trimming (#11285) ## Summary - add an `InternalHelperProvider` base that registers itself with `AddTypeToKeep(..., isRoot: false)` - default helper declarations to `internal static`, with direct modifier overrides for non-static helpers - preserve generic non-root helpers during post-processing and regenerate the local sample ## Validation - `npm run build` - `npm test` - `npm run cop` - focused helper retention tests - formatting completed; emitter lint is currently blocked by the repository's missing ESLint 10 flat config --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../BinaryContentHelperDefinition.cs | 5 +- .../CancellationTokenExtensionsDefinition.cs | 7 +- .../ClientPipelineExtensionsDefinition.cs | 7 +- .../Providers/ClientUriBuilderDefinition.cs | 7 +- .../src/Providers/ErrorResultDefinition.cs | 2 +- .../ModelSerializationExtensionsDefinition.cs | 7 +- ...ultiPartFormDataBinaryContentDefinition.cs | 5 +- .../MultipartFormDataHelperDefinition.cs | 5 +- ...elineRequestHeadersExtensionsDefinition.cs | 7 +- .../src/Providers/TypeFormattersDefinition.cs | 7 +- .../Utf8JsonBinaryContentDefinition.cs | 2 +- .../src/ScmCodeModelGenerator.cs | 6 +- .../src/PostProcessing/PostProcessor.cs | 21 ++- .../src/Providers/ArgumentDefinition.cs | 7 +- .../ChangeTrackingDictionaryDefinition.cs | 7 +- .../Providers/ChangeTrackingListDefinition.cs | 7 +- .../src/Providers/InternalHelperProvider.cs | 22 +++ .../src/Providers/OptionalDefinition.cs | 7 +- .../src/TypeFactory.cs | 8 +- .../test/Providers/TypeProviderTests.cs | 18 ++ .../Local.Tests/UnreferencedTypeTests.cs | 8 +- .../Generated/Internal/BinaryContentHelper.cs | 175 ++++++++++++++++++ .../PipelineRequestHeadersExtensions.cs | 48 +++++ .../Internal/Utf8JsonBinaryContent.cs | 61 ++++++ 24 files changed, 377 insertions(+), 79 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/InternalHelperProvider.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/BinaryContentHelper.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/PipelineRequestHeadersExtensions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs index a2ee813e298..3a7194ee1c4 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/BinaryContentHelperDefinition.cs @@ -17,7 +17,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - public class BinaryContentHelperDefinition : TypeProvider + public class BinaryContentHelperDefinition : InternalHelperProvider { private const string _fromEnumerableName = "FromEnumerable"; private const string _fromDictionaryName = "FromDictionary"; @@ -30,9 +30,6 @@ public class BinaryContentHelperDefinition : TypeProvider protected override string BuildName() => "BinaryContentHelper"; - protected override TypeSignatureModifiers BuildDeclarationModifiers() - => TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class; - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override MethodProvider[] BuildMethods() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CancellationTokenExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CancellationTokenExtensionsDefinition.cs index 6168a29ba2f..d1af1212824 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CancellationTokenExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/CancellationTokenExtensionsDefinition.cs @@ -12,7 +12,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal class CancellationTokenExtensionsDefinition : TypeProvider + internal class CancellationTokenExtensionsDefinition : InternalHelperProvider { private ParameterProvider _cancellationTokenParam; @@ -21,11 +21,6 @@ public CancellationTokenExtensionsDefinition() _cancellationTokenParam = new ParameterProvider("cancellationToken", FormattableStringHelpers.Empty, typeof(CancellationToken)); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "CancellationTokenExtensions"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientPipelineExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientPipelineExtensionsDefinition.cs index 02864633aca..d039812772a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientPipelineExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientPipelineExtensionsDefinition.cs @@ -13,7 +13,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal class ClientPipelineExtensionsDefinition : TypeProvider + internal class ClientPipelineExtensionsDefinition : InternalHelperProvider { private ParameterProvider _pipelineParam; private ParameterProvider _messageParam; @@ -32,11 +32,6 @@ public ClientPipelineExtensionsDefinition() _options = _requestOptionsParam.ToApi(); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "ClientPipelineExtensions"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientUriBuilderDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientUriBuilderDefinition.cs index 92e0cf23a67..94b39a45088 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientUriBuilderDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientUriBuilderDefinition.cs @@ -15,7 +15,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal sealed class ClientUriBuilderDefinition : TypeProvider + internal sealed class ClientUriBuilderDefinition : InternalHelperProvider { private const string ToUriMethodName = "ToUri"; private const string ResetMethodName = "Reset"; @@ -63,10 +63,7 @@ public ClientUriBuilderDefinition() _pathLengthField = new(FieldModifiers.Private, typeof(int), "_pathLength", this); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal; - } + protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Internal; protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ErrorResultDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ErrorResultDefinition.cs index 05615bddea0..ee1abd3f5b9 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ErrorResultDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ErrorResultDefinition.cs @@ -12,7 +12,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal class ErrorResultDefinition : TypeProvider + internal class ErrorResultDefinition : InternalHelperProvider { private class ErrorResultTemplate { } diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs index f6f6cebbd49..fe2d01a2a94 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.cs @@ -27,7 +27,7 @@ #pragma warning disable SCME0004 // FileBinaryContent is evaluation-only. namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - public sealed partial class ModelSerializationExtensionsDefinition : TypeProvider + public sealed partial class ModelSerializationExtensionsDefinition : InternalHelperProvider { public const string WireOptionsFieldName = "WireOptions"; public const string JsonDocumentOptionsFieldName = "JsonDocumentOptions"; @@ -96,11 +96,6 @@ public ModelSerializationExtensionsDefinition() enclosingType: this); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - internal FieldProvider WireOptionsField { get; } private readonly FieldProvider _jsonDocumentOptionsField; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultiPartFormDataBinaryContentDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultiPartFormDataBinaryContentDefinition.cs index 3ba1fad08c9..71fbc189889 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultiPartFormDataBinaryContentDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultiPartFormDataBinaryContentDefinition.cs @@ -21,7 +21,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - public class MultiPartFormDataBinaryContentDefinition : TypeProvider + public class MultiPartFormDataBinaryContentDefinition : InternalHelperProvider { private readonly ScopedApi _multipartContentExpression; private readonly FieldProvider _multipartContentField; @@ -77,7 +77,8 @@ public MultiPartFormDataBinaryContentDefinition() protected override string BuildName() => $"MultiPartFormData{_requestContentType.Name}"; - protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Class | TypeSignatureModifiers.Internal; + protected override TypeSignatureModifiers BuildDeclarationModifiers() + => TypeSignatureModifiers.Internal | TypeSignatureModifiers.Class; protected override CSharpType BuildBaseType() => _requestContentType; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataHelperDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataHelperDefinition.cs index 14f332d2cbc..61f4360d8c3 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataHelperDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataHelperDefinition.cs @@ -14,7 +14,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal class MultipartFormDataHelperDefinition : TypeProvider + internal class MultipartFormDataHelperDefinition : InternalHelperProvider { private const string _fromEnumerableName = "FromEnumerable"; private const string _fromDictionaryName = "FromDictionary"; @@ -24,9 +24,6 @@ internal class MultipartFormDataHelperDefinition : TypeProvider protected override string BuildName() => "MultipartFormDataHelper"; - protected override TypeSignatureModifiers BuildDeclarationModifiers() - => TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static | TypeSignatureModifiers.Partial | TypeSignatureModifiers.Class; - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override MethodProvider[] BuildMethods() diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs index 288b7f1af24..12e90056ddb 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/PipelineRequestHeadersExtensionsDefinition.cs @@ -15,7 +15,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal class PipelineRequestHeadersExtensionsDefinition : TypeProvider + internal class PipelineRequestHeadersExtensionsDefinition : InternalHelperProvider { private const string _setDelimited = "SetDelimited"; private const string _addWithPrefix = "Add"; @@ -25,11 +25,6 @@ public PipelineRequestHeadersExtensionsDefinition() _pipelineRequestHeadersParam = new ParameterProvider("headers", FormattableStringHelpers.Empty, typeof(PipelineRequestHeaders)); } private readonly CSharpType _t = typeof(IEnumerable<>).GetGenericArguments()[0]; - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "PipelineRequestHeadersExtensions"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/TypeFormattersDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/TypeFormattersDefinition.cs index 4e0509bc78e..5cb9637827f 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/TypeFormattersDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/TypeFormattersDefinition.cs @@ -16,7 +16,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - internal sealed class TypeFormattersDefinition : TypeProvider + internal sealed class TypeFormattersDefinition : InternalHelperProvider { private readonly ValueExpression _invariantCultureExpression = new MemberExpression(typeof(CultureInfo), nameof(CultureInfo.InvariantCulture)); private const string ToStringMethodName = "ToString"; @@ -33,11 +33,6 @@ internal TypeFormattersDefinition() _defaultNumberFormatField = new(FieldModifiers.Public | FieldModifiers.Const, typeof(string), "DefaultNumberFormat", this, initializationValue: Literal("G")); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "TypeFormatters"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/Utf8JsonBinaryContentDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/Utf8JsonBinaryContentDefinition.cs index d470b06b8d6..2d7f1ad298a 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/Utf8JsonBinaryContentDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/Utf8JsonBinaryContentDefinition.cs @@ -16,7 +16,7 @@ namespace Microsoft.TypeSpec.Generator.ClientModel.Providers { - public class Utf8JsonBinaryContentDefinition : TypeProvider + public class Utf8JsonBinaryContentDefinition : InternalHelperProvider { private const string _jsonWriterName = "JsonWriter"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs index ba4c5ffe6a1..a09c248b4f5 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmCodeModelGenerator.cs @@ -24,8 +24,9 @@ public class ScmCodeModelGenerator : CodeModelGenerator public override ScmTypeFactory TypeFactory { get; } - internal ModelSerializationExtensionsDefinition ModelSerializationExtensionsDefinition { get; } = - new ModelSerializationExtensionsDefinition(); + internal ModelSerializationExtensionsDefinition ModelSerializationExtensionsDefinition + => _modelSerializationExtensionsDefinition ??= new ModelSerializationExtensionsDefinition(); + private ModelSerializationExtensionsDefinition? _modelSerializationExtensionsDefinition; internal SerializationFormatDefinition SerializationFormatDefinition { get; } = new SerializationFormatDefinition(); @@ -50,6 +51,7 @@ protected override void Configure() AddMetadataReference(MetadataReference.CreateFromFile(typeof(BinaryData).Assembly.Location)); AddMetadataReference(MetadataReference.CreateFromFile(typeof(JsonSerializer).Assembly.Location)); AddTypeToKeep(ModelReaderWriterContextDefinition.s_name, isRoot: false); + AddTypeToKeep(SerializationFormatDefinition, isRoot: false); } public override async Task WriteAdditionalFiles(string outputPath) diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs index dc42f801732..9d84d3494c2 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/PostProcessing/PostProcessor.cs @@ -91,8 +91,7 @@ private async Task GetTypeSymbolsAsync(Compilation compilation, // we do not add the model factory and additionalNonRootTypeSymbols to the declared symbol list // so that it will never be included in any process of internalization or removal if (SymbolEqualityComparer.Default.Equals(symbol, _modelFactorySymbol) - || _additionalNonRootTypeNames.Contains(symbol.Name) - || _additionalNonRootTypeNames.Contains(symbol.GetFullyQualifiedName())) + || IsAdditionalNonRootType(symbol)) { continue; } @@ -110,6 +109,24 @@ private async Task GetTypeSymbolsAsync(Compilation compilation, kv => kv.Value.ToHashSet(SymbolEqualityComparer.Default))); } + private bool IsAdditionalNonRootType(INamedTypeSymbol symbol) + { + if (_additionalNonRootTypeNames.Contains(symbol.Name)) + { + return true; + } + + var fullyQualifiedName = symbol.GetFullyQualifiedName(); + if (_additionalNonRootTypeNames.Contains(fullyQualifiedName)) + { + return true; + } + + var genericArityIndex = fullyQualifiedName.IndexOf('`'); + return genericArityIndex > 0 + && _additionalNonRootTypeNames.Contains(fullyQualifiedName[..genericArityIndex]); + } + protected virtual bool ShouldIncludeDocument(Document document) => !GeneratedCodeWorkspace.IsGeneratedTestDocument(document); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ArgumentDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ArgumentDefinition.cs index 6c7e62bd102..1a8e77b5554 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ArgumentDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ArgumentDefinition.cs @@ -15,7 +15,7 @@ namespace Microsoft.TypeSpec.Generator.Providers { - internal class ArgumentDefinition : TypeProvider + internal class ArgumentDefinition : InternalHelperProvider { private class Template { } @@ -34,11 +34,6 @@ public ArgumentDefinition() _nullableT = _t.WithNullable(true); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - private MethodSignature GetSignature( string name, IReadOnlyList parameters, diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingDictionaryDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingDictionaryDefinition.cs index 97e38db6102..4e6385205ec 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingDictionaryDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingDictionaryDefinition.cs @@ -13,7 +13,7 @@ namespace Microsoft.TypeSpec.Generator.Providers { - internal sealed class ChangeTrackingDictionaryDefinition : TypeProvider + internal sealed class ChangeTrackingDictionaryDefinition : InternalHelperProvider { private class ChangeTrackingDictionaryTemplate { } private readonly CSharpType _tKey = typeof(ChangeTrackingDictionaryTemplate<,>).GetGenericArguments()[0]; @@ -48,10 +48,7 @@ public ChangeTrackingDictionaryDefinition() protected override WhereExpression BuildWhereClause() => Where.NotNull(_tKey); - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal; - } + protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Internal; protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingListDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingListDefinition.cs index 6cbe1ba6469..ee4c5ce0e9d 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingListDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ChangeTrackingListDefinition.cs @@ -13,7 +13,7 @@ namespace Microsoft.TypeSpec.Generator.Providers { - internal sealed class ChangeTrackingListDefinition : TypeProvider + internal sealed class ChangeTrackingListDefinition : InternalHelperProvider { private class ChangeTrackingListTemplate { } @@ -46,10 +46,7 @@ public ChangeTrackingListDefinition() EnsureList = new(This.Invoke(_ensureListSignature)); } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal; - } + protected override TypeSignatureModifiers BuildDeclarationModifiers() => TypeSignatureModifiers.Internal; protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/InternalHelperProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/InternalHelperProvider.cs new file mode 100644 index 00000000000..d11a3490a4a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/InternalHelperProvider.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Microsoft.TypeSpec.Generator.Input; +using Microsoft.TypeSpec.Generator.Primitives; + +namespace Microsoft.TypeSpec.Generator.Providers +{ + /// + /// A base provider for generator-owned internal helper types that must not be removed during post-processing. + /// + public abstract class InternalHelperProvider : TypeProvider + { + protected InternalHelperProvider(InputType? inputType = default) : base(inputType) + { + CodeModelGenerator.Instance.AddTypeToKeep(this, isRoot: false); + } + + protected override TypeSignatureModifiers BuildDeclarationModifiers() + => TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/OptionalDefinition.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/OptionalDefinition.cs index cfd71ebb0a6..af7b996bd59 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/OptionalDefinition.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/OptionalDefinition.cs @@ -11,7 +11,7 @@ namespace Microsoft.TypeSpec.Generator.Providers { - public class OptionalDefinition : TypeProvider + public class OptionalDefinition : InternalHelperProvider { private class ListTemplate { } @@ -29,11 +29,6 @@ public OptionalDefinition() _tValue = _genericChangeTrackingDictionary.Arguments[1]; } - protected override TypeSignatureModifiers BuildDeclarationModifiers() - { - return TypeSignatureModifiers.Internal | TypeSignatureModifiers.Static; - } - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", "Internal", $"{Name}.cs"); protected override string BuildName() => "Optional"; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs index 07065943b7b..0495fdd0e30 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs @@ -17,9 +17,13 @@ namespace Microsoft.TypeSpec.Generator { public class TypeFactory { - private ChangeTrackingListDefinition ChangeTrackingListProvider { get; } = new(); + private ChangeTrackingListDefinition ChangeTrackingListProvider + => _changeTrackingListProvider ??= new(); + private ChangeTrackingListDefinition? _changeTrackingListProvider; - private ChangeTrackingDictionaryDefinition ChangeTrackingDictionaryProvider { get; } = new(); + private ChangeTrackingDictionaryDefinition ChangeTrackingDictionaryProvider + => _changeTrackingDictionaryProvider ??= new(); + private ChangeTrackingDictionaryDefinition? _changeTrackingDictionaryProvider; private Dictionary InputTypeToModelProvider { get; } = []; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs index 34e119f008a..00d37d01d8b 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/TypeProviderTests.cs @@ -1223,6 +1223,17 @@ public void TestSpecViewIsNotNull() Assert.IsInstanceOf(specView); } + [Test] + public void InternalHelperProviderIsKeptAsNonRoot() + { + var typeProvider = new TestInternalHelperProvider(); + + Assert.IsTrue(typeProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Internal)); + Assert.IsTrue(typeProvider.DeclarationModifiers.HasFlag(TypeSignatureModifiers.Static)); + Assert.IsFalse(CodeModelGenerator.Instance.AdditionalRootTypes.Contains(typeProvider.Type.FullyQualifiedName)); + Assert.IsTrue(CodeModelGenerator.Instance.NonRootTypes.Contains(typeProvider.Type.FullyQualifiedName)); + } + [Test] public void TestSpecViewDelegatesCorrectly() { @@ -1288,5 +1299,12 @@ public async Task CanonicalViewDedupesCustomOperators() !m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Implicit) && !m.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Explicit))); } + + private sealed class TestInternalHelperProvider : InternalHelperProvider + { + protected override string BuildName() => nameof(TestInternalHelperProvider); + + protected override string BuildRelativeFilePath() => $"{Name}.cs"; + } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local.Tests/UnreferencedTypeTests.cs b/packages/http-client-csharp/generator/TestProjects/Local.Tests/UnreferencedTypeTests.cs index 44eeaceec62..b664bf1d2c4 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local.Tests/UnreferencedTypeTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local.Tests/UnreferencedTypeTests.cs @@ -11,12 +11,12 @@ namespace TestProjects.Local.Tests public class UnreferencedTypeTests { [Test] - public void UnreferencedTypesAreRemoved() + public void InternalHelperTypesAreKept() { var types = Assembly.GetAssembly(typeof(SampleTypeSpecClient))!.GetTypes(); - Assert.IsFalse(types.Any(t => t.Name == "BinaryContentHelper")); - Assert.IsFalse(types.Any(t => t.Name == "PipelineRequestHeadersExtensions")); - Assert.IsFalse(types.Any(t => t.Name == "Utf8JsonBinaryContent")); + Assert.IsTrue(types.Any(t => t.Name == "BinaryContentHelper")); + Assert.IsTrue(types.Any(t => t.Name == "PipelineRequestHeadersExtensions")); + Assert.IsTrue(types.Any(t => t.Name == "Utf8JsonBinaryContent")); } } } diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/BinaryContentHelper.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/BinaryContentHelper.cs new file mode 100644 index 00000000000..b76cf24aa37 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/BinaryContentHelper.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel; +using System.Collections.Generic; +using System.IO; +using System.Text.Json; +using System.Xml; + +namespace SampleTypeSpec +{ + internal static partial class BinaryContentHelper + { + /// + public static BinaryContent FromEnumerable(IEnumerable enumerable) + where T : notnull + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + /// + public static BinaryContent FromEnumerable(IEnumerable enumerable) + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + if (item == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + /// + public static BinaryContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartArray(); + int i = 0; + for (; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + /// + public static BinaryContent FromDictionary(IDictionary dictionary) + where TValue : notnull + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + content.JsonWriter.WriteObjectValue(item.Value, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + /// + public static BinaryContent FromDictionary(IDictionary dictionary) + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + if (item.Value == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + /// + public static BinaryContent FromObject(object value) + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteObjectValue(value, ModelSerializationExtensions.WireOptions); + return content; + } + + /// + public static BinaryContent FromObject(BinaryData value) + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(value); +#else + using (JsonDocument document = JsonDocument.Parse(value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + + /// + /// + /// + public static BinaryContent FromEnumerable(IEnumerable enumerable, string rootNameHint, string childNameHint) + where T : notnull + { + using (MemoryStream stream = new MemoryStream(256)) + { + using (XmlWriter writer = XmlWriter.Create(stream, ModelSerializationExtensions.XmlWriterSettings)) + { + writer.WriteStartElement(rootNameHint); + foreach (var item in enumerable) + { + writer.WriteObjectValue(item, ModelSerializationExtensions.WireOptions, childNameHint); + } + writer.WriteEndElement(); + } + + if (stream.Position > int.MaxValue) + { + return BinaryContent.Create(BinaryData.FromStream(stream)); + } + else + { + return BinaryContent.Create(new BinaryData(stream.GetBuffer().AsMemory(0, (int)stream.Position))); + } + } + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/PipelineRequestHeadersExtensions.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/PipelineRequestHeadersExtensions.cs new file mode 100644 index 00000000000..69ddd4aee41 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/PipelineRequestHeadersExtensions.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; + +namespace SampleTypeSpec +{ + internal static partial class PipelineRequestHeadersExtensions + { + /// + /// The name. + /// The value. + /// The delimiter. + public static void SetDelimited(this PipelineRequestHeaders headers, string name, IEnumerable value, string delimiter) + { + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v)); + headers.Set(name, string.Join(delimiter, stringValues)); + } + + /// + /// The name. + /// The value. + /// The delimiter. + /// The format. + public static void SetDelimited(this PipelineRequestHeaders headers, string name, IEnumerable value, string delimiter, SerializationFormat format) + { + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + headers.Set(name, string.Join(delimiter, stringValues)); + } + + /// + /// The prefix to prepend to each header key. + /// The dictionary of headers to add. + public static void Add(this PipelineRequestHeaders headers, string prefix, IDictionary value) + { + foreach (var header in value) + { + headers.Add(prefix + header.Key, header.Value); + } + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs new file mode 100644 index 00000000000..f4586e305fc --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Internal/Utf8JsonBinaryContent.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel; +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; + +namespace SampleTypeSpec +{ + internal partial class Utf8JsonBinaryContent : BinaryContent + { + private readonly MemoryStream _stream; + private readonly BinaryContent _content; + + public Utf8JsonBinaryContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + /// Gets the JsonWriter. + public Utf8JsonWriter JsonWriter { get; } + + /// The stream containing the data to be written. + /// The cancellation token to use. + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + /// The stream containing the data to be written. + /// The cancellation token to use. + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + /// + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} From c6c1393efdaad7aff6dd9d0abfd8811815cb3ef0 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 20 Jul 2026 17:16:25 +0800 Subject: [PATCH 027/249] Enable QueryTests dollar-sign test for http-client-java (#11307) ## Summary The `parameters.query.QueryTests#testDollarSign` test in `http-client-generator-clientcore-test` was disabled pending the `@typespec/http-specs` dollar-sign route fix. That fix is now published (http-specs `0.1.0-alpha.38`), and the already-generated `SpecialCharClient.dollarSign` code matches the current spec (route `/parameters/query/special-char/dollar-sign`, `@QueryParam("$filter")`). This PR removes the `@Disabled` annotation (and its now-unused import) to enable the test. ## Validation `mvn test -Dtest=parameters.query.QueryTests` against the spector mock server: **2 run, 0 failures, 0 skipped**. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ...lient-java-enable-query-dollarsign-2026-7-20-16-28-0.md | 7 +++++++ .../src/test/java/parameters/query/QueryTests.java | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .chronus/changes/http-client-java-enable-query-dollarsign-2026-7-20-16-28-0.md diff --git a/.chronus/changes/http-client-java-enable-query-dollarsign-2026-7-20-16-28-0.md b/.chronus/changes/http-client-java-enable-query-dollarsign-2026-7-20-16-28-0.md new file mode 100644 index 00000000000..ac5f4797e79 --- /dev/null +++ b/.chronus/changes/http-client-java-enable-query-dollarsign-2026-7-20-16-28-0.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-java" +--- + +Enable the `parameters.query.QueryTests` dollar-sign test in the clientcore test module now that the `@typespec/http-specs` dollar-sign route fix is published. diff --git a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/test/java/parameters/query/QueryTests.java b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/test/java/parameters/query/QueryTests.java index 8f512938876..1186273a2b0 100644 --- a/packages/http-client-java/generator/http-client-generator-clientcore-test/src/test/java/parameters/query/QueryTests.java +++ b/packages/http-client-java/generator/http-client-generator-clientcore-test/src/test/java/parameters/query/QueryTests.java @@ -3,7 +3,6 @@ package parameters.query; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; public class QueryTests { @@ -17,7 +16,6 @@ public void testConstant() { } @Test - @Disabled("Blocked until @typespec/http-specs publishes the dollar-sign route fix") public void testDollarSign() { specialCharClient.dollarSign("status eq 'active'"); } From 6823f655f394df37b250a5b8106db59a39695662 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 20 Jul 2026 22:30:33 +0800 Subject: [PATCH 028/249] feat(tspd): auto-generate linter rule and diagnostic reference pages (#11221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #11141 Auto-generate a reference documentation page per **linter rule** and per **diagnostic** with `tspd`, so these pages stop being hand-written and drift-prone. > [!NOTE] > This PR is scoped to the `tspd` documentation generation. The `referenceDocs.baseUrl` url auto-generation and the language server hover that surfaces these docs at a reported error are split into a follow-up PR. ## Compiler - **`docs` field on diagnostics and linter rules.** Both `createRule` and diagnostic definitions accept a `docs` field for extended documentation: ```ts export const myRule = createRule({ name: "my-rule", severity: "warning", description: "Short description.", docs: fileRef.fromPackageRoot("src/rules/my-rule.md"), messages: { /* ... */ }, }); ``` The value is `string | FileRef`: either inline markdown, or a `FileRef` created via `fileRef.fromPackageRoot("...")`. A `FileRef` is a plain `{ kind, path }` data object read **lazily** by tooling, so it is safe to include in code bundled for the browser (e.g. the playground). Because the docs live on the definition, they are available at compile time, not just to `tspd`. ## tspd `tspd doc` now renders: - one page per rule -> `reference/rules/.md` - one page per diagnostic -> `reference/diagnostics/.md` (each shows its severity) - a `documentation-missing` warning for every rule/diagnostic without `docs`. ## Pilots Content is faithfully migrated from the hand-written pages, which are then deleted: - **`@typespec/http`** — the `op-reference-container-route` rule. - **`@typespec/openapi3`** — 6 diagnostics (`path-query`, `duplicate-header`, `inline-cycle`, `invalid-schema`, `invalid-server-variable`, `union-null`); the old hand-written `emitters/openapi3/diagnostics.md` is replaced by the generated pages under `reference/diagnostics/`. ## Validation - Built `compiler`, `tspd`, `http`, `openapi3`; regen is stable (running it twice produces no diff). - `lint` green for the touched packages; the `op-reference-container-route` rule tests pass. --------- Co-authored-by: tadelesh Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../diagnostic-docs-openapi3-2026-6-9.md | 7 + .../rule-diagnostic-docs-compiler-2026-6-9.md | 19 ++ .../rule-diagnostic-docs-tspd-2026-6-9.md | 7 + .chronus/changes/rule-docs-http-2026-6-9.md | 7 + packages/compiler/src/core/file-ref.ts | 31 +++ packages/compiler/src/core/types.ts | 13 ++ packages/compiler/src/index.ts | 1 + .../src/rules/op-reference-container-route.md | 38 ++++ .../src/rules/op-reference-container-route.ts | 3 +- .../src/diagnostics/duplicate-header.md | 22 ++ .../openapi3/src/diagnostics/inline-cycle.md | 19 ++ .../src/diagnostics/invalid-schema.md | 20 ++ .../diagnostics/invalid-server-variable.md | 14 ++ .../openapi3/src/diagnostics/path-query.md | 26 +++ .../openapi3/src/diagnostics/union-null.md | 3 + packages/openapi3/src/lib.ts | 8 +- .../tspd/src/ref-doc/emitters/starlight.ts | 45 +++- packages/tspd/src/ref-doc/extractor.ts | 83 ++++++- packages/tspd/src/ref-doc/lib.ts | 2 + packages/tspd/src/ref-doc/types.ts | 11 + website/src/content/current-sidebar.ts | 3 +- .../docs/emitters/openapi3/diagnostics.md | 203 ------------------ .../reference/diagnostics/duplicate-header.md | 32 +++ .../reference/diagnostics/inline-cycle.md | 29 +++ .../reference/diagnostics/invalid-schema.md | 30 +++ .../diagnostics/invalid-server-variable.md | 24 +++ .../reference/diagnostics/path-query.md | 36 ++++ .../reference/diagnostics/union-null.md | 13 ++ .../docs/docs/extending-typespec/linters.md | 24 +++ .../docs/libraries/http/reference/linter.md | 6 +- .../rules/op-reference-container-route.md | 6 +- 31 files changed, 565 insertions(+), 220 deletions(-) create mode 100644 .chronus/changes/diagnostic-docs-openapi3-2026-6-9.md create mode 100644 .chronus/changes/rule-diagnostic-docs-compiler-2026-6-9.md create mode 100644 .chronus/changes/rule-diagnostic-docs-tspd-2026-6-9.md create mode 100644 .chronus/changes/rule-docs-http-2026-6-9.md create mode 100644 packages/compiler/src/core/file-ref.ts create mode 100644 packages/http/src/rules/op-reference-container-route.md create mode 100644 packages/openapi3/src/diagnostics/duplicate-header.md create mode 100644 packages/openapi3/src/diagnostics/inline-cycle.md create mode 100644 packages/openapi3/src/diagnostics/invalid-schema.md create mode 100644 packages/openapi3/src/diagnostics/invalid-server-variable.md create mode 100644 packages/openapi3/src/diagnostics/path-query.md create mode 100644 packages/openapi3/src/diagnostics/union-null.md delete mode 100644 website/src/content/docs/docs/emitters/openapi3/diagnostics.md create mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md create mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md create mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md create mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md create mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md create mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md rename website/src/content/docs/docs/libraries/http/{ => reference}/rules/op-reference-container-route.md (67%) diff --git a/.chronus/changes/diagnostic-docs-openapi3-2026-6-9.md b/.chronus/changes/diagnostic-docs-openapi3-2026-6-9.md new file mode 100644 index 00000000000..d0f48cdd763 --- /dev/null +++ b/.chronus/changes/diagnostic-docs-openapi3-2026-6-9.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/openapi3" +--- + +Provide extended documentation for several diagnostics (`path-query`, `duplicate-header`, `inline-cycle`, `invalid-schema`, `invalid-server-variable`, `union-null`) via co-located markdown files. diff --git a/.chronus/changes/rule-diagnostic-docs-compiler-2026-6-9.md b/.chronus/changes/rule-diagnostic-docs-compiler-2026-6-9.md new file mode 100644 index 00000000000..89055a06460 --- /dev/null +++ b/.chronus/changes/rule-diagnostic-docs-compiler-2026-6-9.md @@ -0,0 +1,19 @@ +--- +changeKind: feature +packages: + - "@typespec/compiler" +--- + +Add a `docs` field to linter rule and diagnostic definitions to provide extended reference documentation. The value can be an inline markdown string or a `FileRef` created with `fileRef.fromPackageRoot("src/rules/my-rule.md")`, which is read lazily by tooling so it stays safe to bundle for the browser. + +```ts +export const myRule = createRule({ + name: "my-rule", + severity: "warning", + description: "Short description.", + docs: fileRef.fromPackageRoot("src/rules/my-rule.md"), + messages: { + /* ... */ + }, +}); +``` diff --git a/.chronus/changes/rule-diagnostic-docs-tspd-2026-6-9.md b/.chronus/changes/rule-diagnostic-docs-tspd-2026-6-9.md new file mode 100644 index 00000000000..648109d23d9 --- /dev/null +++ b/.chronus/changes/rule-diagnostic-docs-tspd-2026-6-9.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/tspd" +--- + +`tspd doc` now generates a documentation page per linter rule (`reference/rules/.md`) and per diagnostic (`reference/diagnostics/.md`), sourced from the `docs` field on the rule and diagnostic definitions. A `documentation-missing` warning is reported for any linter rule or diagnostic that does not provide documentation. diff --git a/.chronus/changes/rule-docs-http-2026-6-9.md b/.chronus/changes/rule-docs-http-2026-6-9.md new file mode 100644 index 00000000000..d36a6ffc4c8 --- /dev/null +++ b/.chronus/changes/rule-docs-http-2026-6-9.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http" +--- + +Provide extended documentation for the `op-reference-container-route` linter rule via a co-located markdown file. diff --git a/packages/compiler/src/core/file-ref.ts b/packages/compiler/src/core/file-ref.ts new file mode 100644 index 00000000000..5d787c93a5a --- /dev/null +++ b/packages/compiler/src/core/file-ref.ts @@ -0,0 +1,31 @@ +/** + * A lazy reference to a file on disk. Unlike embedding the file content directly, a + * `FileRef` only describes *where* the content lives; it is resolved (read) by tooling + * such as `tspd` when needed. Because it does not read the file at definition time, it is + * safe to include in code that is bundled for the browser (e.g. the playground). + */ +export interface FileRef { + readonly kind: "file-ref"; + /** Path to the file, relative to the package root. */ + readonly path: string; +} + +export const fileRef = { + /** + * Create a {@link FileRef} pointing to a file relative to the package root (the directory + * containing the library's `package.json`). + * + * @example + * ```ts + * docs: fileRef.fromPackageRoot("src/rules/my-rule.md"), + * ``` + */ + fromPackageRoot(path: string): FileRef { + return { kind: "file-ref", path }; + }, +}; + +/** Type guard for {@link FileRef}. */ +export function isFileRef(value: unknown): value is FileRef { + return typeof value === "object" && value !== null && (value as FileRef).kind === "file-ref"; +} diff --git a/packages/compiler/src/core/types.ts b/packages/compiler/src/core/types.ts index 9e6c2c43e38..96606f13daf 100644 --- a/packages/compiler/src/core/types.ts +++ b/packages/compiler/src/core/types.ts @@ -1,6 +1,7 @@ import type { JSONSchemaType as AjvJSONSchemaType } from "ajv"; import type { ModuleResolutionResult } from "../module-resolver/index.js"; import type { YamlPathTarget, YamlScript } from "../yaml/types.js"; +import type { FileRef } from "./file-ref.js"; import type { Numeric } from "./numeric.js"; import type { Program } from "./program.js"; import type { TokenFlags } from "./scanner.js"; @@ -2417,6 +2418,12 @@ export interface DiagnosticDefinition { readonly description?: string; /** Specifies the URL at which the full documentation can be accessed. */ readonly url?: string; + /** + * Extended documentation for this diagnostic. Surfaced both in generated reference + * documentation and in editor tooling (e.g. completion and hover). Either raw markdown, + * or a {@link FileRef} pointing to a markdown file (recommended). + */ + readonly docs?: string | FileRef; } export interface DiagnosticMessages { @@ -2564,6 +2571,12 @@ interface LinterRuleDefinitionBase< description: string; /** Specifies the URL at which the full documentation can be accessed. */ url?: string; + /** + * Extended documentation for this rule. Surfaced both in generated reference + * documentation and in editor tooling (e.g. completion and hover). Either raw markdown, + * or a {@link FileRef} pointing to a markdown file (recommended). + */ + docs?: string | FileRef; /** Messages that can be reported with the diagnostic. */ messages: DM; /** diff --git a/packages/compiler/src/index.ts b/packages/compiler/src/index.ts index 3af1f8bc617..57bbe1acb87 100644 --- a/packages/compiler/src/index.ts +++ b/packages/compiler/src/index.ts @@ -47,6 +47,7 @@ export { type WriteLine, } from "./core/diagnostics.js"; export { emitFile, type EmitFileOptions, type NewLine } from "./core/emitter-utils.js"; +export { fileRef, isFileRef, type FileRef } from "./core/file-ref.js"; export { checkFormatTypeSpec, formatTypeSpec } from "./core/formatter.js"; export { DiscriminatedUnion, diff --git a/packages/http/src/rules/op-reference-container-route.md b/packages/http/src/rules/op-reference-container-route.md new file mode 100644 index 00000000000..509246c8c54 --- /dev/null +++ b/packages/http/src/rules/op-reference-container-route.md @@ -0,0 +1,38 @@ +When referencing an operation with `op is`, only the data on the operation itself is carried over; anything on the parent container is lost. +This results in unexpected behavior where information is lost. +As a best practice the route should be provided on the operation itself. + +#### ❌ Incorrect + +```tsp +namespace Library { + @route("/pets") + interface Pets { + @route("/read") read(): string; + } +} + +@service +namespace Service { + interface PetStore { + readPet is Library.Pets.read; + } +} +``` + +#### ✅ Correct + +```tsp +namespace Library { + interface Pets { + @route("/pets/read") read(): string; + } +} + +@service +namespace Service { + interface PetStore { + readPet is Library.Pets.read; + } +} +``` diff --git a/packages/http/src/rules/op-reference-container-route.ts b/packages/http/src/rules/op-reference-container-route.ts index 2f59f779efd..29becc083cd 100644 --- a/packages/http/src/rules/op-reference-container-route.ts +++ b/packages/http/src/rules/op-reference-container-route.ts @@ -1,4 +1,4 @@ -import { Operation, createRule, paramMessage } from "@typespec/compiler"; +import { Operation, createRule, fileRef, paramMessage } from "@typespec/compiler"; import { getRoutePath } from "../route.js"; import { OperationContainer } from "../types.js"; @@ -8,6 +8,7 @@ export const opReferenceContainerRouteRule = createRule({ description: "Check for referenced (`op is`) operations which have a @route on one of their containers.", url: "https://typespec.io/docs/libraries/http/rules/op-reference-container-route", + docs: fileRef.fromPackageRoot("src/rules/op-reference-container-route.md"), messages: { default: paramMessage`Operation ${"opName"} references an operation which has a @route prefix on its namespace or interface: "${"routePrefix"}". This operation will not carry forward the route prefix so the final route may be different than the referenced operation.`, }, diff --git a/packages/openapi3/src/diagnostics/duplicate-header.md b/packages/openapi3/src/diagnostics/duplicate-header.md new file mode 100644 index 00000000000..0ddd10ecde7 --- /dev/null +++ b/packages/openapi3/src/diagnostics/duplicate-header.md @@ -0,0 +1,22 @@ +This diagnostic is issued when a response header is defined more than once for a response of a specific status code. + +To fix this issue, ensure that each response header is defined only once for each status code. + +### Example + +```yaml +responses: + "200": + description: Successful response + headers: + X-Rate-Limit: + description: The number of allowed requests in the current period + schema: + type: integer + X-Rate-Limit: + description: The number of allowed requests in the current period + schema: + type: integer +``` + +In this example, the `X-Rate-Limit` header is defined twice for the `200` status code. To fix this issue, remove the duplicate header definition. diff --git a/packages/openapi3/src/diagnostics/inline-cycle.md b/packages/openapi3/src/diagnostics/inline-cycle.md new file mode 100644 index 00000000000..4e4c3b635b5 --- /dev/null +++ b/packages/openapi3/src/diagnostics/inline-cycle.md @@ -0,0 +1,19 @@ +This diagnostic is issued when a cyclic reference is detected within inline schemas. + +To fix this issue, refactor the schemas to remove the cyclic reference. + +### Example + +```yaml +components: + schemas: + Node: + type: object + properties: + value: + type: string + next: + $ref: "#/components/schemas/Node" +``` + +In this example, the `Node` schema references itself, creating a cyclic reference. To fix this issue, refactor the schema to remove the cyclic reference. diff --git a/packages/openapi3/src/diagnostics/invalid-schema.md b/packages/openapi3/src/diagnostics/invalid-schema.md new file mode 100644 index 00000000000..1e42f170432 --- /dev/null +++ b/packages/openapi3/src/diagnostics/invalid-schema.md @@ -0,0 +1,20 @@ +This diagnostic is issued when a schema is invalid according to the OpenAPI v3 specification. + +To fix this issue, review your TypeSpec definitions to ensure they map to valid OpenAPI schemas. + +### Example + +```yaml +components: + schemas: + User: + type: object + properties: + id: + type: string + age: + type: integer + format: "int" # Invalid format +``` + +In this example, the `format` value for the `age` property is invalid. To fix this issue, provide a valid format value such as `int32` or `int64`. diff --git a/packages/openapi3/src/diagnostics/invalid-server-variable.md b/packages/openapi3/src/diagnostics/invalid-server-variable.md new file mode 100644 index 00000000000..fe1c6d6d453 --- /dev/null +++ b/packages/openapi3/src/diagnostics/invalid-server-variable.md @@ -0,0 +1,14 @@ +This diagnostic is issued when a variable in the `@server` decorator is not defined as a string type. +Since server variables are substituted into the server URL which is a string, all variables must have string values. + +To fix this issue, make sure all server variables are of a type that is assignable to `string`. + +### Example + +```typespec +@server("{protocol}://{host}/api/{version}", "Custom endpoint", { + protocol: "http" | "https", + host: string, + version: 1, // Should be a string: "1" +}) +``` diff --git a/packages/openapi3/src/diagnostics/path-query.md b/packages/openapi3/src/diagnostics/path-query.md new file mode 100644 index 00000000000..38e8aee9194 --- /dev/null +++ b/packages/openapi3/src/diagnostics/path-query.md @@ -0,0 +1,26 @@ +This diagnostic is issued when the OpenAPI emitter finds an `@route` decorator that specifies a path that contains a query parameter. This is not permitted by the OpenAPI v3 specification, which requires query parameters to be defined separately. + +To fix this issue, redesign the API to only use paths without query parameters, and define query parameters using the `@query` decorator. + +### Example + +Instead of: + +```typespec +@route("/users?filter={filter}") +op getUsers(filter: string): User[]; +``` + +Use: + +```typespec +@route("/users") +op getUsers(@query filter?: string): User[]; +``` + +Alternatively, you can leverage TypeSpec's support for URI templates: + +```typespec +@route("/users{?filter}") +op getUsers(filter?: string): User[]; +``` diff --git a/packages/openapi3/src/diagnostics/union-null.md b/packages/openapi3/src/diagnostics/union-null.md new file mode 100644 index 00000000000..f75fc66f844 --- /dev/null +++ b/packages/openapi3/src/diagnostics/union-null.md @@ -0,0 +1,3 @@ +This diagnostic is issued when the result of model composition is effectively a `null` schema which cannot be represented in OpenAPI. + +To fix this issue, review your model compositions to ensure they produce valid schemas with actual properties or types. diff --git a/packages/openapi3/src/lib.ts b/packages/openapi3/src/lib.ts index 9eb420c41d7..4430ae7814e 100644 --- a/packages/openapi3/src/lib.ts +++ b/packages/openapi3/src/lib.ts @@ -1,4 +1,4 @@ -import { createTypeSpecLibrary, JSONSchemaType, paramMessage } from "@typespec/compiler"; +import { createTypeSpecLibrary, fileRef, JSONSchemaType, paramMessage } from "@typespec/compiler"; export type FileType = "yaml" | "json"; export type OpenAPIVersion = "3.0.0" | "3.1.0" | "3.2.0"; @@ -321,6 +321,7 @@ export const $lib = createTypeSpecLibrary({ }, "invalid-server-variable": { severity: "error", + docs: fileRef.fromPackageRoot("src/diagnostics/invalid-server-variable.md"), messages: { default: paramMessage`Server variable '${"propName"}' must be assignable to 'string'. It must either be a string, enum of string or union of strings.`, }, @@ -352,12 +353,14 @@ export const $lib = createTypeSpecLibrary({ }, "path-query": { severity: "error", + docs: fileRef.fromPackageRoot("src/diagnostics/path-query.md"), messages: { default: `OpenAPI does not allow paths containing a query string.`, }, }, "duplicate-header": { severity: "error", + docs: fileRef.fromPackageRoot("src/diagnostics/duplicate-header.md"), messages: { default: paramMessage`The header ${"header"} is defined across multiple content types`, }, @@ -371,12 +374,14 @@ export const $lib = createTypeSpecLibrary({ "invalid-schema": { severity: "error", + docs: fileRef.fromPackageRoot("src/diagnostics/invalid-schema.md"), messages: { default: paramMessage`Couldn't get schema for type ${"type"}`, }, }, "union-null": { severity: "error", + docs: fileRef.fromPackageRoot("src/diagnostics/union-null.md"), messages: { default: "Cannot have a union containing only null types.", }, @@ -403,6 +408,7 @@ export const $lib = createTypeSpecLibrary({ }, "inline-cycle": { severity: "error", + docs: fileRef.fromPackageRoot("src/diagnostics/inline-cycle.md"), messages: { default: paramMessage`Cycle detected in '${"type"}'. Use @friendlyName decorator to assign an OpenAPI definition name and make it non-inline.`, }, diff --git a/packages/tspd/src/ref-doc/emitters/starlight.ts b/packages/tspd/src/ref-doc/emitters/starlight.ts index f43142108ea..96d88252daa 100644 --- a/packages/tspd/src/ref-doc/emitters/starlight.ts +++ b/packages/tspd/src/ref-doc/emitters/starlight.ts @@ -1,5 +1,6 @@ import { DeprecationNotice, + DiagnosticRefDoc, LinterRuleRefDoc, NamedTypeRefDoc, RefDocEntity, @@ -57,6 +58,17 @@ export function renderToAstroStarlightMarkdown( files["linter.md"] = linter; } + for (const rule of refDoc.linter?.rules ?? []) { + files[`rules/${rule.rule.name}.md`] = renderRule(rule); + } + + // Generate one page per documented diagnostic, under `diagnostics/`. No index page. + for (const diagnostic of refDoc.diagnostics ?? []) { + if (diagnostic.doc) { + files[`diagnostics/${diagnostic.name}.md`] = renderDiagnostic(diagnostic); + } + } + // Render sub-exports if (refDoc.subExports) { for (const [exportPath, subExport] of refDoc.subExports) { @@ -277,7 +289,38 @@ function renderLinter( "---", renderer.linterUsage(refDoc), ]; + return renderMarkdowDoc(content, 2); +} + +function renderRule(rule: LinterRuleRefDoc): string { + const content: MarkdownDoc = [ + "---", + `title: "${rule.rule.name}"`, + "---", + "", + codeblock(rule.name, 'text title="Id"'), + "", + rule.rule.description, + ]; + if (rule.doc) { + content.push("", rule.doc); + } + return renderMarkdowDoc(content, 2); +} +function renderDiagnostic(diagnostic: DiagnosticRefDoc): string { + const content: MarkdownDoc = [ + "---", + `title: "${diagnostic.name}"`, + "---", + "", + codeblock(diagnostic.id, 'text title="Id"'), + "", + `**Severity:** ${diagnostic.severity}`, + ]; + if (diagnostic.doc) { + content.push("", diagnostic.doc); + } return renderMarkdowDoc(content, 2); } @@ -430,7 +473,7 @@ export class StarlightRenderer extends MarkdownRenderer { } linterRuleLink(rule: LinterRuleRefDoc) { - return `../rules/${rule.rule.name}.md`; + return `./rules/${rule.rule.name}.md`; } deprecationNotice(notice: DeprecationNotice): MarkdownDoc { diff --git a/packages/tspd/src/ref-doc/extractor.ts b/packages/tspd/src/ref-doc/extractor.ts index 55614f5d95a..d1e300b361d 100644 --- a/packages/tspd/src/ref-doc/extractor.ts +++ b/packages/tspd/src/ref-doc/extractor.ts @@ -4,6 +4,7 @@ import { createDiagnosticCollector, Decorator, Diagnostic, + DiagnosticDefinition, DocContent, Enum, EnumMember, @@ -37,15 +38,17 @@ import { TypeSpecLibrary, Union, UnionVariant, + type FileRef, type PackageJson, } from "@typespec/compiler"; import { SyntaxKind, type DocUnknownTagNode } from "@typespec/compiler/ast"; import { readFile } from "fs/promises"; import { pathToFileURL } from "url"; -import { reportDiagnostic } from "./lib.js"; +import { createDiagnostic, reportDiagnostic } from "./lib.js"; import { DecoratorRefDoc, DeprecationNotice, + DiagnosticRefDoc, EmitterOptionRefDoc, EmitterOptionVariantRefDoc, EnumMemberRefDoc, @@ -125,7 +128,39 @@ export async function extractLibraryRefDocs( } const linter = entrypoint.$linter; if (lib && linter) { - refDoc.linter = extractLinterRefDoc(lib.name, resolveLinterDefinition(lib.name, linter)); + const resolved = resolveLinterDefinition(lib.name, linter); + refDoc.linter = await extractLinterRefDoc(lib.name, resolved, libraryPath); + for (const r of refDoc.linter.rules) { + if (!r.doc) { + diagnostics.add( + createDiagnostic({ + code: "documentation-missing", + messageId: "rule", + format: { name: r.id }, + target: NoTarget, + }), + ); + } + } + } + if (lib?.diagnostics) { + refDoc.diagnostics = await extractDiagnosticsRefDoc( + lib.name, + lib.diagnostics as Record>, + libraryPath, + ); + for (const diag of refDoc.diagnostics) { + if (!diag.doc) { + diagnostics.add( + createDiagnostic({ + code: "documentation-missing", + messageId: "diagnostic", + format: { name: diag.id }, + target: NoTarget, + }), + ); + } + } } } @@ -904,13 +939,47 @@ function resolveDescription(description: string | string[] | undefined): string return Array.isArray(description) ? description.join("\n") : description; } -function extractLinterRefDoc(libName: string, linter: LinterResolvedDefinition): LinterRefDoc { +async function resolveDoc( + doc: string | FileRef | undefined, + libraryPath: string, +): Promise { + if (doc === undefined) return undefined; + if (typeof doc === "string") return doc; + try { + return await readFile(joinPaths(libraryPath, doc.path), "utf-8"); + } catch { + return undefined; + } +} + +async function extractLinterRefDoc( + libName: string, + linter: LinterResolvedDefinition, + libraryPath: string, +): Promise { return { ruleSets: linter.ruleSets && extractLinterRuleSetsRefDoc(libName, linter.ruleSets), - rules: linter.rules.map((rule) => extractLinterRuleRefDoc(libName, rule)), + rules: await Promise.all( + linter.rules.map((rule) => extractLinterRuleRefDoc(libName, rule, libraryPath)), + ), }; } +async function extractDiagnosticsRefDoc( + libName: string, + diagnostics: Record>, + libraryPath: string, +): Promise { + return Promise.all( + Object.entries(diagnostics).map(async ([name, def]) => ({ + id: `${libName}/${name}`, + name, + severity: def.severity, + doc: await resolveDoc(def.docs, libraryPath), + })), + ); +} + function extractLinterRuleSetsRefDoc( libName: string, ruleSets: Record, @@ -925,15 +994,17 @@ function extractLinterRuleSetsRefDoc( }; }); } -function extractLinterRuleRefDoc( +async function extractLinterRuleRefDoc( libName: string, rule: LinterRuleDefinition, -): LinterRuleRefDoc { + libraryPath: string, +): Promise { const fullName = `${libName}/${rule.name}`; return { kind: "rule", id: fullName, name: fullName, rule, + doc: await resolveDoc(rule.docs, libraryPath), }; } diff --git a/packages/tspd/src/ref-doc/lib.ts b/packages/tspd/src/ref-doc/lib.ts index 482e4ce199d..2bab7b16011 100644 --- a/packages/tspd/src/ref-doc/lib.ts +++ b/packages/tspd/src/ref-doc/lib.ts @@ -23,6 +23,8 @@ export const libDef = { interfaceOperation: paramMessage`Missing documentation for interface operation '${"name"}'.`, operation: paramMessage`Missing documentation for operation '${"name"}'.`, scalar: paramMessage`Missing documentation for scalar '${"name"}'.`, + rule: paramMessage`Missing documentation for linter rule '${"name"}'.`, + diagnostic: paramMessage`Missing documentation for diagnostic '${"name"}'.`, }, }, }, diff --git a/packages/tspd/src/ref-doc/types.ts b/packages/tspd/src/ref-doc/types.ts index 7929a9a2d4a..d9beb409e58 100644 --- a/packages/tspd/src/ref-doc/types.ts +++ b/packages/tspd/src/ref-doc/types.ts @@ -39,6 +39,9 @@ export type TypeSpecLibraryRefDoc = TypeSpecRefDocBase & { /** Documentation about the linter rules and ruleset provided in this library. */ readonly linter?: LinterRefDoc; + /** Documentation about the diagnostics that this library can report. */ + readonly diagnostics?: readonly DiagnosticRefDoc[]; + /** Documentation for sub-exports (e.g., "./streams", "./testing"). Keyed by export path. */ readonly subExports?: ReadonlyMap; }; @@ -72,6 +75,14 @@ export type LinterRuleSetRefDoc = ReferencableElement & { export type LinterRuleRefDoc = ReferencableElement & { readonly kind: "rule"; readonly rule: LinterRuleDefinition; + /** Extended documentation as raw markdown, read from a co-located `.md` file. */ + readonly doc?: string; +}; + +export type DiagnosticRefDoc = ReferencableElement & { + readonly severity: "warning" | "error"; + /** Extended documentation as raw markdown, read from a co-located `.md` file. */ + readonly doc?: string; }; export type EmitterOptionRefDoc = { diff --git a/website/src/content/current-sidebar.ts b/website/src/content/current-sidebar.ts index 70e65cac054..a086939ec4f 100644 --- a/website/src/content/current-sidebar.ts +++ b/website/src/content/current-sidebar.ts @@ -124,7 +124,7 @@ const sidebar: SidebarItem[] = [ { label: "📚 Libraries", items: [ - createLibraryReferenceStructure("libraries/http", "Http", true, [ + createLibraryReferenceStructure("libraries/http", "Http", false, [ "libraries/http/cheat-sheet", "libraries/http/authentication", "libraries/http/operations", @@ -168,7 +168,6 @@ const sidebar: SidebarItem[] = [ createLibraryReferenceStructure("emitters/openapi3", "OpenAPI3", false, [ "emitters/openapi3/openapi", "emitters/openapi3/cli", - "emitters/openapi3/diagnostics", ]), createLibraryReferenceStructure( "emitters/protobuf", diff --git a/website/src/content/docs/docs/emitters/openapi3/diagnostics.md b/website/src/content/docs/docs/emitters/openapi3/diagnostics.md deleted file mode 100644 index e642ce30029..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/diagnostics.md +++ /dev/null @@ -1,203 +0,0 @@ ---- -title: Diagnostics ---- - -The OpenAPI emitter may produce any of the following diagnostic messages. - - - -## duplicate-header - -This diagnostic is issued when a response header is defined more than once for a response of a specific status code. - -To fix this issue, ensure that each response header is defined only once for each status code. - -### Example - -```yaml -responses: - "200": - description: Successful response - headers: - X-Rate-Limit: - description: The number of allowed requests in the current period - schema: - type: integer - X-Rate-Limit: - description: The number of allowed requests in the current period - schema: - type: integer -``` - -In this example, the `X-Rate-Limit` header is defined twice for the `200` status code. To fix this issue, remove the duplicate header definition. - -## duplicate-type-name - -This diagnostic is issued when a schema or parameter name is a duplicate of another schema or parameter. This generally happens when a model or parameter is renamed with the `@friendlyName` decorator, resulting in two different TypeSpec types getting the same name in the OpenAPI output. - -To fix this issue, change the name or friendly-name of one of the models or parameters. - -### Example - -```typespec -@friendlyName("User") -model Customer { - id: string; -} - -model User { - id: string; -} -``` - -In this example, both `Customer` and `User` would appear as `User` in the OpenAPI output, causing a conflict. - -## inline-cycle - -This diagnostic is issued when a cyclic reference is detected within inline schemas. - -To fix this issue, refactor the schemas to remove the cyclic reference. - -### Example - -```yaml -components: - schemas: - Node: - type: object - properties: - value: - type: string - next: - $ref: "#/components/schemas/Node" -``` - -In this example, the `Node` schema references itself, creating a cyclic reference. To fix this issue, refactor the schema to remove the cyclic reference. - -## invalid-default - -This diagnostic is issued when a default value is invalid for the specified schema type. - -To fix this issue, ensure that the default value is valid for the schema type. - -### Example - -```yaml -components: - schemas: - User: - type: object - properties: - age: - type: integer - default: "twenty" -``` - -In this example, the `default` value for the `age` property is invalid because it is a string instead of an integer. To fix this issue, provide a valid default value, such as `20`. - -## invalid-extension-key - -This diagnostic is issued by the `@extension` decorator when the extension key does not start with "x-" as -required by the OpenAPI v3 specification. - -To fix this issue, change the extension name to start with "x-". - -### Example - -```typespec -@extension("invalid-name", "value") -model User { - id: string; -} -``` - -Should be changed to: - -```typespec -@extension("x-valid-name", "value") -model User { - id: string; -} -``` - -## invalid-schema - -This diagnostic is issued when a schema is invalid according to the OpenAPI v3 specification. - -To fix this issue, review your TypeSpec definitions to ensure they map to valid OpenAPI schemas. - -### Example - -```yaml -components: - schemas: - User: - type: object - properties: - id: - type: string - age: - type: integer - format: "int" # Invalid format -``` - -In this example, the `format` value for the `age` property is invalid. To fix this issue, provide a valid format value such as `int32` or `int64`. - -## invalid-server-variable - -This diagnostic is issued when a variable in the `@server` decorator is not defined as a string type. -Since server variables are substituted into the server URL which is a string, all variables must have string values. - -To fix this issue, make sure all server variables are of a type that is assignable to `string`. - -### Example - -```typespec -@server("{protocol}://{host}/api/{version}", "Custom endpoint", { - protocol: "http" | "https", - host: string, - version: 1, // Should be a string: "1" -}) -``` - -## path-query - -This diagnostic is issued when the OpenAPI emitter finds an `@route` decorator that specifies a path that contains a query parameter. This is not permitted by the OpenAPI v3 specification, which requires query parameters to be defined separately. - -To fix this issue, redesign the API to only use paths without query parameters, and define query parameters using the `@query` decorator. - -### Example - -Instead of: - -```typespec -@route("/users?filter={filter}") -op getUsers(filter: string): User[]; -``` - -Use: - -```typespec -@route("/users") -op getUsers(@query filter?: string): User[]; -``` - -Alternatively, you can leverage TypeSpec's support for URI templates: - -```typespec -@route("/users{?filter}") -op getUsers(filter?: string): User[]; -``` - -## union-null - -This diagnostic is issued when the result of model composition is effectively a `null` schema which cannot be -represented in OpenAPI. - -To fix this issue, review your model compositions to ensure they produce valid schemas with actual properties or types. - -## union-unsupported - -This diagnostic is issued when the OpenAPI emitter finds a union of two incompatible types that cannot be represented in OpenAPI. OpenAPI has limited support for union types, and some combinations cannot be expressed. - -To fix this issue, consider restructuring your types to avoid incompatible unions, or split the operation into multiple operations with different return types. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md new file mode 100644 index 00000000000..935f3dda65c --- /dev/null +++ b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md @@ -0,0 +1,32 @@ +--- +title: "duplicate-header" +--- + +```text title="Id" +@typespec/openapi3/duplicate-header +``` + +**Severity:** error + +This diagnostic is issued when a response header is defined more than once for a response of a specific status code. + +To fix this issue, ensure that each response header is defined only once for each status code. + +### Example + +```yaml +responses: + "200": + description: Successful response + headers: + X-Rate-Limit: + description: The number of allowed requests in the current period + schema: + type: integer + X-Rate-Limit: + description: The number of allowed requests in the current period + schema: + type: integer +``` + +In this example, the `X-Rate-Limit` header is defined twice for the `200` status code. To fix this issue, remove the duplicate header definition. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md new file mode 100644 index 00000000000..62e392e1c08 --- /dev/null +++ b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md @@ -0,0 +1,29 @@ +--- +title: "inline-cycle" +--- + +```text title="Id" +@typespec/openapi3/inline-cycle +``` + +**Severity:** error + +This diagnostic is issued when a cyclic reference is detected within inline schemas. + +To fix this issue, refactor the schemas to remove the cyclic reference. + +### Example + +```yaml +components: + schemas: + Node: + type: object + properties: + value: + type: string + next: + $ref: "#/components/schemas/Node" +``` + +In this example, the `Node` schema references itself, creating a cyclic reference. To fix this issue, refactor the schema to remove the cyclic reference. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md new file mode 100644 index 00000000000..ad052ec03b8 --- /dev/null +++ b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md @@ -0,0 +1,30 @@ +--- +title: "invalid-schema" +--- + +```text title="Id" +@typespec/openapi3/invalid-schema +``` + +**Severity:** error + +This diagnostic is issued when a schema is invalid according to the OpenAPI v3 specification. + +To fix this issue, review your TypeSpec definitions to ensure they map to valid OpenAPI schemas. + +### Example + +```yaml +components: + schemas: + User: + type: object + properties: + id: + type: string + age: + type: integer + format: "int" # Invalid format +``` + +In this example, the `format` value for the `age` property is invalid. To fix this issue, provide a valid format value such as `int32` or `int64`. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md new file mode 100644 index 00000000000..26c49e3aee1 --- /dev/null +++ b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md @@ -0,0 +1,24 @@ +--- +title: "invalid-server-variable" +--- + +```text title="Id" +@typespec/openapi3/invalid-server-variable +``` + +**Severity:** error + +This diagnostic is issued when a variable in the `@server` decorator is not defined as a string type. +Since server variables are substituted into the server URL which is a string, all variables must have string values. + +To fix this issue, make sure all server variables are of a type that is assignable to `string`. + +### Example + +```typespec +@server("{protocol}://{host}/api/{version}", "Custom endpoint", { + protocol: "http" | "https", + host: string, + version: 1, // Should be a string: "1" +}) +``` diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md new file mode 100644 index 00000000000..22a9107204f --- /dev/null +++ b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md @@ -0,0 +1,36 @@ +--- +title: "path-query" +--- + +```text title="Id" +@typespec/openapi3/path-query +``` + +**Severity:** error + +This diagnostic is issued when the OpenAPI emitter finds an `@route` decorator that specifies a path that contains a query parameter. This is not permitted by the OpenAPI v3 specification, which requires query parameters to be defined separately. + +To fix this issue, redesign the API to only use paths without query parameters, and define query parameters using the `@query` decorator. + +### Example + +Instead of: + +```typespec +@route("/users?filter={filter}") +op getUsers(filter: string): User[]; +``` + +Use: + +```typespec +@route("/users") +op getUsers(@query filter?: string): User[]; +``` + +Alternatively, you can leverage TypeSpec's support for URI templates: + +```typespec +@route("/users{?filter}") +op getUsers(filter?: string): User[]; +``` diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md new file mode 100644 index 00000000000..4d1113c7785 --- /dev/null +++ b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md @@ -0,0 +1,13 @@ +--- +title: "union-null" +--- + +```text title="Id" +@typespec/openapi3/union-null +``` + +**Severity:** error + +This diagnostic is issued when the result of model composition is effectively a `null` schema which cannot be represented in OpenAPI. + +To fix this issue, review your model compositions to ensure they produce valid schemas with actual properties or types. diff --git a/website/src/content/docs/docs/extending-typespec/linters.md b/website/src/content/docs/docs/extending-typespec/linters.md index 906978f96e6..1646cfc33b1 100644 --- a/website/src/content/docs/docs/extending-typespec/linters.md +++ b/website/src/content/docs/docs/extending-typespec/linters.md @@ -73,6 +73,30 @@ Rule names are user-facing in diagnostics, `tspconfig.yaml`, docs URLs, and supp - Use `use-` when the rule guides users toward a standard or preferred TypeSpec pattern. - For domain-specific validation where `no-`/`use-` does not fit, use short subject-oriented names such as `-missing-` or `-invalid-`. +#### Provide extended documentation + +The `description` field is a short, one-line summary. To provide richer reference documentation for a rule — which `tspd doc` renders into a dedicated page per rule (`reference/rules/.md`) — set the `docs` field. It accepts either an inline markdown string or a reference to a co-located markdown file via `fileRef.fromPackageRoot`: + +```ts +import { createRule, fileRef } from "@typespec/compiler"; + +export const requiredDocRule = createRule({ + name: "no-model-doc", + severity: "warning", + description: "Enforce documentation on models.", + // Extended documentation rendered on the generated reference page. + docs: fileRef.fromPackageRoot("src/rules/no-model-doc.md"), + messages: { + default: `Must be documented.`, + }, + create(context) { + /* ... */ + }, +}); +``` + +`fileRef.fromPackageRoot(path)` points at a markdown file relative to the package root (the directory containing your `package.json`). The same `docs` field is available on diagnostic definitions. When generating docs, `tspd` reports a `documentation-missing` warning for any rule or diagnostic that does not provide `docs`. + #### Define rules with options Rules can accept user-configurable options via `defaultOptions` and `context.options`. When enabled with `true`, the rule uses the default options. When enabled with an object, the provided values override the defaults. diff --git a/website/src/content/docs/docs/libraries/http/reference/linter.md b/website/src/content/docs/docs/libraries/http/reference/linter.md index d51c365da51..f6e795cd91e 100644 --- a/website/src/content/docs/docs/libraries/http/reference/linter.md +++ b/website/src/content/docs/docs/libraries/http/reference/linter.md @@ -20,6 +20,6 @@ Available ruleSets: ## Rules -| Name | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| [`@typespec/http/op-reference-container-route`](../rules/op-reference-container-route.md) | Check for referenced (`op is`) operations which have a @route on one of their containers. | +| Name | Description | +| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| [`@typespec/http/op-reference-container-route`](./rules/op-reference-container-route.md) | Check for referenced (`op is`) operations which have a @route on one of their containers. | diff --git a/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md b/website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md similarity index 67% rename from website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md rename to website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md index 1574664af43..2a746e9f825 100644 --- a/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md +++ b/website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md @@ -6,10 +6,10 @@ title: "op-reference-container-route" @typespec/http/op-reference-container-route ``` -Check for referenced (`op is`) operations which have a `@route` on one of their containers. +Check for referenced (`op is`) operations which have a @route on one of their containers. -When referencing an operation with `op is` only the data on the operation itself is carried over anything on parent container is lost. -This result in unexpected behavior where information is lost. +When referencing an operation with `op is`, only the data on the operation itself is carried over; anything on the parent container is lost. +This results in unexpected behavior where information is lost. As a best practice the route should be provided on the operation itself. #### ❌ Incorrect From 4dee3e79857500ed3469cb9810cd1a734db37ee7 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:03:12 -0400 Subject: [PATCH 029/249] feat: add `license.identifier` field to OpenAPI library (#11309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OpenAPI `License` object supports an `identifier` field (SPDX expression) since spec v3.1, but TypeSpec's `@info` decorator was missing it — causing a spurious "unknown prop" warning. ## Changes ### `@typespec/openapi` - Added `identifier?: string` to the `License` model and TypeScript interfaces - Added `license-url-identifier-conflict` diagnostic: `url` and `identifier` are mutually exclusive (per spec); both being set is now a compile-time error - Validation enforced in the `$info` decorator ### `@typespec/openapi3` — Emitter - **OpenAPI 3.1 / 3.2**: `identifier` emits as the native `identifier` field - **OpenAPI 3.0**: `identifier` is emitted as the `x-oai-license-identifier` extension ### `@typespec/openapi3` — Converter (OpenAPI → TypeSpec) - `identifier` in 3.1 documents maps directly to `identifier` - `x-oai-license-identifier` in 3.0 documents is promoted to `identifier` ## Example ```typespec @info(#{ license: #{ name: "MIT", identifier: "MIT" }, }) namespace MyService; ``` Emits for OpenAPI 3.1: ```json "license": { "name": "MIT", "identifier": "MIT" } ``` Emits for OpenAPI 3.0: ```json "license": { "name": "MIT", "x-oai-license-identifier": "MIT" } ``` closes #11302 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> Co-authored-by: Vincent Biret Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../changes/license-identifier-2026-7-20.md | 15 ++++ .../generated-defs/TypeSpec.OpenAPI.ts | 1 + packages/openapi/lib/decorators.tsp | 5 +- packages/openapi/src/decorators.ts | 10 +++ packages/openapi/src/lib.ts | 6 ++ packages/openapi/src/types.ts | 8 ++- packages/openapi/test/decorators.test.ts | 36 ++++++++++ .../transforms/transform-service-info.ts | 14 +++- .../openapi3/src/openapi-spec-mappings.ts | 12 +++- packages/openapi3/test/info.test.ts | 69 ++++++++++++++++++- .../tsp-openapi3/convert-openapi3-doc.test.ts | 68 ++++++++++++++++++ .../libraries/openapi/reference/data-types.md | 11 +-- 12 files changed, 244 insertions(+), 11 deletions(-) create mode 100644 .chronus/changes/license-identifier-2026-7-20.md diff --git a/.chronus/changes/license-identifier-2026-7-20.md b/.chronus/changes/license-identifier-2026-7-20.md new file mode 100644 index 00000000000..b78e0314191 --- /dev/null +++ b/.chronus/changes/license-identifier-2026-7-20.md @@ -0,0 +1,15 @@ +--- +changeKind: feature +packages: + - "@typespec/openapi" + - "@typespec/openapi3" +--- + +Add `identifier` field to the `License` model in `@typespec/openapi`. This is an SPDX license expression for the API (e.g. `"MIT"`, `"Apache-2.0"`). The `identifier` and `url` fields are mutually exclusive. For OpenAPI 3.1+, `identifier` is emitted as-is; for OpenAPI 3.0, it is emitted as the `x-oai-license-identifier` extension. Importing an OpenAPI document also supports reading back `identifier` (or `x-oai-license-identifier` for 3.0 documents). + +```typespec +@info(#{ + license: #{ name: "MIT", identifier: "MIT" }, +}) +namespace MyService; +``` diff --git a/packages/openapi/generated-defs/TypeSpec.OpenAPI.ts b/packages/openapi/generated-defs/TypeSpec.OpenAPI.ts index dbcde2e60c8..1b471b85539 100644 --- a/packages/openapi/generated-defs/TypeSpec.OpenAPI.ts +++ b/packages/openapi/generated-defs/TypeSpec.OpenAPI.ts @@ -47,6 +47,7 @@ export interface License { readonly [key: string]: unknown; readonly name: string; readonly url?: string; + readonly identifier?: string; } export interface ExternalDocs { diff --git a/packages/openapi/lib/decorators.tsp b/packages/openapi/lib/decorators.tsp index d52921307ae..a098d66c644 100644 --- a/packages/openapi/lib/decorators.tsp +++ b/packages/openapi/lib/decorators.tsp @@ -103,9 +103,12 @@ model License { /** The license name used for the API. */ name: string; - /** A URL to the license used for the API. MUST be in the format of a URL. */ + /** A URL to the license used for the API. MUST be in the format of a URL. Mutually exclusive with `identifier`. */ url?: url; + /** An SPDX license expression for the API. Mutually exclusive with `url`. Only supported in OpenAPI 3.1+. For OpenAPI 3.0, this will be emitted as `x-oai-license-identifier`. */ + identifier?: string; + ...Record; } diff --git a/packages/openapi/src/decorators.ts b/packages/openapi/src/decorators.ts index e32ab14a7cf..d75d7f46c60 100644 --- a/packages/openapi/src/decorators.ts +++ b/packages/openapi/src/decorators.ts @@ -274,6 +274,16 @@ export const $info: InfoDecorator = ( return; } } + + // Validate license: url and identifier are mutually exclusive + if (data.license?.url !== undefined && data.license?.identifier !== undefined) { + reportDiagnostic(context.program, { + code: "license-url-identifier-conflict", + target: context.getArgumentTarget(0)!, + }); + return; + } + setInfo(context.program, entity, data); }; diff --git a/packages/openapi/src/lib.ts b/packages/openapi/src/lib.ts index a62e2dd2f87..d63a1f56367 100644 --- a/packages/openapi/src/lib.ts +++ b/packages/openapi/src/lib.ts @@ -53,6 +53,12 @@ export const $lib = createTypeSpecLibrary({ error: `@defaultResponse should not be used on a model that is marked with @error. Use either @defaultResponse or @error, not both.`, }, }, + "license-url-identifier-conflict": { + severity: "error", + messages: { + default: `License 'url' and 'identifier' are mutually exclusive. Specify only one of them.`, + }, + }, }, state: { tagsMetadata: { description: "State for the @tagMetadata decorator." }, diff --git a/packages/openapi/src/types.ts b/packages/openapi/src/types.ts index ce04d561c76..ac1641ba01f 100644 --- a/packages/openapi/src/types.ts +++ b/packages/openapi/src/types.ts @@ -51,8 +51,14 @@ export interface License { /** The license name used for the API. */ name: string; - /** A URL to the license used for the API. MUST be in the format of a URL. */ + /** A URL to the license used for the API. MUST be in the format of a URL. Mutually exclusive with `identifier`. */ url?: string; + + /** An SPDX license expression for the API. Mutually exclusive with `url`. Only supported in OpenAPI 3.1+. For OpenAPI 3.0, this will be emitted as `x-oai-license-identifier`. */ + identifier?: string; + + /** Additional extension data. Keys must start with `x-`. */ + [extensionKey: string]: unknown; } /** diff --git a/packages/openapi/test/decorators.test.ts b/packages/openapi/test/decorators.test.ts index 6adbeeb2503..5739379883b 100644 --- a/packages/openapi/test/decorators.test.ts +++ b/packages/openapi/test/decorators.test.ts @@ -176,6 +176,42 @@ describe("@info", () => { }); }); + it("set license identifier", async () => { + const { program, Service } = await Tester.compile(t.code` + @info(#{ + license: #{ + name: "MIT", + identifier: "MIT", + }, + }) + namespace ${t.namespace("Service")} {} + `); + + deepStrictEqual(getInfo(program, Service), { + license: { + name: "MIT", + identifier: "MIT", + }, + }); + }); + + it("emit diagnostic when both license url and identifier are set", async () => { + const diagnostics = await Tester.diagnose(` + @info(#{ + license: #{ + name: "Apache 2.0", + url: "http://www.apache.org/licenses/LICENSE-2.0.html", + identifier: "Apache-2.0", + }, + }) + namespace Service {} + `); + + expectDiagnostics(diagnostics, { + code: "@typespec/openapi/license-url-identifier-conflict", + }); + }); + it("emit diagnostic if termsOfService is not a valid url", async () => { const diagnostics = await Tester.diagnose(` @info(#{termsOfService:"notvalidurl"}) diff --git a/packages/openapi3/src/cli/actions/convert/transforms/transform-service-info.ts b/packages/openapi3/src/cli/actions/convert/transforms/transform-service-info.ts index 921351a5afe..8163332dba5 100644 --- a/packages/openapi3/src/cli/actions/convert/transforms/transform-service-info.ts +++ b/packages/openapi3/src/cli/actions/convert/transforms/transform-service-info.ts @@ -1,13 +1,25 @@ +import type { License } from "@typespec/openapi"; import { OpenAPI3Info } from "../../../../types.js"; import { TypeSpecServiceInfo } from "../interfaces.js"; export function transformServiceInfo(info: OpenAPI3Info): TypeSpecServiceInfo { + let license = info.license; + if (license) { + // Handle x-oai-license-identifier extension from OpenAPI 3.0 + const licenseRecord = license as unknown as Record; + const xOaiIdentifier = licenseRecord["x-oai-license-identifier"]; + if (typeof xOaiIdentifier === "string") { + const { "x-oai-license-identifier": _, ...rest } = licenseRecord; + license = { ...(rest as unknown as License), identifier: xOaiIdentifier }; + } + } + return { name: info.title, doc: info.description, version: info.version, contact: info.contact, - license: info.license, + license, termsOfService: info.termsOfService, summary: info.summary, }; diff --git a/packages/openapi3/src/openapi-spec-mappings.ts b/packages/openapi3/src/openapi-spec-mappings.ts index 5ee0c6810e4..382012473e3 100644 --- a/packages/openapi3/src/openapi-spec-mappings.ts +++ b/packages/openapi3/src/openapi-spec-mappings.ts @@ -102,11 +102,21 @@ function createRoot( ): SupportedOpenAPIDocuments { const info = resolveInfo(program, serviceType); + // Handle license identifier: for OpenAPI 3.0, use x-oai-license-identifier extension + let processedInfo = info; + if (info?.license?.identifier !== undefined && specVersion === "3.0.0") { + const { identifier, ...restLicense } = info.license; + processedInfo = { + ...info, + license: { ...restLicense, "x-oai-license-identifier": identifier }, + }; + } + return { openapi: specVersion, info: { title: "(title)", - ...info, + ...processedInfo, version: serviceVersion ?? info?.version ?? "0.0.0", }, externalDocs: getExternalDocs(program, serviceType), diff --git a/packages/openapi3/test/info.test.ts b/packages/openapi3/test/info.test.ts index 0211617a3e9..e6cbae93bfc 100644 --- a/packages/openapi3/test/info.test.ts +++ b/packages/openapi3/test/info.test.ts @@ -1,6 +1,6 @@ import { deepStrictEqual, strictEqual } from "assert"; -import { it } from "vitest"; -import { supportedVersions, worksFor } from "./works-for.js"; +import { describe, it } from "vitest"; +import { OpenAPISpecHelpers, supportedVersions, worksFor } from "./works-for.js"; worksFor(supportedVersions, ({ openApiFor }) => { it("set the service title with @service", async () => { @@ -80,3 +80,68 @@ worksFor(supportedVersions, ({ openApiFor }) => { }); }); }); + +describe("license identifier", () => { + it("OpenAPI 3.1+ emits license identifier as 'identifier' field", async () => { + const res = await OpenAPISpecHelpers["3.1.0"].openApiFor( + ` + @service + @info(#{ + license: #{ + name: "MIT", + identifier: "MIT", + }, + }) + namespace Foo { + op test(): string; + } + `, + ); + deepStrictEqual(res.info.license, { + name: "MIT", + identifier: "MIT", + }); + }); + + it("OpenAPI 3.2 emits license identifier as 'identifier' field", async () => { + const res = await OpenAPISpecHelpers["3.2.0"].openApiFor( + ` + @service + @info(#{ + license: #{ + name: "MIT", + identifier: "MIT", + }, + }) + namespace Foo { + op test(): string; + } + `, + ); + deepStrictEqual(res.info.license, { + name: "MIT", + identifier: "MIT", + }); + }); + + it("OpenAPI 3.0 emits license identifier as 'x-oai-license-identifier' extension", async () => { + const res = await OpenAPISpecHelpers["3.0.0"].openApiFor( + ` + @service + @info(#{ + license: #{ + name: "MIT", + identifier: "MIT", + }, + }) + namespace Foo { + op test(): string; + } + `, + ); + deepStrictEqual(res.info.license, { + name: "MIT", + "x-oai-license-identifier": "MIT", + }); + }); +}); diff --git a/packages/openapi3/test/tsp-openapi3/convert-openapi3-doc.test.ts b/packages/openapi3/test/tsp-openapi3/convert-openapi3-doc.test.ts index 61c6ca3fdfe..49e357016c2 100644 --- a/packages/openapi3/test/tsp-openapi3/convert-openapi3-doc.test.ts +++ b/packages/openapi3/test/tsp-openapi3/convert-openapi3-doc.test.ts @@ -1146,4 +1146,72 @@ describe("convertOpenAPI3Document tag metadata", () => { ); } }); + + it("converts OpenAPI 3.1 license with identifier field", async () => { + const tsp = await convertOpenAPI3Document({ + info: { + title: "My API", + version: "1.0.0", + license: { + name: "MIT", + identifier: "MIT", + }, + }, + openapi: "3.1.0", + paths: {}, + }); + + strictEqual( + tsp, + await formatTypeSpec( + ` + import "@typespec/http"; + import "@typespec/openapi"; + import "@typespec/openapi3"; + + using Http; + using OpenAPI; + + @service(#{ title: "My API" }) + @info(#{ version: "1.0.0", license: #{ name: "MIT", identifier: "MIT" } }) + namespace MyAPI; + `, + { printWidth: 100, tabWidth: 2 }, + ), + ); + }); + + it("converts OpenAPI 3.0 license with x-oai-license-identifier extension to identifier field", async () => { + const tsp = await convertOpenAPI3Document({ + info: { + title: "My API", + version: "1.0.0", + license: { + name: "MIT", + "x-oai-license-identifier": "MIT", + } as any, + }, + openapi: "3.0.0", + paths: {}, + }); + + strictEqual( + tsp, + await formatTypeSpec( + ` + import "@typespec/http"; + import "@typespec/openapi"; + import "@typespec/openapi3"; + + using Http; + using OpenAPI; + + @service(#{ title: "My API" }) + @info(#{ version: "1.0.0", license: #{ name: "MIT", identifier: "MIT" } }) + namespace MyAPI; + `, + { printWidth: 100, tabWidth: 2 }, + ), + ); + }); }); diff --git a/website/src/content/docs/docs/libraries/openapi/reference/data-types.md b/website/src/content/docs/docs/libraries/openapi/reference/data-types.md index 82287602fdf..d925995f704 100644 --- a/website/src/content/docs/docs/libraries/openapi/reference/data-types.md +++ b/website/src/content/docs/docs/libraries/openapi/reference/data-types.md @@ -69,11 +69,12 @@ model TypeSpec.OpenAPI.License #### Properties -| Name | Type | Description | -| ---- | --------- | ---------------------------------------------------------------------- | -| name | `string` | The license name used for the API. | -| url? | `url` | A URL to the license used for the API. MUST be in the format of a URL. | -| | `unknown` | Additional properties | +| Name | Type | Description | +| ----------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | `string` | The license name used for the API. | +| url? | `url` | A URL to the license used for the API. MUST be in the format of a URL. Mutually exclusive with `identifier`. | +| identifier? | `string` | An SPDX license expression for the API. Mutually exclusive with `url`. Only supported in OpenAPI 3.1+. For OpenAPI 3.0, this will be emitted as `x-oai-license-identifier`. | +| | `unknown` | Additional properties | ### `TagMetadata` {#TypeSpec.OpenAPI.TagMetadata} From bc95fa340fdeb713faf001a20935ae3465f0f6b1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 11:09:29 -0400 Subject: [PATCH 030/249] Pin transitive `sigstore` to 4.1.1 via workspace override (#11297) This updates dependency resolution to enforce `sigstore@4.1.1`, addressing vulnerability exposure from earlier transitive versions. The lockfile is refreshed so installs consistently resolve to the pinned version. - **Dependency resolution hardening** - Added a workspace-level pnpm override for `sigstore` in `pnpm-workspace.yaml`. - Ensures all transitive resolution paths converge on `4.1.1`. - **Deterministic install output** - Regenerated `pnpm-lock.yaml` to apply the override in resolved package graph. - Removed prior lockfile resolution paths that pulled older `sigstore` versions. ```yaml # pnpm-workspace.yaml overrides: sigstore: 4.1.1 ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> Co-authored-by: Timothee Guerin Co-authored-by: Mike Harder --- pnpm-lock.yaml | 95 +-------------------------------------------- pnpm-workspace.yaml | 1 + 2 files changed, 3 insertions(+), 93 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5709ac08f18..101080fa7d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -503,6 +503,7 @@ overrides: cross-spawn@>=7.0.0 <7.0.5: '>=7.0.5' diff@>=6.0.0 <8.0.3: '>=8.0.3' dompurify: ^3.3.3 + sigstore@<4.1.1: ^4.1.1 yaml@>=2.0.0 <2.8.3: '>=2.8.3' importers: @@ -6948,50 +6949,26 @@ packages: '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} - '@sigstore/bundle@3.1.0': - resolution: {integrity: sha512-Mm1E3/CmDDCz3nDhFKTuYdB47EdRFRQMOE/EAbiG1MJW77/w1b3P7Qx7JSrVJs8PfwOLOVcKQCHErIwCTyPbag==} - engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/bundle@4.0.0': resolution: {integrity: sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A==} engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/core@2.0.0': - resolution: {integrity: sha512-nYxaSb/MtlSI+JWcwTHQxyNmWeWrUXJJ/G4liLrGG7+tS4vAz6LF3xRXqLH6wPIVUoZQel2Fs4ddLx4NCpiIYg==} - engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/core@3.2.1': resolution: {integrity: sha512-qRsxPnCrbC/puegGxKuynfnxgLiHqWStrSjxkoB4YKqq3Z3s4cyZyj42ZdWFAEblNP65C+rBH8EuREHIXoi83g==} engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/protobuf-specs@0.4.3': - resolution: {integrity: sha512-fk2zjD9117RL9BjqEwF7fwv7Q/P9yGsMV4MUJZ/DocaQJ6+3pKr+syBq1owU5Q5qGw5CUbXzm+4yJ2JVRDQeSA==} - engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/protobuf-specs@0.5.1': resolution: {integrity: sha512-/ScWUhhoFasJsSRGTVBwId1loQjjnjAfE4djL6ZhrXRpNCmPTnUKF5Jokd58ILseOMjzET3UrMOtJPS9sYeI0g==} engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/sign@3.1.0': - resolution: {integrity: sha512-knzjmaOHOov1Ur7N/z4B1oPqZ0QX5geUfhrVaqVlu+hl0EAoL4o+l0MSULINcD5GCWe3Z0+YJO8ues6vFlW0Yw==} - engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/sign@4.1.1': resolution: {integrity: sha512-Hf4xglukg0XXQ2RiD5vSoLjdPe8OBUPA8XeVjUObheuDcWdYWrnH/BNmxZCzkAy68MzmNCxXLeurJvs6hcP2OQ==} engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/tuf@3.1.1': - resolution: {integrity: sha512-eFFvlcBIoGwVkkwmTi/vEQFSva3xs5Ot3WmBcjgjVdiaoelBLQaQ/ZBfhlG0MnG0cmTYScPpk7eDdGDWUcFUmg==} - engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/tuf@4.0.2': resolution: {integrity: sha512-TCAzTy0xzdP79EnxSjq9KQ3eaR7+FmudLC6eRKknVKZbV7ZNlGLClAAQb/HMNJ5n2OBNk2GT1tEmU0xuPr+SLQ==} engines: {node: ^20.17.0 || >=22.9.0} - '@sigstore/verify@2.1.1': - resolution: {integrity: sha512-hVJD77oT67aowHxwT4+M6PGOp+E2LtLdTK3+FC0lBO9T7sYwItDMXZ7Z07IDCvR1M717a4axbIWckrW67KMP/w==} - engines: {node: ^18.17.0 || >=20.5.0} - '@sigstore/verify@3.1.1': resolution: {integrity: sha512-qv7+G3J2cc6wwFj3yKvXOamzqhMwSk1ogPGmhpS8iXllcPrJaIIBA+4HbttlHVu1pqWTdmaCH/WE7UOC51kdoA==} engines: {node: ^20.17.0 || >=22.9.0} @@ -7151,10 +7128,6 @@ packages: resolution: {integrity: sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==} engines: {node: ^16.14.0 || >=18.0.0} - '@tufjs/models@3.0.1': - resolution: {integrity: sha512-UUYHISyhCU3ZgN8yaear3cGATHb3SMuKHsQ/nVbHXcmnBf+LzQ/cQfhNG+rfaSHgqGKNEm2cOCLVLELStUQ1JA==} - engines: {node: ^18.17.0 || >=20.5.0} - '@tufjs/models@4.1.0': resolution: {integrity: sha512-Y8cK9aggNRsqJVaKUlEYs4s7CvQ1b1ta2DVPyAimb0I2qhzjNk+A+mxvll/klL0RlfuIUei8BF7YWiua4kQqww==} engines: {node: ^20.17.0 || >=22.9.0} @@ -12390,10 +12363,6 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - sigstore@3.1.0: - resolution: {integrity: sha512-ZpzWAFHIFqyFE56dXqgX/DkDRZdz+rRcjoIk/RQU4IX0wiCv1l8S7ZrXDHcCc+uaf+6o7w3h2l3g6GYG5TKN9Q==} - engines: {node: ^18.17.0 || >=20.5.0} - sigstore@4.1.1: resolution: {integrity: sha512-endqECJkfhozrXMK5ngu/UAA0xVcVEFdnHJCElGaExypjW+HK5i6zu3NteLoaX/iFbRUbC3+DjttQs0GARr+5w==} engines: {node: ^20.17.0 || >=22.9.0} @@ -12956,10 +12925,6 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - tuf-js@3.1.0: - resolution: {integrity: sha512-3T3T04WzowbwV2FDiGXBbr81t64g1MUGGJRgT4x5o97N+8ArdhVCAF9IxFrxuSJmM3E5Asn7nKHkao0ibcZXAg==} - engines: {node: ^18.17.0 || >=20.5.0} - tuf-js@4.1.0: resolution: {integrity: sha512-50QV99kCKH5P/Vs4E2Gzp7BopNV+KzTXqWeaxrfu5IQJBOULRsTIS9seSsOVT8ZnGXzCyx55nYWAi4qJzpZKEQ==} engines: {node: ^20.17.0 || >=22.9.0} @@ -19016,33 +18981,14 @@ snapshots: '@shikijs/vscode-textmate@10.0.2': {} - '@sigstore/bundle@3.1.0': - dependencies: - '@sigstore/protobuf-specs': 0.4.3 - '@sigstore/bundle@4.0.0': dependencies: '@sigstore/protobuf-specs': 0.5.1 - '@sigstore/core@2.0.0': {} - '@sigstore/core@3.2.1': {} - '@sigstore/protobuf-specs@0.4.3': {} - '@sigstore/protobuf-specs@0.5.1': {} - '@sigstore/sign@3.1.0': - dependencies: - '@sigstore/bundle': 3.1.0 - '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.3 - make-fetch-happen: 14.0.3 - proc-log: 5.0.0 - promise-retry: 2.0.1 - transitivePeerDependencies: - - supports-color - '@sigstore/sign@4.1.1': dependencies: '@gar/promise-retry': 1.0.3 @@ -19054,13 +19000,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@sigstore/tuf@3.1.1': - dependencies: - '@sigstore/protobuf-specs': 0.4.3 - tuf-js: 3.1.0 - transitivePeerDependencies: - - supports-color - '@sigstore/tuf@4.0.2': dependencies: '@sigstore/protobuf-specs': 0.5.1 @@ -19068,12 +19007,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@sigstore/verify@2.1.1': - dependencies: - '@sigstore/bundle': 3.1.0 - '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.3 - '@sigstore/verify@3.1.1': dependencies: '@sigstore/bundle': 4.0.0 @@ -19285,11 +19218,6 @@ snapshots: '@tufjs/canonical-json@2.0.0': {} - '@tufjs/models@3.0.1': - dependencies: - '@tufjs/canonical-json': 2.0.0 - minimatch: 9.0.9 - '@tufjs/models@4.1.0': dependencies: '@tufjs/canonical-json': 2.0.0 @@ -20242,7 +20170,7 @@ snapshots: es-toolkit: 1.48.1 micromatch: 4.0.8 semver: 7.8.5 - sigstore: 3.1.0 + sigstore: 4.1.1 ssri: 12.0.0 tslib: 2.8.1 transitivePeerDependencies: @@ -25944,17 +25872,6 @@ snapshots: signal-exit@4.1.0: {} - sigstore@3.1.0: - dependencies: - '@sigstore/bundle': 3.1.0 - '@sigstore/core': 2.0.0 - '@sigstore/protobuf-specs': 0.4.3 - '@sigstore/sign': 3.1.0 - '@sigstore/tuf': 3.1.1 - '@sigstore/verify': 2.1.1 - transitivePeerDependencies: - - supports-color - sigstore@4.1.1: dependencies: '@sigstore/bundle': 4.0.0 @@ -26549,14 +26466,6 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - tuf-js@3.1.0: - dependencies: - '@tufjs/models': 3.0.1 - debug: 4.4.3 - make-fetch-happen: 14.0.3 - transitivePeerDependencies: - - supports-color - tuf-js@4.1.0: dependencies: '@tufjs/models': 4.1.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 951fdf5db5f..0f09a8e4ecb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -185,4 +185,5 @@ overrides: cross-spawn@>=7.0.0 <7.0.5: ">=7.0.5" diff@>=6.0.0 <8.0.3: ">=8.0.3" dompurify: ^3.3.3 + sigstore@<4.1.1: ^4.1.1 yaml@>=2.0.0 <2.8.3: ">=2.8.3" From 8d47733dca7f2e3d405dabfd8c4372c20b9c4556 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Mon, 20 Jul 2026 12:28:46 -0400 Subject: [PATCH 031/249] [specs] add sse tests (#11239) fixes #6870 --------- Co-authored-by: iscai-msft Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../changes/specs-addSse-2026-6-13-16-37-0.md | 7 + .../changes/specs-addSse-2026-7-17-13-4-0.md | 7 + .../changes/specs-addSse-2026-7-17-13-4-1.md | 7 + packages/http-specs/package.json | 2 + packages/http-specs/spec-summary.md | 75 ++ .../http-specs/specs/streaming/sse/main.tsp | 153 ++++ .../http-specs/specs/streaming/sse/mockapi.ts | 71 ++ packages/spec-api/src/types.ts | 2 + packages/spector/src/app/request-processor.ts | 20 +- pnpm-lock.yaml | 856 +++++++++--------- 10 files changed, 769 insertions(+), 431 deletions(-) create mode 100644 .chronus/changes/specs-addSse-2026-6-13-16-37-0.md create mode 100644 .chronus/changes/specs-addSse-2026-7-17-13-4-0.md create mode 100644 .chronus/changes/specs-addSse-2026-7-17-13-4-1.md create mode 100644 packages/http-specs/specs/streaming/sse/main.tsp create mode 100644 packages/http-specs/specs/streaming/sse/mockapi.ts diff --git a/.chronus/changes/specs-addSse-2026-6-13-16-37-0.md b/.chronus/changes/specs-addSse-2026-6-13-16-37-0.md new file mode 100644 index 00000000000..9bf951c9805 --- /dev/null +++ b/.chronus/changes/specs-addSse-2026-6-13-16-37-0.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/http-specs" +--- + +Add SSE tests \ No newline at end of file diff --git a/.chronus/changes/specs-addSse-2026-7-17-13-4-0.md b/.chronus/changes/specs-addSse-2026-7-17-13-4-0.md new file mode 100644 index 00000000000..e449eeeaf27 --- /dev/null +++ b/.chronus/changes/specs-addSse-2026-7-17-13-4-0.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/spec-api" +--- + +Add `streamChunks` support to `MockBody` for chunked SSE streaming in mock responses diff --git a/.chronus/changes/specs-addSse-2026-7-17-13-4-1.md b/.chronus/changes/specs-addSse-2026-7-17-13-4-1.md new file mode 100644 index 00000000000..c9d76fae1d7 --- /dev/null +++ b/.chronus/changes/specs-addSse-2026-7-17-13-4-1.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/spector" +--- + +Support chunked streaming via `streamChunks` in mock response body diff --git a/packages/http-specs/package.json b/packages/http-specs/package.json index c7d240e0920..48202f80de6 100644 --- a/packages/http-specs/package.json +++ b/packages/http-specs/package.json @@ -58,8 +58,10 @@ }, "peerDependencies": { "@typespec/compiler": "workspace:^", + "@typespec/events": "workspace:^", "@typespec/http": "workspace:^", "@typespec/rest": "workspace:^", + "@typespec/sse": "workspace:^", "@typespec/versioning": "workspace:^", "@typespec/xml": "workspace:^" } diff --git a/packages/http-specs/spec-summary.md b/packages/http-specs/spec-summary.md index 5319ebb342e..abf7daaa2c7 100644 --- a/packages/http-specs/spec-summary.md +++ b/packages/http-specs/spec-summary.md @@ -5332,6 +5332,81 @@ Basic jsonl streaming for response. Basic jsonl streaming for request. +### Streaming_Sse_Named_receive + +- Endpoint: `get /streaming/sse/named/receive` + +SSE streaming with multiple named events and a terminal event, modeled after +an OpenAI-style streaming response. Each named union variant sets the SSE +`event:` field; the terminal `[DONE]` event signals the client to disconnect. + +Expected response body (content type `text/event-stream`): + +``` +event: responseCreated +data: {"id": "resp_1"} + +event: responseDelta +data: {"delta": "Hello"} + +event: responseDelta +data: {"delta": " world"} + +data: [DONE] + +``` + +### Streaming_Sse_Retrieve_stream + +- Endpoint: `post /streaming/sse/retrieve/stream` + +A POST request with a JSON body whose response is an SSE stream, modeled +after a knowledge-retrieval service. The server streams `partialResult` +events as results become available, a final `finalResult` event, and a +terminal `[DONE]` event. + +Expected request body (content type `application/json`): + +``` +{"query": "what is typespec?"} +``` + +Expected response body (content type `text/event-stream`): + +``` +event: partialResult +data: {"text": "partial one"} + +event: partialResult +data: {"text": "partial two"} + +event: finalResult +data: {"references": ["doc1", "doc2"]} + +data: [DONE] + +``` + +### Streaming_Sse_Unnamed_receive + +- Endpoint: `get /streaming/sse/unnamed/receive` + +SSE streaming with unnamed events. The server streams a sequence of unnamed +`message` events, each carrying a JSON `Info` payload, then closes the +connection. Since the union variant is unnamed, no `event:` field is emitted +and each event defaults to the `message` type. + +Expected response body (content type `text/event-stream`): + +``` +data: {"desc": "one"} + +data: {"desc": "two"} + +data: {"desc": "three"} + +``` + ### Type_Array_BooleanValue_get - Endpoint: `get /type/array/boolean` diff --git a/packages/http-specs/specs/streaming/sse/main.tsp b/packages/http-specs/specs/streaming/sse/main.tsp new file mode 100644 index 00000000000..16e81a33deb --- /dev/null +++ b/packages/http-specs/specs/streaming/sse/main.tsp @@ -0,0 +1,153 @@ +import "@typespec/http"; +import "@typespec/sse"; +import "@typespec/events"; +import "@typespec/spector"; + +using Http; +using Events; +using SSE; +using Spector; + +@doc("Test of server-sent events (SSE) streaming.") +@scenarioService("/streaming/sse") +namespace Streaming.Sse; + +@route("unnamed") +namespace Unnamed { + model Info { + desc: string; + } + + @events + union UnnamedEvents { + @Events.contentType("application/json") + Info, + } + + @scenario + @scenarioDoc(""" + SSE streaming with unnamed events. The server streams a sequence of unnamed + `message` events, each carrying a JSON `Info` payload, then closes the + connection. Since the union variant is unnamed, no `event:` field is emitted + and each event defaults to the `message` type. + + Expected response body (content type `text/event-stream`): + ``` + data: {"desc": "one"} + + data: {"desc": "two"} + + data: {"desc": "three"} + + ``` + """) + @route("receive") + op receive(): SSEStream; +} + +@route("named") +namespace Named { + model ResponseCreated { + id: string; + } + + model ResponseDelta { + delta: string; + } + + @events + union ResponseEvents { + @Events.contentType("application/json") + responseCreated: ResponseCreated, + + @Events.contentType("application/json") + responseDelta: ResponseDelta, + + @Events.contentType("text/plain") + @terminalEvent + "[DONE]", + } + + @scenario + @scenarioDoc(""" + SSE streaming with multiple named events and a terminal event, modeled after + an OpenAI-style streaming response. Each named union variant sets the SSE + `event:` field; the terminal `[DONE]` event signals the client to disconnect. + + Expected response body (content type `text/event-stream`): + ``` + event: responseCreated + data: {"id": "resp_1"} + + event: responseDelta + data: {"delta": "Hello"} + + event: responseDelta + data: {"delta": " world"} + + data: [DONE] + + ``` + """) + @route("receive") + op receive(): SSEStream; +} + +@route("retrieve") +namespace Retrieve { + model RetrievalRequest { + query: string; + } + + model PartialResult { + text: string; + } + + model FinalResult { + references: string[]; + } + + @events + union RetrievalEvents { + @Events.contentType("application/json") + partialResult: PartialResult, + + @Events.contentType("application/json") + finalResult: FinalResult, + + @Events.contentType("text/plain") + @terminalEvent + "[DONE]", + } + + @scenario + @scenarioDoc(""" + A POST request with a JSON body whose response is an SSE stream, modeled + after a knowledge-retrieval service. The server streams `partialResult` + events as results become available, a final `finalResult` event, and a + terminal `[DONE]` event. + + Expected request body (content type `application/json`): + ``` + {"query": "what is typespec?"} + ``` + + Expected response body (content type `text/event-stream`): + ``` + event: partialResult + data: {"text": "partial one"} + + event: partialResult + data: {"text": "partial two"} + + event: finalResult + data: {"references": ["doc1", "doc2"]} + + data: [DONE] + + ``` + """) + @post + @route("stream") + op stream(@body request: RetrievalRequest): SSEStream; +} diff --git a/packages/http-specs/specs/streaming/sse/mockapi.ts b/packages/http-specs/specs/streaming/sse/mockapi.ts new file mode 100644 index 00000000000..d417a061abb --- /dev/null +++ b/packages/http-specs/specs/streaming/sse/mockapi.ts @@ -0,0 +1,71 @@ +import { passOnSuccess, ScenarioMockApi } from "@typespec/spec-api"; + +export const Scenarios: Record = {}; + +const unnamedStream = ['data: {"desc": "one"}', 'data: {"desc": "two"}', 'data: {"desc": "three"}'] + .map((event) => `${event}\n\n`) + .join(""); + +Scenarios.Streaming_Sse_Unnamed_receive = passOnSuccess({ + uri: "/streaming/sse/unnamed/receive", + method: "get", + request: {}, + response: { + status: 200, + body: { + rawContent: Buffer.from(unnamedStream), + contentType: "text/event-stream", + }, + }, + kind: "MockApiDefinition", +}); + +const namedChunks = [ + 'event: responseCreated\ndata: {"id": "resp_1"}\n\n', + 'event: responseDelta\ndata: {"delta": "Hello"}\n\n', + 'event: responseDelta\ndata: {"delta": " world"}\n\n', + "data: [DONE]\n\n", +].map((event) => Buffer.from(event)); + +Scenarios.Streaming_Sse_Named_receive = passOnSuccess({ + uri: "/streaming/sse/named/receive", + method: "get", + request: {}, + response: { + status: 200, + body: { + streamChunks: namedChunks, + contentType: "text/event-stream", + rawContent: Buffer.from(namedChunks.map((c) => c.toString()).join("")), + }, + }, + kind: "MockApiDefinition", +}); + +const retrieveStream = [ + 'event: partialResult\ndata: {"text": "partial one"}', + 'event: partialResult\ndata: {"text": "partial two"}', + 'event: finalResult\ndata: {"references": ["doc1", "doc2"]}', + "data: [DONE]", +] + .map((event) => `${event}\n\n`) + .join(""); + +Scenarios.Streaming_Sse_Retrieve_stream = passOnSuccess({ + uri: "/streaming/sse/retrieve/stream", + method: "post", + request: { + body: { + rawContent: JSON.stringify({ query: "what is typespec?" }), + contentType: "application/json", + }, + }, + response: { + status: 200, + body: { + rawContent: Buffer.from(retrieveStream), + contentType: "text/event-stream", + }, + }, + kind: "MockApiDefinition", +}); diff --git a/packages/spec-api/src/types.ts b/packages/spec-api/src/types.ts index c04347a476c..693923ba7b0 100644 --- a/packages/spec-api/src/types.ts +++ b/packages/spec-api/src/types.ts @@ -102,6 +102,8 @@ export interface KeyedMockResponse extends MockRespon export interface MockBody { contentType: string; rawContent: string | Buffer | Resolver | undefined; + /** When set, the response body is streamed as separate chunks instead of sent as a single buffer. */ + streamChunks?: Buffer[]; } export interface ResolverConfig { diff --git a/packages/spector/src/app/request-processor.ts b/packages/spector/src/app/request-processor.ts index 7dfad27ccbd..73d017310be 100644 --- a/packages/spector/src/app/request-processor.ts +++ b/packages/spector/src/app/request-processor.ts @@ -43,12 +43,20 @@ const processResponse = ( } if (mockResponse.body) { - const raw = - typeof mockResponse.body.rawContent === "string" || - Buffer.isBuffer(mockResponse.body.rawContent) - ? mockResponse.body.rawContent - : mockResponse.body.rawContent?.serialize(resolverConfig); - response.contentType(mockResponse.body.contentType).send(raw); + response.contentType(mockResponse.body.contentType); + + if (mockResponse.body.streamChunks) { + for (const chunk of mockResponse.body.streamChunks) { + response.write(chunk); + } + } else { + const raw = + typeof mockResponse.body.rawContent === "string" || + Buffer.isBuffer(mockResponse.body.rawContent) + ? mockResponse.body.rawContent + : mockResponse.body.rawContent?.serialize(resolverConfig); + response.send(raw); + } } response.end(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 101080fa7d9..6d82a0b1461 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1471,6 +1471,9 @@ importers: '@typespec/compiler': specifier: workspace:^ version: link:../compiler + '@typespec/events': + specifier: workspace:^ + version: link:../events '@typespec/http': specifier: workspace:^ version: link:../http @@ -1483,6 +1486,9 @@ importers: '@typespec/spector': specifier: workspace:^ version: link:../spector + '@typespec/sse': + specifier: workspace:^ + version: link:../sse '@typespec/versioning': specifier: workspace:^ version: link:../versioning @@ -3055,49 +3061,49 @@ packages: resolution: {integrity: sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==} '@algolia/cache-browser-local-storage@4.27.0': - resolution: {integrity: sha512-YGog2s57sO20lvpa+hv5XLAAmiTI1kHsCMRtPVfiaOdIQnvRla21lfH08onqEbZihOPVI8GULwt79zQB2ymKzg==} + resolution: {integrity: sha1-/tBTiYL9IYWPRS8Xan8WeL3JHFU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.27.0.tgz} '@algolia/cache-common@4.27.0': - resolution: {integrity: sha512-Sr8zjNXj82p6lO4W9CdzfF0m0/9h/H6VAdSHOTtimm/cTzXIYXRI2IZq7+Nt2ljJ7Ukx+7dIFcxQjE57eQSPsw==} + resolution: {integrity: sha1-+knhvihBgtxxJER76gFXeB/wN2M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/cache-common/-/cache-common-4.27.0.tgz} '@algolia/cache-in-memory@4.27.0': - resolution: {integrity: sha512-abgMRTcVD0IllNvMM9JFhxtyLn1v6Ey7mQ7+BGS3JCzvkCX7KZqlS0BIuVUDgx9sPIfOeNsG/awGzMmP50TwZw==} + resolution: {integrity: sha1-DwAaYgitaNvC+7+vbKaTZ7f4Gzw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/cache-in-memory/-/cache-in-memory-4.27.0.tgz} '@algolia/client-account@4.27.0': - resolution: {integrity: sha512-sSHxwrKTKJrwfoR/LcQJZfmiWJcM5d9Rp7afMChxOcdGdkSdIwrNBC8SCcHRenA3GsZ6mg+j6px7KWYxJ34btA==} + resolution: {integrity: sha1-0Mji39IoBsUjjv6NAUMeS1k+1Uk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-account/-/client-account-4.27.0.tgz} '@algolia/client-analytics@4.27.0': - resolution: {integrity: sha512-MqIDyxODljn9ZC4oqjQD0kez2a4zjIJ9ywA/b7cIiUiK/tDjZNTVjYd9WXMKQlXnWUwfrfXJZClVVqN1iCXS+Q==} + resolution: {integrity: sha1-3HgsCNEhzXxxvF+lFD1qvhTHPjY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-analytics/-/client-analytics-4.27.0.tgz} '@algolia/client-common@4.27.0': - resolution: {integrity: sha512-ZrT6l/YPQgyIUuBCxcYPeXol2VBLUMuNb1rKXrm6z1f/iTiwqtnEEb16/6CC11+Re0ZGXrdcMVrgDRrzveQ1aQ==} + resolution: {integrity: sha1-b9b2HZfVII2jw4rr6MVPsFKQLZU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-common/-/client-common-4.27.0.tgz} '@algolia/client-personalization@4.27.0': - resolution: {integrity: sha512-OZqaFFVm+10hAlmxpiTWi/o2n+YKBESbSqSy2yXAumPH/kaK4moJHFblbh8IkV3KZR0lLm4hzPtn8Q2nWNiDUA==} + resolution: {integrity: sha1-3ZWXyLr/gVx2Z3BquzM7qNU7XQk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-personalization/-/client-personalization-4.27.0.tgz} '@algolia/client-search@4.27.0': - resolution: {integrity: sha512-qmX/f67ay0eZ4V5Io8fWWOcUVo/gqre2yei1PnmEhQU2Gul6ushg25QnNrfu4BODiRrw1rwYveZaLCiHvcUxrQ==} + resolution: {integrity: sha1-kKWEYURjagofrOpYE/3isgYGdzk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-search/-/client-search-4.27.0.tgz} '@algolia/logger-common@4.27.0': - resolution: {integrity: sha512-pIrmQRXtDV+zTMVXKtKCosC2rWhn0F0TdUeb9etA6RiAz6jY6bY6f0+JX7YekDK09SnmZMLIyUa7Jci+Ied9bw==} + resolution: {integrity: sha1-rxEAS66kRp8gKFlCV+Xf7IxtP2g=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/logger-common/-/logger-common-4.27.0.tgz} '@algolia/logger-console@4.27.0': - resolution: {integrity: sha512-UWvta8BxsR/u5z9eI088mOSLQaGtmoCtXeN3DYJurlxAdJwPuKtEb5+433kxA6/E9f2/JgoW89KZ1vNP9pcHBQ==} + resolution: {integrity: sha1-qCCJtRKQu7T+EfiZyuFIfJrL7HI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/logger-console/-/logger-console-4.27.0.tgz} '@algolia/recommend@4.27.0': - resolution: {integrity: sha512-CFy54xDjrsazPi3KN04yPmLRDT72AKokc3RLOdWQvG0/uEUjj7dhWqe9qenxpL4ydsjO7S1eY5YqmX+uMGonlg==} + resolution: {integrity: sha1-FZ8jDJoSPleBSZy6i30FwjW/yl4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/recommend/-/recommend-4.27.0.tgz} '@algolia/requester-browser-xhr@4.27.0': - resolution: {integrity: sha512-dTenMBIIpyp5o3C2ZnfbsuSlD/lL9jPkk6T+2+qm38fyw2nf49ANbcHFE79NgiGrnmw7QrYveCs9NIP3Wk4v6g==} + resolution: {integrity: sha1-urmBu0bd7SiX5K0yfiIufsg23yg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.27.0.tgz} '@algolia/requester-common@4.27.0': - resolution: {integrity: sha512-VC3prAQVgWTubMStb3mJz6i61Hqbtagi2LeIbgNtoFJFff3XZDcAaO1D5r0GYl2+DrB2VzUHnQXbkiuI+HHYyg==} + resolution: {integrity: sha1-BYbE32Yvnc5xKl6Z22GTK4IyhwA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/requester-common/-/requester-common-4.27.0.tgz} '@algolia/requester-node-http@4.27.0': - resolution: {integrity: sha512-y8nUqaUQeSOQ5oaNo0b2QPznyBFW9LoIwljyUphJ+gUZpU6O/j2/C8ovoqDpIe6J0etqHg5RCcBizrCFZuLpyw==} + resolution: {integrity: sha1-ujY3/xULEWHnk/eici7FAz6nT3c=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/requester-node-http/-/requester-node-http-4.27.0.tgz} '@algolia/transporter@4.27.0': - resolution: {integrity: sha512-PvSbELU4VjN3xSX79ki+zIdOGhTxyJXWvRDzkUjfTx2iNfPWDdTjzKbP1o+268coJztxrkuBwJz90Urek7o1Kw==} + resolution: {integrity: sha1-Ulk1ygMzEBo8bP8TBOQZHQYc9ik=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/transporter/-/transporter-4.27.0.tgz} '@alloy-js/babel-plugin-jsx-dom-expressions@0.40.0': resolution: {integrity: sha512-vK4enF0fmATGjqv2E2S3Zhci3TmM7+jp+cmsAhhLE0U/6kFmYJqqKV+swdcRs/fAlRJwaoevqarbMLm4zY05OQ==} @@ -3155,58 +3161,58 @@ packages: typescript: ^5.0.0 || ^6.0.0 '@astrojs/compiler-binding-darwin-arm64@0.2.2': - resolution: {integrity: sha512-1WxpECx3izz5X4Ha3l6ex79HZlUHpKBTElGJsfOosnhVvXhccfcXAsBlrYPNmUOKJWiG7mcrje0ELSr1KPE69Q==} + resolution: {integrity: sha1-SJ45Tbu1NrmT61X9C5DCIQ6LWnE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-darwin-arm64/-/compiler-binding-darwin-arm64-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@astrojs/compiler-binding-darwin-x64@0.2.2': - resolution: {integrity: sha512-PdIQidwQ4nUX/qNL0JXzSwNYadr+yX/Yoo+kZSCxBZqlAqug9SlKR/1H5EG5jSEpkEDRo2d1JdrO1W4kU6uNHw==} + resolution: {integrity: sha1-ghM5ZNT2nuA9sVb0JS6kp9Jh9yw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-darwin-x64/-/compiler-binding-darwin-x64-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@astrojs/compiler-binding-linux-arm64-gnu@0.2.2': - resolution: {integrity: sha512-5sZicPkJCoyxTEOW2he+u6UV97pTXY4c7fbHOZ/aslu9ewsunD0231QUBSvnjBB9hRFzzP2JRfNCLY+IvWfw0Q==} + resolution: {integrity: sha1-Wzgy/Pt2HPsvWZmCwStDRgqIapM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-arm64-gnu/-/compiler-binding-linux-arm64-gnu-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@astrojs/compiler-binding-linux-arm64-musl@0.2.2': - resolution: {integrity: sha512-Vto5fqRzMepQNJPeEhQLOIkmAoNbSBQNlpMe64OHTjEbAtQpJYVHEwe+8WJLaEGLA9qBksLv7ctiYPLLxgVVYQ==} + resolution: {integrity: sha1-CkJ24XSJR9fiX3/hEOn7J5HKlkM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-arm64-musl/-/compiler-binding-linux-arm64-musl-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@astrojs/compiler-binding-linux-x64-gnu@0.2.2': - resolution: {integrity: sha512-NJTTaUDU49WEJT+ImS9evlv3i3x42HN8PbcqdyydI9picnKtuf5TxRL94naoW09YDMYWpkrwVeVqaG7GTSIepQ==} + resolution: {integrity: sha1-C0BJg6RytGAklAn9ApC9jmJ2ZB8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-x64-gnu/-/compiler-binding-linux-x64-gnu-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@astrojs/compiler-binding-linux-x64-musl@0.2.2': - resolution: {integrity: sha512-9nFdNDkWaU35bhWUIciDmi439W0fq2ZNgv1GCi2A/LSb+8vTw9l9z+fVW4YEn7Tlvbs8gyQkJvbc62ZD1H76xA==} + resolution: {integrity: sha1-JiD1kU67xSaqBChL6heEhHfcnVo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-x64-musl/-/compiler-binding-linux-x64-musl-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@astrojs/compiler-binding-wasm32-wasi@0.2.2': - resolution: {integrity: sha512-3NWaxRc3KSwr9zHBEGcQ147rMgAhi/HzZWZJPRN2YLbtuLhoeBPruhdX1MIlOYAg3FvJPYdzGCAKvvWWU6pF0A==} + resolution: {integrity: sha1-QMuEgGz5udqTJ9Ih3yduptSXgyE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-wasm32-wasi/-/compiler-binding-wasm32-wasi-0.2.2.tgz} engines: {node: '>=14.0.0'} cpu: [wasm32] '@astrojs/compiler-binding-win32-arm64-msvc@0.2.2': - resolution: {integrity: sha512-QsyOgocLGOwDm8zAyuAiziALMzbTTevaqBLv5lvdhyhj2JC5yjp0H3yeEBtE0owRLr1gDQdX0+1qBSc5tTwp4g==} + resolution: {integrity: sha1-mZoSv0E8jf7HmdAFw0iumzwkN6c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-win32-arm64-msvc/-/compiler-binding-win32-arm64-msvc-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@astrojs/compiler-binding-win32-x64-msvc@0.2.2': - resolution: {integrity: sha512-+/C8Oh9YS8C0fwtaqDtUSPniKwlJqgiQbxp7XuzxCP0RI/Jf7yOlz9ZHNr6jD3ZJa4CHdq0mYq7pd8QFiNGIZA==} + resolution: {integrity: sha1-YgCfnNDfTZ0eLNV2c46SN9gtZz8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-win32-x64-msvc/-/compiler-binding-win32-x64-msvc-0.2.2.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -3573,28 +3579,28 @@ packages: resolution: {integrity: sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==} '@bruits/satteri-darwin-arm64@0.9.1': - resolution: {integrity: sha512-NE4qC2sRd0+R+oPMsKcUikIvWTGpAV16fSXNBoMSW7nK7Pd9e/ZGB7M8knep83pFmGmOb/5NbGKiVIh3oLbljw==} + resolution: {integrity: sha1-e5R/kMk/ISXEVwKiHd/UaSlwK/g=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-darwin-arm64/-/satteri-darwin-arm64-0.9.1.tgz} cpu: [arm64] os: [darwin] '@bruits/satteri-darwin-x64@0.9.1': - resolution: {integrity: sha512-Am8z5nX0L/sJR/n7np+5rMVP434MOBe3zlU+IO8fXbv2UaPNRCrEQPMS6lyxCj7dZHQI2AynSJw3v4fgQE8xSQ==} + resolution: {integrity: sha1-QAOJzH5zo1rIvS6zrIVn8GwOVsY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-darwin-x64/-/satteri-darwin-x64-0.9.1.tgz} cpu: [x64] os: [darwin] '@bruits/satteri-linux-x64-gnu@0.9.1': - resolution: {integrity: sha512-Bivw60+SIfmlaU9wEZ39HAcyPh1xU9TvOrz4KJgc+ziRStQs4EzYoWW4Eh9aSdiol+xV0vjEWYuA79aF3dr7kg==} + resolution: {integrity: sha1-3I6cRNkCDXTpl11hfHITpNLJ1Fs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-linux-x64-gnu/-/satteri-linux-x64-gnu-0.9.1.tgz} cpu: [x64] os: [linux] libc: [glibc] '@bruits/satteri-wasm32-wasi@0.9.1': - resolution: {integrity: sha512-lEFk5ebh5SxRquA5RJisEoMoDmOiSnS10PGgXgXeVlWgF8KWKI9D3hSzVqNjEg/qKOjHcNdjIfyx/03Wrl6J3g==} + resolution: {integrity: sha1-2eBYrsjIrzXoKkU6/fOntFxSX/g=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-wasm32-wasi/-/satteri-wasm32-wasi-0.9.1.tgz} engines: {node: '>=14.0.0'} cpu: [wasm32] '@bruits/satteri-win32-x64-msvc@0.9.1': - resolution: {integrity: sha512-YBhm8yARopswAPeTih11BzMxWVQFD5CI9Yryp6HWepi6F/CeMycqxv18DXrj9U2fDDlbVGwT2IiEM2UPBjIPDQ==} + resolution: {integrity: sha1-tyDECTV/dOLWx0Vcn9e4dLLfJC4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-win32-x64-msvc/-/satteri-win32-x64-msvc-0.9.1.tgz} cpu: [x64] os: [win32] @@ -3629,7 +3635,7 @@ packages: engines: {node: '>= 20.12.0'} '@colors/colors@1.5.0': - resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} + resolution: {integrity: sha1-u1BFecHK6SPmV2pPXaQ9Jfl729k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@colors/colors/-/colors-1.5.0.tgz} engines: {node: '>=0.1.90'} '@cspell/cspell-bundled-dicts@10.0.1': @@ -3930,40 +3936,40 @@ packages: resolution: {integrity: sha512-fXVXEyFA5Yv3M3n8sUGT7+fvecGrZP4k6FnWWMSZVQf69kAq0LLpaBQLGcPR30m3zMmKYhECP4k/ZkzvhEW5kw==} '@emnapi/core@1.10.0': - resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} + resolution: {integrity: sha1-OAzMjyQS6iLR2XLff47iOjucdGc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.10.0.tgz} '@emnapi/core@1.11.0': - resolution: {integrity: sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q==} + resolution: {integrity: sha1-imVQQtu7ENAmZnDJkDw0pwAccFs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.11.0.tgz} '@emnapi/core@1.9.1': - resolution: {integrity: sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==} + resolution: {integrity: sha1-IUMGnHRMokQgdPgHhGLlHt1jx70=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.9.1.tgz} '@emnapi/core@1.9.2': - resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} + resolution: {integrity: sha1-OHAmXs/8c1LQHq1i2Ng9g1ii0DQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.9.2.tgz} '@emnapi/runtime@1.10.0': - resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} + resolution: {integrity: sha1-SyYMDTU0IE6YxhELjbGph9JuyHw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.10.0.tgz} '@emnapi/runtime@1.11.0': - resolution: {integrity: sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==} + resolution: {integrity: sha1-zhazZ0/3Jmu/UPlmi96KBPMBTU4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.11.0.tgz} '@emnapi/runtime@1.11.1': - resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} + resolution: {integrity: sha1-WPHz1dgamxL3k6tojJY3GQECfCQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.11.1.tgz} '@emnapi/runtime@1.9.1': - resolution: {integrity: sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==} + resolution: {integrity: sha1-EV/yoNWJhlvmvY6dcB5JnEc/Ko0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.9.1.tgz} '@emnapi/runtime@1.9.2': - resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} + resolution: {integrity: sha1-i0aaPbFggXytsd6QUCEanR6oT6I=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.9.2.tgz} '@emnapi/wasi-threads@1.2.0': - resolution: {integrity: sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==} + resolution: {integrity: sha1-oZ2Xcsw9GVNwv24qgF7sQKp14Y4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz} '@emnapi/wasi-threads@1.2.1': - resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} + resolution: {integrity: sha1-KP7SGhuhznl8RKBwq8lNQvOuhUg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz} '@emnapi/wasi-threads@1.2.2': - resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} + resolution: {integrity: sha1-TJO+z1v6OxPRu9zAau44MhrYE5o=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz} '@emotion/hash@0.9.2': resolution: {integrity: sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==} @@ -3972,157 +3978,157 @@ packages: resolution: {integrity: sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==} '@esbuild/aix-ppc64@0.28.1': - resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==} + resolution: {integrity: sha1-egGo0uwvuy2seK2tCbD6eB5Agr4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz} engines: {node: '>=18'} cpu: [ppc64] os: [aix] '@esbuild/android-arm64@0.28.1': - resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==} + resolution: {integrity: sha1-tUCifRTkr9BYSWpNvsTT9BTbEQo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [android] '@esbuild/android-arm@0.28.1': - resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==} + resolution: {integrity: sha1-cEvSl95tdi3lTqu+r79V9nVqvi8=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-arm/-/android-arm-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm] os: [android] '@esbuild/android-x64@0.28.1': - resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==} + resolution: {integrity: sha1-0csWbTSw+/D+irRgpVlPJKN4cB4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-x64/-/android-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [android] '@esbuild/darwin-arm64@0.28.1': - resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==} + resolution: {integrity: sha1-EDSyZFf8iGNo/mG70J9lP2r6jlQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [darwin] '@esbuild/darwin-x64@0.28.1': - resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==} + resolution: {integrity: sha1-ZVVqQyoeTXIDLYIYwZMvzKGkl3I=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [darwin] '@esbuild/freebsd-arm64@0.28.1': - resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==} + resolution: {integrity: sha1-LmHgWS+QMNfj2uGO4l68U1kYrvY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] '@esbuild/freebsd-x64@0.28.1': - resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==} + resolution: {integrity: sha1-yV7CiZWe+AecTcqBeh4sS+Zrm9M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [freebsd] '@esbuild/linux-arm64@0.28.1': - resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==} + resolution: {integrity: sha1-QLIhdd2gYYLz7oFBGGxf8wTEpxc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [linux] '@esbuild/linux-arm@0.28.1': - resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==} + resolution: {integrity: sha1-wJoPZ5F1kqwN6JKpvk04FN69Kmw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.28.1': - resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==} + resolution: {integrity: sha1-pYD5xnZ5eDOJHlGfx6EzfIr9jbM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz} engines: {node: '>=18'} cpu: [ia32] os: [linux] '@esbuild/linux-loong64@0.28.1': - resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==} + resolution: {integrity: sha1-RkUs8yHcf56Rwvp4Cla7Vuec1os=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz} engines: {node: '>=18'} cpu: [loong64] os: [linux] '@esbuild/linux-mips64el@0.28.1': - resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==} + resolution: {integrity: sha1-QhGzGE3WYI9T3LIuOfXTTuCIUsg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz} engines: {node: '>=18'} cpu: [mips64el] os: [linux] '@esbuild/linux-ppc64@0.28.1': - resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==} + resolution: {integrity: sha1-aXhXwqYcubC2u2ZS5AwdxeHKjl0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz} engines: {node: '>=18'} cpu: [ppc64] os: [linux] '@esbuild/linux-riscv64@0.28.1': - resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==} + resolution: {integrity: sha1-0ZKUPrFGpArExkl9DPe+NbmGvwg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz} engines: {node: '>=18'} cpu: [riscv64] os: [linux] '@esbuild/linux-s390x@0.28.1': - resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==} + resolution: {integrity: sha1-rOoDVtoODrwI+Xz3ucLkAeHmSNw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz} engines: {node: '>=18'} cpu: [s390x] os: [linux] '@esbuild/linux-x64@0.28.1': - resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==} + resolution: {integrity: sha1-bww84MtkxTS3DExF7LLBbTTjXf0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [linux] '@esbuild/netbsd-arm64@0.28.1': - resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==} + resolution: {integrity: sha1-i813B3oNzjN4tXT+2ybSolO3PTY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] '@esbuild/netbsd-x64@0.28.1': - resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==} + resolution: {integrity: sha1-5/sqAemcgwyU5mI82f77TI+1g0c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [netbsd] '@esbuild/openbsd-arm64@0.28.1': - resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==} + resolution: {integrity: sha1-xSkJNy24uG4sVeBaiUADO1Zgo7I=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] '@esbuild/openbsd-x64@0.28.1': - resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==} + resolution: {integrity: sha1-xCe5vlpkwmL/mn63C1+7qt9EbGw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [openbsd] '@esbuild/openharmony-arm64@0.28.1': - resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==} + resolution: {integrity: sha1-3JsUe6yi5sSzyFVxdB70hgpIkJc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] '@esbuild/sunos-x64@0.28.1': - resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==} + resolution: {integrity: sha1-zoZtEt8TwV5MmfBzo9Rm9uBkmzo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [sunos] '@esbuild/win32-arm64@0.28.1': - resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==} + resolution: {integrity: sha1-dGjjaS0B1inVlB5dg4F7uA+eObQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz} engines: {node: '>=18'} cpu: [arm64] os: [win32] '@esbuild/win32-ia32@0.28.1': - resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==} + resolution: {integrity: sha1-pbwAY/sryrbQ7WPyoVN5WLwmnsY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz} engines: {node: '>=18'} cpu: [ia32] os: [win32] '@esbuild/win32-x64@0.28.1': - resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==} + resolution: {integrity: sha1-EAZO5E9DR7kMmgK0Rrv4CpFjKxI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -4140,33 +4146,33 @@ packages: resolution: {integrity: sha512-hu7EI+YxlEWEKrb2himbS13HNaq5mlUePASf99KeQqkiNeqiAZbKqG4w59uDcLZs8JrV3qJqS/NYib5ZMhbfTQ==} '@eslint-community/eslint-utils@4.9.1': - resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} + resolution: {integrity: sha1-TpCvZ7xR3e5s3vUoTt9XLsN2tZU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 '@eslint-community/regexpp@4.12.2': - resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} + resolution: {integrity: sha1-vM32Fbz3tujbgw7AuNIcmiXeWXs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint-community/regexpp/-/regexpp-4.12.2.tgz} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/config-array@0.23.5': - resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + resolution: {integrity: sha1-VuhtJDBJGV2KzAwGobPf3D+j3pU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/config-array/-/config-array-0.23.5.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/config-helpers@0.6.0': - resolution: {integrity: sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==} + resolution: {integrity: sha1-75o2iB0539Xb6sIrDamX+r+wiwM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/config-helpers/-/config-helpers-0.6.0.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/core@1.2.1': - resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + resolution: {integrity: sha1-wdp80bgvqHh/mLVin7gRhIobY84=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/core/-/core-1.2.1.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/object-schema@3.0.5': - resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + resolution: {integrity: sha1-iOm/TRHSsZwILnjr586IckpesJE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/object-schema/-/object-schema-3.0.5.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/plugin-kit@0.7.2': - resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} + resolution: {integrity: sha1-Swli8/LHzovJiz7P40UlwJ0styk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@expressive-code/core@0.43.1': @@ -4738,23 +4744,23 @@ packages: engines: {node: '>=12.20'} '@humanfs/core@0.19.2': - resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} + resolution: {integrity: sha1-qCcsoDsqz0kmcCIrIyC2xCG/3mA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanfs/core/-/core-0.19.2.tgz} engines: {node: '>=18.18.0'} '@humanfs/node@0.16.8': - resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} + resolution: {integrity: sha1-j4AMzME/T4zTEW4tnAqUk52j4+0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanfs/node/-/node-0.16.8.tgz} engines: {node: '>=18.18.0'} '@humanfs/types@0.15.0': - resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} + resolution: {integrity: sha1-8qCfYgEjkLK/8/xvskjd7IwJoJA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanfs/types/-/types-0.15.0.tgz} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + resolution: {integrity: sha1-r1smkaIrRL6EewyoFkHF+2rQFyw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz} engines: {node: '>=12.22'} '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + resolution: {integrity: sha1-wrnS43TuYsWG062+qHGZsdenpro=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanwhocodes/retry/-/retry-0.4.3.tgz} engines: {node: '>=18.18'} '@iconify/types@2.0.0': @@ -4768,308 +4774,308 @@ packages: engines: {node: '>=18'} '@img/sharp-darwin-arm64@0.34.5': - resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==} + resolution: {integrity: sha1-bgcy3K3hJrZnCveqFwYLkmg16oY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [darwin] '@img/sharp-darwin-arm64@0.35.2': - resolution: {integrity: sha512-eEieHsMksAW4IiO5NzauESRl2D2qz3J/kwUxUrSfV06A93eEaRfMpHXyUb1mAqrR7i8U9A0GRqE9pjn6u1Jjpg==} + resolution: {integrity: sha1-g6UQolFhKVzsR3P7iBy8ytdDyMI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [arm64] os: [darwin] '@img/sharp-darwin-x64@0.34.5': - resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==} + resolution: {integrity: sha1-Gbwd1uum1alig0mLnJ9AEYDunHs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [darwin] '@img/sharp-darwin-x64@0.35.2': - resolution: {integrity: sha512-BaktuGPCeHJMARpodR8jK4uKiZrPAy9WrfQW0sdI37clracq8Bp01AYS3SZgi5FS/y5twa9t4+LIuuxQjqRrWw==} + resolution: {integrity: sha1-iGHxsTh2w3NdwdOCFH/5aJqQu9s=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [x64] os: [darwin] '@img/sharp-freebsd-wasm32@0.35.2': - resolution: {integrity: sha512-YoAxdnd8hPUkvLHd3bWY+YA8nw3xM/RyRopYucNsWHVSan8NLVM3X2volsfoRDcXdUJPg6tXahSd7HXPK7lRnw==} + resolution: {integrity: sha1-vRwwNW/ZP52oCvF0a3vL0rza/2M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.2.tgz} engines: {node: '>=20.9.0'} os: [freebsd] '@img/sharp-libvips-darwin-arm64@1.2.4': - resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==} + resolution: {integrity: sha1-KJTAy4fUInbDiJlC6OLbUXpJLEM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz} cpu: [arm64] os: [darwin] '@img/sharp-libvips-darwin-arm64@1.3.1': - resolution: {integrity: sha512-4V/M3roRMTYjiwZY9IOVQOE8OyeCxFAkYmyZDrZl51uOKjibm3oeEJ4WAmLxutAfzFbC9jqUiPs2gbnGflH+7g==} + resolution: {integrity: sha1-qq7rc6tSKQzj7IlqCDVXUQ89i3A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.1.tgz} cpu: [arm64] os: [darwin] '@img/sharp-libvips-darwin-x64@1.2.4': - resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==} + resolution: {integrity: sha1-5jaB9FOalK+c0XJG7YiBc0OG+Mw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz} cpu: [x64] os: [darwin] '@img/sharp-libvips-darwin-x64@1.3.1': - resolution: {integrity: sha512-c0/DxItpJv2+dGhgycJBBgotdqruGYDvA79drdh0MD1dFpy7JzJ/PlXwi1H4rFf0eTy8tgbI91aHDnZIceY3jQ==} + resolution: {integrity: sha1-BzMN/+F52i+7odp8zKctQsQgcxU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.1.tgz} cpu: [x64] os: [darwin] '@img/sharp-libvips-linux-arm64@1.2.4': - resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} + resolution: {integrity: sha1-sbKIs2hks7zlRa2R+m2tzxpK0xg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-arm64@1.3.1': - resolution: {integrity: sha512-JznefmcK9j1JKPz8AkQDh89kjojubyfOasWBPKfzMIhPwsgDy9evpE/naJTXXXmghS1iFwR8u/kTwh/I2/+GCw==} + resolution: {integrity: sha1-pnu5Zm6PJB2i++3BYmgShJoT7wU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.1.tgz} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': - resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} + resolution: {integrity: sha1-uSYN0evm+eO9vL3KydKsEl81hS0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-arm@1.3.1': - resolution: {integrity: sha512-aGGy9aWzXgHBG7HNyQPWorZthlp7+x6fDRoPAQbGO3ThcttuTyKIx3NuSHb6zb4gBNq6/yNn9f1cy9nFKS/Vmg==} + resolution: {integrity: sha1-cWGfUM8W3qPu2YXNr27b5NBw9fM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.1.tgz} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': - resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} + resolution: {integrity: sha1-S4Ps8qgpBXIis4hIx7Ai57TQeqc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.3.1': - resolution: {integrity: sha512-1EkwGNCZk6iWNCMWqrvdJ+r1j0PT1zIz60CNPhYnJlK/zyeWqlsPZIe+ocBVqPF8k/Ssee/NCk+tE9Ryrko6ng==} + resolution: {integrity: sha1-HjXJEZnQdTpC2Qrs8BnfkuDf0SM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.1.tgz} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': - resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} + resolution: {integrity: sha1-iAtGeACeWiCArxkjMrALCq+KSN4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.3.1': - resolution: {integrity: sha512-Ilays+w2bXdnxzxtQdmXR62u8o8GYa3eL4+Gr+1KiE4xperMZUslRaVPJwwPkzlHEjGfXAfRVAa/7CYCtSqsBw==} + resolution: {integrity: sha1-fIk1FrL+aoZP3EwKxi8WjfsthXk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.1.tgz} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': - resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} + resolution: {integrity: sha1-dPNDyOEPrYIbOPdc7TBIiTncWew=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-s390x@1.3.1': - resolution: {integrity: sha512-VfBwVHQTbRoj4XlpA/KLZ7ltgMpz+4WSejFzQ+GnoImjo1PtEJ59QB2qR1xQEeRPYIkNrPIm2L4cICMvz4C2ew==} + resolution: {integrity: sha1-44254Sz2N5QZg9CL6cyZ/CD0AvU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.1.tgz} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': - resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} + resolution: {integrity: sha1-30GD6L2EEPfWG2aFmjXt6rClMc4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-x64@1.3.1': - resolution: {integrity: sha512-+c8ukgwU62DS54nCAjw7keOfHUkmr0B5QHEdcOqRnodF/MNXJbVI8Eopoj4B/0H8Asr65I+A4Amrn7a85/md6A==} + resolution: {integrity: sha1-vhUKFeiCXunV5RmLOt5tuQMPB2s=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.1.tgz} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': - resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} + resolution: {integrity: sha1-yNa0ghHfZxN1QQB+6NG3sfjKjgY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-libvips-linuxmusl-arm64@1.3.1': - resolution: {integrity: sha512-qlKb/pwbkAi1WMsJrYHk7CuDrd12s27U2QnRhFYUoJNrRCmkosMTttuRFat/DDB3IlDm5qE1TJgZ4JDnHX8Ldw==} + resolution: {integrity: sha1-kLLzVXnYdOugO+Y5fjbKRaA1mls=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.1.tgz} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': - resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} + resolution: {integrity: sha1-vhHHW+5bCAy+4xoVOod5RI+Rn3U=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.3.1': - resolution: {integrity: sha512-yO21HwoUVLN8Qa+/SBjQLMYwBWAVJjeGPNe+hc0OUeMeifEtJqu5a1c4HayE1nNpDih9y3/KkoltfkDodmKAlg==} + resolution: {integrity: sha1-vseNOKinRG7jERDsBIfBSezZ7nU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.1.tgz} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-linux-arm64@0.34.5': - resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} + resolution: {integrity: sha1-eqd2TvnAAfFeYQVG1C/OVpEXkMw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-linux-arm64@0.35.2': - resolution: {integrity: sha512-af12Pnd0ZGu2HfP8NayB0kk6eC/lrfbQE6HlR4jD+34wdJ1Vw9TF6TMn6ZvffT+WgqVsl0hRbmNvz2u/23VmwA==} + resolution: {integrity: sha1-XgwsGTmL/4iLhqvmaDrxRrume5Q=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-linux-arm@0.34.5': - resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} + resolution: {integrity: sha1-X7DDaV3RJSLTnD/3pryBZGF4Cg0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-linux-arm@0.35.2': - resolution: {integrity: sha512-SE4kzF2mepn6z+6E7L6lsV8FzuLL6IPQdyX8ZiwROAG/G8td+hP/m7FsFPwidtrF19gvajuC9l6TxAVcsA4S7A==} + resolution: {integrity: sha1-ne4abrJBvD8DnaIKaSBjMsrR73o=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': - resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} + resolution: {integrity: sha1-nCE6gVIKIMr2aXjz1MB0Vv8uCBM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-linux-ppc64@0.35.2': - resolution: {integrity: sha512-hYSBm7zcNtDCozCxQHYZJiu63b/bXsgRZuOxCIBZsStMM9Vap47iFHdbX4kCvQsblPB/k+clhELpdQJHQLSHvg==} + resolution: {integrity: sha1-Tl8DlF+u/E2SEhuh9TS3BpflONU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': - resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} + resolution: {integrity: sha1-zdKBgndOrb4E9iZ1oWqrvMuDP2A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-linux-riscv64@0.35.2': - resolution: {integrity: sha512-qQt0Kc13+Hoan/Awq/qMSQw3L+RI1NCRPgD5cUJ/1WSSmIoysLOc72jlRM3E0OHN9Yr313jgeQ2T+zW+F03QFA==} + resolution: {integrity: sha1-5YoOh3IoyJEKQEFg6XxMP1OfYdw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-linux-s390x@0.34.5': - resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} + resolution: {integrity: sha1-k+rGAbnzKbsnkX4OGQmMci1jDfc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-linux-s390x@0.35.2': - resolution: {integrity: sha512-E4fLLfRPzDLlEeDaTzI98OFLcv++WL5ChLLMwPoVd0CIoZQqupBSNbOisPL5am9XsbQ9T84+iiMpUvbFtkunbA==} + resolution: {integrity: sha1-4SkhNwQjMsNYGCPqUVNd3pccU40=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-linux-x64@0.34.5': - resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} + resolution: {integrity: sha1-VavHzXVP/KUAK2wrcZq9/IRoGag=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-linux-x64@0.35.2': - resolution: {integrity: sha512-gi0zFJJRLswfCZmHtJdikXPOc5u7qamSOS3NHedLqLd4W8Q0NqjdBr6TTRIgsfFjqfTsHFgdfvJ9LwqSgcHiAA==} + resolution: {integrity: sha1-ujob+uwAqzlJU/hD8v6NWVB9CCY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': - resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} + resolution: {integrity: sha1-1lFe6XG7YvcwAaSCm52GWhG3cIY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-linuxmusl-arm64@0.35.2': - resolution: {integrity: sha512-siWbOW1u6HFnFLrp0waKyW7VEf7jYvcDWdrXEFa8AkdAQgEvuu5Fz8/Y70w9EeqAdwDtfU012BhEHHaDqvQNzg==} + resolution: {integrity: sha1-Avazdc4Ws342rSn0zd1EkjJ68hI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': - resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} + resolution: {integrity: sha1-2Xl4rsfFIS+ZlxTy9bc2RX4S7p8=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-linuxmusl-x64@0.35.2': - resolution: {integrity: sha512-YBqMMcjDi4QGYiSn4vNOYBhmlC4z5AXqkOUUqI2e0AFA4urNv4ESgOgwNl3K+4etQhha0twXlzeF20bbULm9Yg==} + resolution: {integrity: sha1-3A2OWKlOp03G5lklqXVSVXX2878=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-wasm32@0.34.5': - resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} + resolution: {integrity: sha1-LxWAOqYm+MWd18nQu8dm8atSz6A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [wasm32] '@img/sharp-wasm32@0.35.2': - resolution: {integrity: sha512-Mrv4JQNYVQ94xH+jzZ9r+gowleN8mv2FTgKT+PI6bx5C0G8TdNYndu161pg2i7uoBwxy2ImPMHrJOM2LZef7Bw==} + resolution: {integrity: sha1-n1o8XlOYEns0+o+r7Qf/3YyjQo0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-wasm32/-/sharp-wasm32-0.35.2.tgz} engines: {node: '>=20.9.0'} '@img/sharp-webcontainers-wasm32@0.35.2': - resolution: {integrity: sha512-QNV27pxs9wpApEiCfvHM1RDoP1w1+2KrUWWDPEhEwg+latvOrfuhWrHWZKwdSFwU6jh3myjw/yOCRsUIuOft3g==} + resolution: {integrity: sha1-NZT16i6s80gcF4cUat4998/Y7r4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [wasm32] '@img/sharp-win32-arm64@0.34.5': - resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==} + resolution: {integrity: sha1-Nwbp46w1/d/ByH+U6Enxt1MHzgo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [win32] '@img/sharp-win32-arm64@0.35.2': - resolution: {integrity: sha512-BiVRYc/t6/Vl3e1hBx0hugG4oN9Pydf4fgMSpxTQJmwGUg/YoXTWHiFeRymHfCZzifxu4F4rpk/I67D0LQ20wQ==} + resolution: {integrity: sha1-cDHJE0/jTmbCSuIaDu01dDDoHlo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [arm64] os: [win32] '@img/sharp-win32-ia32@0.34.5': - resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==} + resolution: {integrity: sha1-C3EWZZmwSeAy8IX7kmPgL05HiN4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ia32] os: [win32] '@img/sharp-win32-ia32@0.35.2': - resolution: {integrity: sha512-YYEhx9PImCC7T0tI8JDMi4DB9LwLCXCU5OWNYEXAxh5Q1ShKkyC6byxzoBJ3gEFDnH2lQckWuDe70G7mB2XJog==} + resolution: {integrity: sha1-a5Ehne+4ghUpH5sF1d+P+Ysb5iw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.2.tgz} engines: {node: ^20.9.0} cpu: [ia32] os: [win32] '@img/sharp-win32-x64@0.34.5': - resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==} + resolution: {integrity: sha1-qB/7AOaSZ80KHWJurtuKhDCysvg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [win32] '@img/sharp-win32-x64@0.35.2': - resolution: {integrity: sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ==} + resolution: {integrity: sha1-QGUigNhztAwaaMO51usJqy9CWQE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.2.tgz} engines: {node: '>=20.9.0'} cpu: [x64] os: [win32] @@ -5316,7 +5322,7 @@ packages: resolution: {integrity: sha512-xgAyonlVVS+q7Vc7qLW0UrJU7rSFcETRWsqdXZtjzRU8dF+6CkozTK4V4y1LwOX7j8r/vHphjDeMeGI4tNGeGA==} '@napi-rs/wasm-runtime@1.1.5': - resolution: {integrity: sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==} + resolution: {integrity: sha1-zM1uvEC5kd6mk2+RJrG4FVtsTJU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 @@ -5508,128 +5514,128 @@ packages: resolution: {integrity: sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==} '@oxc-parser/binding-android-arm-eabi@0.127.0': - resolution: {integrity: sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==} + resolution: {integrity: sha1-t155YknuIvYy5A6UJ0bEv2SM7pI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] '@oxc-parser/binding-android-arm64@0.127.0': - resolution: {integrity: sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==} + resolution: {integrity: sha1-4mRGf+OfgAGPYvoNroLbC4AmBEQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@oxc-parser/binding-darwin-arm64@0.127.0': - resolution: {integrity: sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==} + resolution: {integrity: sha1-BXbTUQnADcxidyALouyntH4H8bE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@oxc-parser/binding-darwin-x64@0.127.0': - resolution: {integrity: sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==} + resolution: {integrity: sha1-76G6SQdaoxj/VAocL4pEIBdBcgY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@oxc-parser/binding-freebsd-x64@0.127.0': - resolution: {integrity: sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==} + resolution: {integrity: sha1-gXujxQjXUdlNbm/Yavad2qJ9pTE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@oxc-parser/binding-linux-arm-gnueabihf@0.127.0': - resolution: {integrity: sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==} + resolution: {integrity: sha1-scMJbGVHcZmEgDFu8Q0eXSntx5s=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxc-parser/binding-linux-arm-musleabihf@0.127.0': - resolution: {integrity: sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==} + resolution: {integrity: sha1-xEqPEObJA2hYJa6/Eon8IIau1h4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxc-parser/binding-linux-arm64-gnu@0.127.0': - resolution: {integrity: sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==} + resolution: {integrity: sha1-YcJFq/q29jBFkVtcnPp9M1rXxEA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-arm64-musl@0.127.0': - resolution: {integrity: sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==} + resolution: {integrity: sha1-NYu9kOXIW2w1El9ab/CE4JtpTAQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@oxc-parser/binding-linux-ppc64-gnu@0.127.0': - resolution: {integrity: sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==} + resolution: {integrity: sha1-t+p7Ub9U20xCgZGH92DgadQz2sM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-riscv64-gnu@0.127.0': - resolution: {integrity: sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==} + resolution: {integrity: sha1-OjsQ0WCYjfULu81jHGrznePdRR0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-riscv64-musl@0.127.0': - resolution: {integrity: sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==} + resolution: {integrity: sha1-N4fTfh0KFe4jn1FhAphQAyGzFzA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] '@oxc-parser/binding-linux-s390x-gnu@0.127.0': - resolution: {integrity: sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==} + resolution: {integrity: sha1-txoWy7oRWkaWSY+RSbxUzE4d+c0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-x64-gnu@0.127.0': - resolution: {integrity: sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==} + resolution: {integrity: sha1-cVJ90ChLpyfTWpPIQckRkq8+vew=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-x64-musl@0.127.0': - resolution: {integrity: sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==} + resolution: {integrity: sha1-FoMK+ksAHzSc67k+ErJ45yYByz8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@oxc-parser/binding-openharmony-arm64@0.127.0': - resolution: {integrity: sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==} + resolution: {integrity: sha1-pBxx0knLWX3DVwOOscvjznMkU/g=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@oxc-parser/binding-wasm32-wasi@0.127.0': - resolution: {integrity: sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==} + resolution: {integrity: sha1-se/NtDOzDtSjrZEvoD2jg0vUhF0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] '@oxc-parser/binding-win32-arm64-msvc@0.127.0': - resolution: {integrity: sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==} + resolution: {integrity: sha1-titeMoEmMj1Brh7nrclVN8TEQjo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@oxc-parser/binding-win32-ia32-msvc@0.127.0': - resolution: {integrity: sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==} + resolution: {integrity: sha1-2sMN5pcdvmOqVyK+mkzAcP08ZQ4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] '@oxc-parser/binding-win32-x64-msvc@0.127.0': - resolution: {integrity: sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==} + resolution: {integrity: sha1-ot+HmwgD9ys1CnVnNlzuW4l47fA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.127.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -5641,267 +5647,267 @@ packages: resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==} '@oxc-resolver/binding-android-arm-eabi@11.21.3': - resolution: {integrity: sha512-eNU11A2WNizh04v3uyaJCootrHIaS0B9aHYXvAvVnPNk4xYSjMUjHnhQ6dewPN2MRYDskV85d1N0Aw0WNWhcyg==} + resolution: {integrity: sha1-98pC2UYU7sl+ILmvqnFz79YBnuk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.21.3.tgz} cpu: [arm] os: [android] '@oxc-resolver/binding-android-arm64@11.21.3': - resolution: {integrity: sha512-8Q+ZjTLvn2dIcWsrmhdrEihm7q+ag/k+mkry7Z+t0QbbHaVxXQfvH9AewyVMh/WrpEKhQ3DDgx9fYbqeCpeOEw==} + resolution: {integrity: sha1-9yNoLFm03+FD7cttNk1aA94+lJ4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.21.3.tgz} cpu: [arm64] os: [android] '@oxc-resolver/binding-darwin-arm64@11.21.3': - resolution: {integrity: sha512-wkh0qKZGHXVUDxFw3oA1TXnU2BDYY/r775oJflGeIr8uDPPoN2pk8gijQIzYRT6hoql/lg3+Tx/SaTn9e2/aGg==} + resolution: {integrity: sha1-58TzdByHkRxAxCmiCgW3gTacq6o=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.21.3.tgz} cpu: [arm64] os: [darwin] '@oxc-resolver/binding-darwin-x64@11.21.3': - resolution: {integrity: sha512-HbNc23FAQYbuyDV2vBWMez4u4mrsm5RAkniGZAWqr6lYZ3N4beeqIb776jzwRl8qL2zRhHVXpUj97X0QgogVzg==} + resolution: {integrity: sha1-jSNFzS2NTc+lBCLibzsAja6Rv8E=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.21.3.tgz} cpu: [x64] os: [darwin] '@oxc-resolver/binding-freebsd-x64@11.21.3': - resolution: {integrity: sha512-K6xNsTUPEUdfrn0+kbMq5nOUB5w1C5pavPQngt4TM2FpN91lP0PBe2srSpamb4d69O7h86oAi/qWX/kZNRSjkw==} + resolution: {integrity: sha1-t1VMOreQOpWq1hC6XRY5lvS3EJU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.21.3.tgz} cpu: [x64] os: [freebsd] '@oxc-resolver/binding-linux-arm-gnueabihf@11.21.3': - resolution: {integrity: sha512-VcFmOpcpWX1zoEy8M58tR2M9YxM+Z9RuQhqAx5q0CTmrruaP7Gveejg75hzd/5sg5nk9G3aLALEa3hE2FsmmTQ==} + resolution: {integrity: sha1-KnF9b3m911pczch1vNCp/uWF8cM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.21.3.tgz} cpu: [arm] os: [linux] '@oxc-resolver/binding-linux-arm-musleabihf@11.21.3': - resolution: {integrity: sha512-quVoxFLBy43hWaQbbDtQNRwAX5vX76mv7n64icAtQcJ3eNgVeblqmkupF/hAneNthdqSlnd1sTjb3aQSaDPaCQ==} + resolution: {integrity: sha1-LP1SNN4pE8KAXkK1+uWqk1TZm6k=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.21.3.tgz} cpu: [arm] os: [linux] '@oxc-resolver/binding-linux-arm64-gnu@11.21.3': - resolution: {integrity: sha512-X0AqNZgcD07Q4V3RDK18/vYOj/HQT/FnmEFGYS2jTWqY7JO13ryE3TEs3eAIgUJhBnNkpEaiXqz3VK8M7qQhWQ==} + resolution: {integrity: sha1-MhcvvRtm191tygX82Fzuew4yBgo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.21.3.tgz} cpu: [arm64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-arm64-musl@11.21.3': - resolution: {integrity: sha512-YkaQnaKYdbuaXvRt5Qd0GpbihzVnyfR6z1SpYfIUC6RTu4NF7lDKPjVkYb+jRI2gedVO2rVpN35Y6akG6ud4Lw==} + resolution: {integrity: sha1-rDHkiUy7DAC9pb4eUmZBBzkjv9w=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.21.3.tgz} cpu: [arm64] os: [linux] libc: [musl] '@oxc-resolver/binding-linux-ppc64-gnu@11.21.3': - resolution: {integrity: sha512-gB9HwhrPiFqUzDeEq+y/CgAijz1YdI6BnXz5GaH2Pa9cWdutchlkGFAiAuGb/PjVQpiK6NFKzFuztxrweoit7A==} + resolution: {integrity: sha1-qK5+zBElkYEk0YdJ79caTgTgqFY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.21.3.tgz} cpu: [ppc64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-riscv64-gnu@11.21.3': - resolution: {integrity: sha512-zjDWBlYk8QGv0H8dsPUWqkfjYIIjG2TvspGkzXL0eImbgxtZorA/klKeHyolevoT3Kvbi+1iMr9Lhrh7jf54Og==} + resolution: {integrity: sha1-0kztmzIfZg8ahZ+ZEt6rP4f9MRU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.21.3.tgz} cpu: [riscv64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-riscv64-musl@11.21.3': - resolution: {integrity: sha512-4UfsQvacV388y1zpXL7C1x1FNYaV52JtuNRiuzrfQA2z1z6ElVrsidkGsrvQ5EgeSq1Pj7kaKqrgGkvFuxJ/tw==} + resolution: {integrity: sha1-sgzWttTGHqYnGJvJOaxfRppabIk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.21.3.tgz} cpu: [riscv64] os: [linux] libc: [musl] '@oxc-resolver/binding-linux-s390x-gnu@11.21.3': - resolution: {integrity: sha512-b5uH+HKH0MP5mNBYaK75SKsJbw52URqrx2LavYdq6wb0l3ExAG5niYRP9DWUNHdKilpaBVM2bXk9HNWrH3ew7Q==} + resolution: {integrity: sha1-0/SuyCtMuhh+UOIRxg+Va8YRb38=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.21.3.tgz} cpu: [s390x] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-x64-gnu@11.21.3': - resolution: {integrity: sha512-PjYlmilBpNRh2ntXNYAK3Am5w/nPfEpnU/96iNx7CI8EzAn12J4JRiec63wHJTH31nLoCNxBg/829pN+3CfG3Q==} + resolution: {integrity: sha1-rdO3YpPvHolZ4AvGtiradm4YSFw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.21.3.tgz} cpu: [x64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-x64-musl@11.21.3': - resolution: {integrity: sha512-QTBAb7JuHlZ7JUEyM8UiQi2f7m/L4swBhP2TNpYIDc9Wp/wRw1G/8sl6i13aIzQAXH7LKIm294LeOHd0lQR8zA==} + resolution: {integrity: sha1-S0x5vSaIoPmgLAoLZxAV/y98Zfw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.21.3.tgz} cpu: [x64] os: [linux] libc: [musl] '@oxc-resolver/binding-openharmony-arm64@11.21.3': - resolution: {integrity: sha512-4j1DFwjwv36ec9kds0jU/ucQ5Ha4ERO/H95BxR5JFf0kqUUAJ1kwII7XhTc1vZrkdJkvLGC9Q2MbpObpum8RBg==} + resolution: {integrity: sha1-PcM6FZqu830td9EN8EWt76tYUt8=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.21.3.tgz} cpu: [arm64] os: [openharmony] '@oxc-resolver/binding-wasm32-wasi@11.21.3': - resolution: {integrity: sha512-i8oluoel5kru/j1WNrjmQSiA3GQ7wvIYVR1IwIoZtKogAhya2iub+ZKIeSIkcJOrnzQ18Tzl/F+kL3fYOxZLvA==} + resolution: {integrity: sha1-a8ib4FPijVU9sQCzUFxrDSUZsOw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.21.3.tgz} engines: {node: '>=14.0.0'} cpu: [wasm32] '@oxc-resolver/binding-win32-arm64-msvc@11.21.3': - resolution: {integrity: sha512-M/8dw8dD6aOs+NlPJax401CZB9I7Aut84isQLgALGGwke4Afvw+/7yYhZb94yXf6t2sPLhQLmSmtSV+2FhsOWg==} + resolution: {integrity: sha1-Y0XucnpZn+wGLEikO5Rct4huh+o=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.21.3.tgz} cpu: [arm64] os: [win32] '@oxc-resolver/binding-win32-x64-msvc@11.21.3': - resolution: {integrity: sha512-H7BCt/VnS9hnmMp42eGhZ99izSCRvlnWwy/N71K1/J8QoExwY4262Z8QiEkMDtduRJrztayDxETTckmUuAVL9Q==} + resolution: {integrity: sha1-0Nox/ORta4VnL6HnUVQA+vzkXho=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.21.3.tgz} cpu: [x64] os: [win32] '@oxlint-tsgolint/darwin-arm64@0.23.0': - resolution: {integrity: sha512-gOs9PVr2wEg4ox9z0aJo+RKhhImW86YL5N6yav8BK/rgPsIrwN/igSZ+pbRr723NFvUNKde9fgMhRA6JrXAOZw==} + resolution: {integrity: sha1-lvouDN2mF8tZVbz9Tt3uxIZxhf0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/darwin-arm64/-/darwin-arm64-0.23.0.tgz} cpu: [arm64] os: [darwin] '@oxlint-tsgolint/darwin-x64@0.23.0': - resolution: {integrity: sha512-kjJ8B+7n4tB9VJdxS5A9GdJt6/bYpzbu4lXp2uO1S3sRmCB5gDEABlGoiePNApRWaW+xqL4b4xgiE727jSLhuA==} + resolution: {integrity: sha1-1EmBRiRi71G0C6agfKCiSnjjNf0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/darwin-x64/-/darwin-x64-0.23.0.tgz} cpu: [x64] os: [darwin] '@oxlint-tsgolint/linux-arm64@0.23.0': - resolution: {integrity: sha512-6dCZuKNu135seMXilkRk9SpCx6i1XgmiipYGalLij5WVRX6ZYS8c4xI7preN/zv9fCXhsQclTIMDu2Y/cytTjw==} + resolution: {integrity: sha1-YLGEaFABM7BsfiYA1kGWek20Cxc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/linux-arm64/-/linux-arm64-0.23.0.tgz} cpu: [arm64] os: [linux] '@oxlint-tsgolint/linux-x64@0.23.0': - resolution: {integrity: sha512-3bdilnyA7kmSTjK27rvjIjSxL5SIg3wt7vwNiRkouWB83ytssyKnuGvxSYJxgMEmFpSutzaBzcCUM2jDtPGcgA==} + resolution: {integrity: sha1-+NZ3o3/TvTVAUEMWRxcysIlQm4k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/linux-x64/-/linux-x64-0.23.0.tgz} cpu: [x64] os: [linux] '@oxlint-tsgolint/win32-arm64@0.23.0': - resolution: {integrity: sha512-j+OEp44SVYiQ+ZD+uttsX7u6L9SvmbbQ77SO1pSFCcJlsVMeCk8qZsjhKfGKuT/jIA+ipOJMVs/+pqUfObBWNw==} + resolution: {integrity: sha1-xeYC03dilvFXpcf/pJsKtyRlYMs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/win32-arm64/-/win32-arm64-0.23.0.tgz} cpu: [arm64] os: [win32] '@oxlint-tsgolint/win32-x64@0.23.0': - resolution: {integrity: sha512-5MyjFuqf+g8OUPJBSGWHJtmoWnzFJYyOg4To9WMQshZYEWig/vtu7JtJ03VWnzHv9LJkAUeApY0gVCOywFR/iQ==} + resolution: {integrity: sha1-ofG2DzOnhgd9IJxWi/M6iEEUxeo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/win32-x64/-/win32-x64-0.23.0.tgz} cpu: [x64] os: [win32] '@oxlint/binding-android-arm-eabi@1.71.0': - resolution: {integrity: sha512-ImGmd1njEg4FEJH03jhRnveEegtO3czCtfptvaHivKAZQIYATbVFBrrzbaYMYv0oJioTnxZAZVSyV+oL7W8S2g==} + resolution: {integrity: sha1-hgB+KTt6nMho9u9EFt5mrf99UgQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] '@oxlint/binding-android-arm64@1.71.0': - resolution: {integrity: sha512-4A5BEexBrwY1YFF8Kiq/lp/wQPRG79G3BWIE1FuWaM5MvmpYSd+7ZySVcKkHdwo0UDzdQGddp6pD9mpctMqLnw==} + resolution: {integrity: sha1-nb0CWG/HIkoQHjy/P0hOrAf50mo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-android-arm64/-/binding-android-arm64-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@oxlint/binding-darwin-arm64@1.71.0': - resolution: {integrity: sha512-9wJA9GJulLwS2usU3CEisI/ESDO1n1z9eyTCvApMDrAkbJ1ve0mORgTMjcWWsKxkzkeZ2N/Gpra5IQE7x8tYgQ==} + resolution: {integrity: sha1-eA9SQhJB2hgPJkHToj6nIFIHkLU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@oxlint/binding-darwin-x64@1.71.0': - resolution: {integrity: sha512-PlLCjS06V0PeJMAJwzjrExw1sYNW9Gch3JtNlcwwZDXGlTYDuwHNN89zYH8LTXFfgkVtsYvs2nv0FqrzyuFDzg==} + resolution: {integrity: sha1-ChLX+0bl5bAmZGqomYRew3r4TfE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@oxlint/binding-freebsd-x64@1.71.0': - resolution: {integrity: sha512-Lhil7bWre0ncxbUoDoxfS0JzpTz17BRQKW7iwoAUY8GJ66+WwJEfYPCFJ1P0WgVZR5/O/b3Q2pENlHOjeXLOGQ==} + resolution: {integrity: sha1-UzsBoSAHX/++s1SMB1PO/Tld2r0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@oxlint/binding-linux-arm-gnueabihf@1.71.0': - resolution: {integrity: sha512-Oo9/L58PYD3RC0x05d2upAPLllHytTjHQGsnC06P6Ynn7jKkp5mdImQxXdJ3+FnBaKspNpGogzgVsi6g872LiA==} + resolution: {integrity: sha1-EFQRgTHD1JqKEyghqsnQ8V3oQdk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxlint/binding-linux-arm-musleabihf@1.71.0': - resolution: {integrity: sha512-mSHfyfgJrEbyIR29ejaeS50BdPk+GoNPlC1dckpDiUZbJAIel68sjSMdOt4WY0/gva+ECC7FNITQkxMJU+vSBw==} + resolution: {integrity: sha1-0Y223az7wGmNlmDtqS/7/cRRAbY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxlint/binding-linux-arm64-gnu@1.71.0': - resolution: {integrity: sha512-n9yY4M2tiy3aij4AqtlnspzpfdpeT5JQfK2/w2d8oyp5W0FRwOb1dIeX99nORNcxGr08iD9bH8N5XFz3I2iy8w==} + resolution: {integrity: sha1-S7iwJArXkNGZdI5LqGyshxFG0cY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@oxlint/binding-linux-arm64-musl@1.71.0': - resolution: {integrity: sha512-fJZrs5sDZtTaPIOiemRQQmo82Ezy+vOGXemPc4Ok7iVVsYsFa7SlW6Z5XN819VfsqBHRm3NJ3rTdnR8+bJYJdQ==} + resolution: {integrity: sha1-jLsaZgPZ6qBfmyVGnQT3HfqjrgU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@oxlint/binding-linux-ppc64-gnu@1.71.0': - resolution: {integrity: sha512-cwl7VKGERIy9p+G+AvZdfy/06q0aHXaTt/mMRReC751iuNYJgqKjB7NydXSS30nBT9vtr2tunciOtrR4fD6FUA==} + resolution: {integrity: sha1-v0gBIOjBu7+/OISm+uwHzy7T2PI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@oxlint/binding-linux-riscv64-gnu@1.71.0': - resolution: {integrity: sha512-eZ8ieVXvzGi8jr7+ybQGPK2STw3mldfxZlgA2738iflfB/rzA69sE6m5rDRpQaxC7dpm745Enlh1Tod0QAk9Gg==} + resolution: {integrity: sha1-ki+4B031Nd40bXsf9DPDlPUqYA0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] '@oxlint/binding-linux-riscv64-musl@1.71.0': - resolution: {integrity: sha512-puMDbQYe6+NXwfMusojoA7CXGn2b3utukmd23PQqc1E3XhVCwyZ+FueSMzDYeNgDV2dUfIVXAAKZBcFDeCL6sA==} + resolution: {integrity: sha1-VaQ3aTpjsOECbBZ1bFQWYe58nHQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] '@oxlint/binding-linux-s390x-gnu@1.71.0': - resolution: {integrity: sha512-4NJLxBs1ujISCt3L/1FcywLs73PWtJuw+piD6feK2V6h6OS6P7xu9/sWt1DTRLibe6QCzmfZzmM/2HPORoV/Lg==} + resolution: {integrity: sha1-KT5BNt6CC3F23qDj6n5KCq5RbGs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@oxlint/binding-linux-x64-gnu@1.71.0': - resolution: {integrity: sha512-cFDaiR8L3430qp88tfZnvFlt3KotFhR/DlbIL0nHOMMYiG/9Wy4l+6f7t8G8pTa9bd8Lt8+M0y/qjRQ/xcB74g==} + resolution: {integrity: sha1-I1oET4wI1j+6uX7vcFgOshLF9Fk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@oxlint/binding-linux-x64-musl@1.71.0': - resolution: {integrity: sha512-orfixdt76KlpNly9z0PkWBBNfwjKz+JFVLP/7wnVchlKNU9Dpt9InU/ZggeSej6fC7qwHmHNOGlhLnQXcYoGuA==} + resolution: {integrity: sha1-C+j2veztYN4pDRGAEGDUBGicS0M=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@oxlint/binding-openharmony-arm64@1.71.0': - resolution: {integrity: sha512-9emQu2lAp6yhPB3XuI+++vR+l/o6JR1X+EpxwcumPdQXBWXEPAsquPGL7l158EqU8SebQMXTUa/S5zN98juyHw==} + resolution: {integrity: sha1-VuyV4rwMdb4d5wNG4Nh1mh0x7vI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@oxlint/binding-win32-arm64-msvc@1.71.0': - resolution: {integrity: sha512-bd5kI8spYwTm3BILDtGhi73zoup5dw8MlPQNT8YB3BD5UIsjNe3K9/4ctrzQMX4SZMoK5HgzVLkLJzacEXB7fA==} + resolution: {integrity: sha1-4YfIhBlLiCL/E0ctWxLn9h1U5ns=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@oxlint/binding-win32-ia32-msvc@1.71.0': - resolution: {integrity: sha512-W4HvOHGzVLHcrmFu+bMrJlho+/yrlX5ZNdJZqGe8MEldkQG+RHYhxxad9P4jvWAYFmIqUA5i9DQ8QsJqSU9GIw==} + resolution: {integrity: sha1-okuOrBh6Qla2iTWz/baxGwTu4Mc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] '@oxlint/binding-win32-x64-msvc@1.71.0': - resolution: {integrity: sha512-D2kyEIPHk/G/wiZLnwTVC/sVst+T/lKldVOjAFpgTIBUAOlry72e5OiapDbDBF4LfJLkN5ypJb/8Eu6yJzkveQ==} + resolution: {integrity: sha1-sIzKhigT+Li92u5ydE2i4mJKhDE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.71.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] '@pagefind/darwin-arm64@1.5.2': - resolution: {integrity: sha512-MXpI+7HsAdPkvJ0gk9xj9g541BCqBZOBbdwj9g6lB5LCj6kSV6nqDSjzcAJwvOsfu0fjwvC8hQU+ecfhp+MpiQ==} + resolution: {integrity: sha1-llFS/8IrzNgpngZffPvGhpob/+A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/darwin-arm64/-/darwin-arm64-1.5.2.tgz} cpu: [arm64] os: [darwin] '@pagefind/darwin-x64@1.5.2': - resolution: {integrity: sha512-IojxFWMEJe0RQ7PQ3KXQsPIImNsbpPYpoZ+QUDrL8fAl/O27IX+LVLs74/UzEZy5uA2LD8Nz1AiwKr72vrkZQw==} + resolution: {integrity: sha1-tbm0dnPK97KAiRFU4qR1q8SZ+t0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/darwin-x64/-/darwin-x64-1.5.2.tgz} cpu: [x64] os: [darwin] @@ -5909,27 +5915,27 @@ packages: resolution: {integrity: sha512-pm1LMnQg8N2B3n2TnjKlhaFihpz6zTiA4HiGQ6/slKO/+8K9CAU5kcjdSSPgpuk1PMuuN4hxLipUIifnrkl3Sg==} '@pagefind/freebsd-x64@1.5.2': - resolution: {integrity: sha512-7EVzo9+0w+2cbe671BtMj10UlNo83I+HrLVLfRxO731svHRJKUfJ/mo05gU14pe9PCfpKNQT8FS3Xc/oDN6pOA==} + resolution: {integrity: sha1-z24nnZOMI2hzG7ZVi/j2agyAomk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/freebsd-x64/-/freebsd-x64-1.5.2.tgz} cpu: [x64] os: [freebsd] '@pagefind/linux-arm64@1.5.2': - resolution: {integrity: sha512-Ovt9+K35sqzn8H3ZMXGwls4TD/wMJuvRtShHIsmUQREmaxjrDEX7gHckRCrwYJ4XE1H1p6HkLz3wukrAnsfXQw==} + resolution: {integrity: sha1-iyLPwaNMWQM8W9Zmdreobvug9fQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/linux-arm64/-/linux-arm64-1.5.2.tgz} cpu: [arm64] os: [linux] '@pagefind/linux-x64@1.5.2': - resolution: {integrity: sha512-V+tFqHKXhQKq/WqPBD67AFy7scn1/aZID00ws4fSDd+1daSi5UHR9VVlRrOUYKxn3VuFQYRD7lYXdZK1WED1YA==} + resolution: {integrity: sha1-pzPRwKnZBTEfafiGh3HAzEKQn+Q=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/linux-x64/-/linux-x64-1.5.2.tgz} cpu: [x64] os: [linux] '@pagefind/windows-arm64@1.5.2': - resolution: {integrity: sha512-hN9Nh90fNW61nNRCW9ZyQrAj/mD0eRvmJ8NlTUzkbuW8kIzGJUi3cxjFkEcMZ5h/8FsKWD/VcouZl4yo1F7B6g==} + resolution: {integrity: sha1-bWyzlaVhNqkrkcC9hm9/7DsLvnw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/windows-arm64/-/windows-arm64-1.5.2.tgz} cpu: [arm64] os: [win32] '@pagefind/windows-x64@1.5.2': - resolution: {integrity: sha512-Fa2Iyw7kaDRzGMfNYNUXNW2zbL5FQVDgSOcbDHdzBrDEdpqOqg8TcZ68F22ol6NJ9IGzvUdmeyZypLW5dyhqsg==} + resolution: {integrity: sha1-kx/byfAPcgV5UM0mDvll1P0CqS4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/windows-x64/-/windows-x64-1.5.2.tgz} cpu: [x64] os: [win32] @@ -5937,7 +5943,7 @@ packages: resolution: {integrity: sha512-4HDWyHC51xl3FguYJSzwda3Lr/JxjxDM9Hr62OZ4JEQ3o/bYXd3blfbvvDtTcEvi6u23qYocgFR1jQLpvIwy2A==} '@pkgjs/parseargs@0.11.0': - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + resolution: {integrity: sha1-p36nQvqyV3UUVDTrHSMoz1ATrDM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pkgjs/parseargs/-/parseargs-0.11.0.tgz} engines: {node: '>=14'} '@playwright/browser-chromium@1.61.0': @@ -5954,7 +5960,7 @@ packages: engines: {node: '>=12.17'} '@pnpm/cafs-types@1000.1.0': - resolution: {integrity: sha512-uUAnheFdWz+rwgDSr0MO8LH0M27j/ocj+KVXlGmmaAHyMKqIMRnuQZdAciAW7/Cb29WOfmPFm+U/aRtBjysE9g==} + resolution: {integrity: sha1-LYnSSIJrDepfupfrv73FWeotH/0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/cafs-types/-/cafs-types-1000.1.0.tgz} engines: {node: '>=18.12'} '@pnpm/catalogs.config@1000.0.6': @@ -6012,7 +6018,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/core-loggers@1001.0.10': - resolution: {integrity: sha512-02ZMWWNmHHzAxtDiB+8AfQpnpsb+UzJLpBdGznUmSd9pwgTph19yQFyFuZ3ZGGXy1EFotd1gRO92VcStP6s+DA==} + resolution: {integrity: sha1-Ig8Ye3KKhHnVTthfLD90QX4fO9s=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/core-loggers/-/core-loggers-1001.0.10.tgz} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6030,7 +6036,7 @@ packages: '@pnpm/logger': ^1001.0.1 '@pnpm/create-cafs-store@1000.0.35': - resolution: {integrity: sha512-X2rxUPmcwkFd8E2V0znoOJ2sMtlJISz/bjejfMQJAsnX40lOjN5DH15bJ8joyp9u8Pa69HWm1COyLwkf5Dj7Uw==} + resolution: {integrity: sha1-fuK1ZfAMIuchFQYftOEh5nAHHsI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/create-cafs-store/-/create-cafs-store-1000.0.35.tgz} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6088,7 +6094,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/exec.pkg-requires-build@1000.0.17': - resolution: {integrity: sha512-APWev2tWXUYqqexF3egGDlrri/vpTiqEr6KZmC9BuCqh+qmANOUyWASvnnn15ZXYrulkjbOMfHRAPy6baq6M7w==} + resolution: {integrity: sha1-EbMscsuxCmFWnJf99HNNkilFdIE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/exec.pkg-requires-build/-/exec.pkg-requires-build-1000.0.17.tgz} engines: {node: '>=18.12'} '@pnpm/fetch@1001.0.0': @@ -6102,7 +6108,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/fetcher-base@1001.2.4': - resolution: {integrity: sha512-xBdP7eZlCZIKBQ1sKLUKSl34U2QsxSQcgmiCrWhkCmfzaFi/iFCvBZTa6i7COG0X9zKeZ4t9k+iMt/BqepeIEA==} + resolution: {integrity: sha1-2Dkx8Dnz2zOoBJQKrQPF9aiKZ8M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/fetcher-base/-/fetcher-base-1001.2.4.tgz} engines: {node: '>=18.12'} '@pnpm/fetching-types@1000.2.1': @@ -6120,7 +6126,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/fs.hard-link-dir@1000.0.6': - resolution: {integrity: sha512-8Z26HRL7YuC7jvkGMT3s5+0sJSBJ8PtldWGQ9gCPtXtjfORr7ep5V/rcTDQk6L1KzFIBuSg5NBOpxLdzJeCUCA==} + resolution: {integrity: sha1-uG1x9+tZFRKwFh/h/n0KstJ6HNk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/fs.hard-link-dir/-/fs.hard-link-dir-1000.0.6.tgz} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': '>=1001.0.0 <1002.0.0' @@ -6132,7 +6138,7 @@ packages: '@pnpm/logger': ^1001.0.1 '@pnpm/fs.indexed-pkg-importer@1000.1.28': - resolution: {integrity: sha512-mqqvSaztrCln7u6/mON7Bo5jDjHuXIkzErYJWRvDXkzedL6mSJueKsT9PEdMPJoM33+Zb94kk9xhhieuKO2O/Q==} + resolution: {integrity: sha1-dgPsEAmqgeodKirp6IkzjYrSQng=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/fs.indexed-pkg-importer/-/fs.indexed-pkg-importer-1000.1.28.tgz} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6165,7 +6171,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/hosted-git-info@1.0.0': - resolution: {integrity: sha512-QzmNiLShTnNyeTHr+cykG5hYjwph0+v49KHV36Dh8uA2rRMWw30qoZMARuxd00SYdoTwT8bIouqqmzi6TWfJHQ==} + resolution: {integrity: sha1-vM42aKqpkK8QA+R+cYgZm0PBrJI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/hosted-git-info/-/hosted-git-info-1.0.0.tgz} engines: {node: '>=10'} '@pnpm/lifecycle@1001.0.37': @@ -6191,7 +6197,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/logger@1001.0.1': - resolution: {integrity: sha512-gdwlAMXC4Wc0s7Dmg/4wNybMEd/4lSd9LsXQxeg/piWY0PPXjgz1IXJWnVScx6dZRaaodWP3c1ornrw8mZdFZw==} + resolution: {integrity: sha1-hOmVA4uf4LTx45kGo+CT0htTGjM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/logger/-/logger-1001.0.1.tgz} engines: {node: '>=18.12'} '@pnpm/manifest-utils@1002.0.5': @@ -6225,7 +6231,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/node-fetch@1.0.0': - resolution: {integrity: sha512-eYwrzhKUBGFdq78rJStGjaHTUHA2VH+Avr//CVx/T+EJkI7hnFmOy6YghvcB2clj8HpO4V8tXRNuFNfRX08ayw==} + resolution: {integrity: sha1-aHq+x5NCHa8TdoIlNcZxnzXDeKI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/node-fetch/-/node-fetch-1.0.0.tgz} engines: {node: ^10.17 || >=12.3} '@pnpm/node.fetcher@1001.0.27': @@ -6305,7 +6311,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/ramda@0.28.1': - resolution: {integrity: sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==} + resolution: {integrity: sha1-DzKrxSddWGoD4Nwd2QoAmsZo/zM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/ramda/-/ramda-0.28.1.tgz} '@pnpm/read-modules-dir@1000.0.0': resolution: {integrity: sha512-IEJ9Zc2DVqKy5iFu0EtwdBMTa0F5nElqh53dBv+dO+2g72dKd31CV4fMyWrjf7PIdFs0YUAknYok5wKBeMTqJw==} @@ -6344,7 +6350,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/resolver-base@1005.4.3': - resolution: {integrity: sha512-c97+Njdw6nVYnPpX/K0VIJizMj667iicUqC8WzLqEx9XJVw9WPrxSrZTE+lZ9e1F0tImFY3ycub8gLevJGsDiA==} + resolution: {integrity: sha1-+CpbKXa828BI2LeoGA0Viz4i2Uk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/resolver-base/-/resolver-base-1005.4.3.tgz} engines: {node: '>=18.12'} '@pnpm/resolving.bun-resolver@1005.0.11': @@ -6384,7 +6390,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/store-controller-types@1004.5.3': - resolution: {integrity: sha512-0II55WSiG1ALCJWbIVyRjSnM5v4sE7Sh+wCkBrn+K/eTCa2zmVNYAWOQlYSXPE3rGamju7Hrkrlfm7FMYg57LA==} + resolution: {integrity: sha1-Cg7XyXtx9flJMURWxw+X/EiLebk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/store-controller-types/-/store-controller-types-1004.5.3.tgz} engines: {node: '>=18.12'} '@pnpm/store-path@1000.0.6': @@ -6396,11 +6402,11 @@ packages: engines: {node: '>=18.12'} '@pnpm/store.cafs@1000.1.6': - resolution: {integrity: sha512-C6F4cWBbohslWaBIXH9uSqNG9mvJXwhZx4IDXJkDCEyBlA3YOeBw63WUQJ+IIBS8blwyli0ba6IGOq5+sA8TEQ==} + resolution: {integrity: sha1-Su6m8PkX8Vp/oTLkeC8k8NzJbiw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/store.cafs/-/store.cafs-1000.1.6.tgz} engines: {node: '>=18.12'} '@pnpm/symlink-dependency@1000.0.20': - resolution: {integrity: sha512-u7yVH6sdHNWAltbvM8YL48XS0/lT06Hf3F9L5CrfxJ44zNHFKgTCpLoaa5OM/aBKcJLNcgJLzjqDUZ8SKRwU+w==} + resolution: {integrity: sha1-wUKA38MGFuJGMyLFeK7yCQiShAk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/symlink-dependency/-/symlink-dependency-1000.0.20.tgz} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6429,7 +6435,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/types@1001.3.1': - resolution: {integrity: sha512-8dvQ/12/Zko+R2+f7guZPXDMMRVgsJlCDx3HtRGd+sRaFKqn52Er7tUDCqCvdcrBbSsW+75bDt6RCmEOJ9Ewwg==} + resolution: {integrity: sha1-MY4t+y34jBxndQK+nRcBuWXtwmA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/types/-/types-1001.3.1.tgz} engines: {node: '>=18.12'} '@pnpm/util.lex-comparator@3.0.2': @@ -6437,12 +6443,12 @@ packages: engines: {node: '>=18.12'} '@pnpm/which@3.0.1': - resolution: {integrity: sha512-4ivtS12Oni9axgGefaq+gTPD+7N0VPCFdxFH8izCaWfnxLQblX3iVxba+25ZoagStlzUs8sQg8OMKlCVhyGWTw==} + resolution: {integrity: sha1-GUr9B3w1ZL7Wq28QIiWqk45qdIY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/which/-/which-3.0.1.tgz} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} hasBin: true '@pnpm/worker@1000.6.11': - resolution: {integrity: sha512-5HH0bt8adt5x+sqVsBzxeetwpzC/ThbAU82aPtS70G+jKAfO9w+KiFrR9baWfIcl39A5k47bomotTg0Jro8Evw==} + resolution: {integrity: sha1-xbQtqgHqmVK9IjtiD75RMCurzGM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/worker/-/worker-1000.6.11.tgz} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6477,53 +6483,53 @@ packages: resolution: {integrity: sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==} '@reflink/reflink-darwin-arm64@0.1.19': - resolution: {integrity: sha512-ruy44Lpepdk1FqDz38vExBY/PVUsjxZA+chd9wozjUH9JjuDT/HEaQYA6wYN9mf041l0yLVar6BCZuWABJvHSA==} + resolution: {integrity: sha1-b6JFFErk8ZTcvkjWSYzEA1LaasA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-darwin-arm64/-/reflink-darwin-arm64-0.1.19.tgz} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] '@reflink/reflink-darwin-x64@0.1.19': - resolution: {integrity: sha512-By85MSWrMZa+c26TcnAy8SDk0sTUkYlNnwknSchkhHpGXOtjNDUOxJE9oByBnGbeuIE1PiQsxDG3Ud+IVV9yuA==} + resolution: {integrity: sha1-JECv7fMtFcXwVllCdtE8WF7vze8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-darwin-x64/-/reflink-darwin-x64-0.1.19.tgz} engines: {node: '>= 10'} cpu: [x64] os: [darwin] '@reflink/reflink-linux-arm64-gnu@0.1.19': - resolution: {integrity: sha512-7P+er8+rP9iNeN+bfmccM4hTAaLP6PQJPKWSA4iSk2bNvo6KU6RyPgYeHxXmzNKzPVRcypZQTpFgstHam6maVg==} + resolution: {integrity: sha1-2ch5MolavWOBAu6JFYkcavHUTHk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-arm64-gnu/-/reflink-linux-arm64-gnu-0.1.19.tgz} engines: {node: '>= 10'} cpu: [arm64] os: [linux] libc: [glibc] '@reflink/reflink-linux-arm64-musl@0.1.19': - resolution: {integrity: sha512-37iO/Dp6m5DDaC2sf3zPtx/hl9FV3Xze4xoYidrxxS9bgP3S8ALroxRK6xBG/1TtfXKTvolvp+IjrUU6ujIGmA==} + resolution: {integrity: sha1-N0f5K2UFwxBoWAdlzpugI2LidXQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-arm64-musl/-/reflink-linux-arm64-musl-0.1.19.tgz} engines: {node: '>= 10'} cpu: [arm64] os: [linux] libc: [musl] '@reflink/reflink-linux-x64-gnu@0.1.19': - resolution: {integrity: sha512-jbI8jvuYCaA3MVUdu8vLoLAFqC+iNMpiSuLbxlAgg7x3K5bsS8nOpTRnkLF7vISJ+rVR8W+7ThXlXlUQ93ulkw==} + resolution: {integrity: sha1-F/B/4zy85H86YkI9Y01uVzDZ8o0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-x64-gnu/-/reflink-linux-x64-gnu-0.1.19.tgz} engines: {node: '>= 10'} cpu: [x64] os: [linux] libc: [glibc] '@reflink/reflink-linux-x64-musl@0.1.19': - resolution: {integrity: sha512-e9FBWDe+lv7QKAwtKOt6A2W/fyy/aEEfr0g6j/hWzvQcrzHCsz07BNQYlNOjTfeytrtLU7k449H1PI95jA4OjQ==} + resolution: {integrity: sha1-bn6Md29HIJu4rt2Ivvgxiif5A20=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-x64-musl/-/reflink-linux-x64-musl-0.1.19.tgz} engines: {node: '>= 10'} cpu: [x64] os: [linux] libc: [musl] '@reflink/reflink-win32-arm64-msvc@0.1.19': - resolution: {integrity: sha512-09PxnVIQcd+UOn4WAW73WU6PXL7DwGS6wPlkMhMg2zlHHG65F3vHepOw06HFCq+N42qkaNAc8AKIabWvtk6cIQ==} + resolution: {integrity: sha1-WV+scdaeFJ4y3rDo2hHYPpnzG10=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-win32-arm64-msvc/-/reflink-win32-arm64-msvc-0.1.19.tgz} engines: {node: '>= 10'} cpu: [arm64] os: [win32] '@reflink/reflink-win32-x64-msvc@0.1.19': - resolution: {integrity: sha512-E//yT4ni2SyhwP8JRjVGWr3cbnhWDiPLgnQ66qqaanjjnMiu3O/2tjCPQXlcGc/DEYofpDc9fvhv6tALQsMV9w==} + resolution: {integrity: sha1-VFo3j0Tq7SISUZFHCydrihjlAE4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-win32-x64-msvc/-/reflink-win32-x64-msvc-0.1.19.tgz} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -6537,96 +6543,96 @@ packages: engines: {node: ^v12.20.0 || ^14.13.0 || >=16.0.0} '@rolldown/binding-android-arm64@1.0.3': - resolution: {integrity: sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==} + resolution: {integrity: sha1-VM6Pg4IhP0oxSgwve6g/gf/q5ZI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@rolldown/binding-darwin-arm64@1.0.3': - resolution: {integrity: sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==} + resolution: {integrity: sha1-OI/KFWbBTADEtEb8OShjDn8Nlfw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@rolldown/binding-darwin-x64@1.0.3': - resolution: {integrity: sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==} + resolution: {integrity: sha1-U/V94fWZ7PHbE4I8/IjBj7gJVK0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@rolldown/binding-freebsd-x64@1.0.3': - resolution: {integrity: sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==} + resolution: {integrity: sha1-bz/dobeuqsnSaKUmgEtPuW5ONfE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@rolldown/binding-linux-arm-gnueabihf@1.0.3': - resolution: {integrity: sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==} + resolution: {integrity: sha1-2HpFS/WFzJZ2hJN36R1uN1KXMm8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@rolldown/binding-linux-arm64-gnu@1.0.3': - resolution: {integrity: sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==} + resolution: {integrity: sha1-QZ/Wv2Es80jxBSjLzZTrq5YH2NE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.3': - resolution: {integrity: sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==} + resolution: {integrity: sha1-/MaRhpa7doRId+HkkwoY/Q03QGk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.3': - resolution: {integrity: sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==} + resolution: {integrity: sha1-Mq7LfI2uXU8qjN5XoFjshpkVQvg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.3': - resolution: {integrity: sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==} + resolution: {integrity: sha1-vtk0bqgea7i5PPEfXYi3fbiQt2M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.3': - resolution: {integrity: sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==} + resolution: {integrity: sha1-ZMLSb3Xf/ZtaH5dVegCudyUMjLc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.3': - resolution: {integrity: sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==} + resolution: {integrity: sha1-WkUTLopHZZ7qrztUDClUqXyGD/M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.3': - resolution: {integrity: sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==} + resolution: {integrity: sha1-KQUTBoxV6EnchFejKv7h17Csswk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@rolldown/binding-wasm32-wasi@1.0.3': - resolution: {integrity: sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==} + resolution: {integrity: sha1-PZly2/GpU9PHr6pKDyDvKy458xs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] '@rolldown/binding-win32-arm64-msvc@1.0.3': - resolution: {integrity: sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==} + resolution: {integrity: sha1-oASrYHoW1vA7y1VXKP+IivdXc60=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@rolldown/binding-win32-x64-msvc@1.0.3': - resolution: {integrity: sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==} + resolution: {integrity: sha1-4qJbNGkaHMihIJ195wkGMCbdDNs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -6660,140 +6666,140 @@ packages: optional: true '@rollup/rollup-android-arm-eabi@4.62.2': - resolution: {integrity: sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==} + resolution: {integrity: sha1-XphJtmHCIpz5Z6CNvi276ejJkeU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz} cpu: [arm] os: [android] '@rollup/rollup-android-arm64@4.62.2': - resolution: {integrity: sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==} + resolution: {integrity: sha1-WwaZ7l3UhLIiye10r/Q8keqLF/g=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz} cpu: [arm64] os: [android] '@rollup/rollup-darwin-arm64@4.62.2': - resolution: {integrity: sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==} + resolution: {integrity: sha1-i8UsnXo86NBTPDUanJNd54HaoG8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz} cpu: [arm64] os: [darwin] '@rollup/rollup-darwin-x64@4.62.2': - resolution: {integrity: sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==} + resolution: {integrity: sha1-ui7z6PsxDwrzVYjycM+lqpbkh2Q=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz} cpu: [x64] os: [darwin] '@rollup/rollup-freebsd-arm64@4.62.2': - resolution: {integrity: sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==} + resolution: {integrity: sha1-k7EL2/6K2iJri8DALva39URHTZY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz} cpu: [arm64] os: [freebsd] '@rollup/rollup-freebsd-x64@4.62.2': - resolution: {integrity: sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==} + resolution: {integrity: sha1-PoqjjvPJwwCUaHHj/bsMMOCiD4Y=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz} cpu: [x64] os: [freebsd] '@rollup/rollup-linux-arm-gnueabihf@4.62.2': - resolution: {integrity: sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==} + resolution: {integrity: sha1-HXmUOEuwrRvEGSG1BuFkLU+df8M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz} cpu: [arm] os: [linux] libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.62.2': - resolution: {integrity: sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==} + resolution: {integrity: sha1-plQPR8+ESla4DKn/ldKs37LO+Xs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz} cpu: [arm] os: [linux] libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.62.2': - resolution: {integrity: sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==} + resolution: {integrity: sha1-QE8gRWUYQMv0jakbptD0kPC8LL8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz} cpu: [arm64] os: [linux] libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.62.2': - resolution: {integrity: sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==} + resolution: {integrity: sha1-o0BP/d97R0tIyZuciTtiR7t2W6U=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz} cpu: [arm64] os: [linux] libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.62.2': - resolution: {integrity: sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==} + resolution: {integrity: sha1-6KrG1Umzd5ReNJiC8Zm3yOt1yjg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz} cpu: [loong64] os: [linux] libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.62.2': - resolution: {integrity: sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==} + resolution: {integrity: sha1-bi5E6lAxCzpYIHipFeX+uHnIINQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz} cpu: [loong64] os: [linux] libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.62.2': - resolution: {integrity: sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==} + resolution: {integrity: sha1-aJgwLabXegU3zeZLK0xrYGWb0RA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz} cpu: [ppc64] os: [linux] libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.62.2': - resolution: {integrity: sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==} + resolution: {integrity: sha1-MzcXyV3Vpmvvj2Pn74qf2EX9GNA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz} cpu: [ppc64] os: [linux] libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.62.2': - resolution: {integrity: sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==} + resolution: {integrity: sha1-gbwGujgDUgBNAfSCbrfNzO+gW60=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz} cpu: [riscv64] os: [linux] libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.62.2': - resolution: {integrity: sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==} + resolution: {integrity: sha1-lafNOd4hOJrWeIpShOqqc44pykw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz} cpu: [riscv64] os: [linux] libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.62.2': - resolution: {integrity: sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==} + resolution: {integrity: sha1-BubbLsG8SLU3THkj74PC6wJLJFI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz} cpu: [s390x] os: [linux] libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.62.2': - resolution: {integrity: sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==} + resolution: {integrity: sha1-XcgYmIKF4J6IeQxkYt73JBPfLaM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz} cpu: [x64] os: [linux] libc: [glibc] '@rollup/rollup-linux-x64-musl@4.62.2': - resolution: {integrity: sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==} + resolution: {integrity: sha1-IID0qTNJ6a/TS+b8GjfgH8i/yA8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz} cpu: [x64] os: [linux] libc: [musl] '@rollup/rollup-openbsd-x64@4.62.2': - resolution: {integrity: sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==} + resolution: {integrity: sha1-IdZKistmIhckuSPlGvUzPfGvBEs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz} cpu: [x64] os: [openbsd] '@rollup/rollup-openharmony-arm64@4.62.2': - resolution: {integrity: sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==} + resolution: {integrity: sha1-jg/NnQIUHjN7TFtc/1dsuadrG6A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz} cpu: [arm64] os: [openharmony] '@rollup/rollup-win32-arm64-msvc@4.62.2': - resolution: {integrity: sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==} + resolution: {integrity: sha1-vbTMTv1Y7+gIIDNH8PVGPw6hblI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz} cpu: [arm64] os: [win32] '@rollup/rollup-win32-ia32-msvc@4.62.2': - resolution: {integrity: sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==} + resolution: {integrity: sha1-26695a/STq4O7+kV2QFjLny1mGA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz} cpu: [ia32] os: [win32] '@rollup/rollup-win32-x64-gnu@4.62.2': - resolution: {integrity: sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==} + resolution: {integrity: sha1-hBCehf6l+PE1NJn5ZXj9wqDosTg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz} cpu: [x64] os: [win32] '@rollup/rollup-win32-x64-msvc@4.62.2': - resolution: {integrity: sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==} + resolution: {integrity: sha1-NnHOP5uSjVwB+Hl5LVwLYK4U1K0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz} cpu: [x64] os: [win32] @@ -6828,7 +6834,7 @@ packages: resolution: {integrity: sha512-fwI076HYknC0IrMXdY6UmjDv+PH7NHhNJX3/pY2UblSE5XrXgndXZPiOe/6ZtuFpn6DvVDVNhtkIzQ+Qu/MhVQ==} '@rushstack/worker-pool@0.4.9': - resolution: {integrity: sha512-ibAOeQCuz3g0c88GGawAPO2LVOTZE3uPh4DCEJILZS9SEv9opEUObsovC18EHPgeIuFy4HkoJT+t7l8LURZjIw==} + resolution: {integrity: sha1-8y70qgoP5niOorpT+LgWetIG7Bg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rushstack/worker-pool/-/worker-pool-0.4.9.tgz} peerDependencies: '@types/node': '*' peerDependenciesMeta: @@ -7133,37 +7139,37 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} '@turbo/darwin-64@2.9.14': - resolution: {integrity: sha512-t7QiPflaEyBE4oayeZtSmu4mEfjgIrcNlNNl1z1dmIVPqEdtA7+CfTf8d7KXsOGPh6aNgWjKxyvQg9uGfDQF+A==} + resolution: {integrity: sha1-uexqxje5xf26Xa6ddD9dEh8JEkI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/darwin-64/-/darwin-64-2.9.14.tgz} cpu: [x64] os: [darwin] '@turbo/darwin-arm64@2.9.14': - resolution: {integrity: sha512-d23147mC9BsCPA9mJ0h/ubcpbRgcJBXbcG3+Vq7YLhjz3IXuvQsJ1UXH8f4MD76ZjJ4m/E4aRdJV+MW88CDfbw==} + resolution: {integrity: sha1-mdGfPlmELFldKCjHKi5O9TdAjzg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/darwin-arm64/-/darwin-arm64-2.9.14.tgz} cpu: [arm64] os: [darwin] '@turbo/linux-64@2.9.14': - resolution: {integrity: sha512-P3ZKB5tuUDdDQWuAsACGUR1qv9W7BNWxdxqVJ0kZNuNNPRaVYTPPikLcp79+GiEcW3npsR+KyP38lnQiBc5aSA==} + resolution: {integrity: sha1-nJB0NPCRzXVSn1SWUW95txk10rs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/linux-64/-/linux-64-2.9.14.tgz} cpu: [x64] os: [linux] '@turbo/linux-arm64@2.9.14': - resolution: {integrity: sha512-ZRTlzcUMrrPv9ZuDzRF9n60Ym13bKeG9jDB8WjxyLhWNzV+AJQN+zdpIk3NJYf2zQsGUm1mNar2P0elRzLw25g==} + resolution: {integrity: sha1-ea6QYObung+3hK4HR+mA9YLnUxM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/linux-arm64/-/linux-arm64-2.9.14.tgz} cpu: [arm64] os: [linux] '@turbo/windows-64@2.9.14': - resolution: {integrity: sha512-exanwN6sIduZwykYeiTQj8kCmOhazP5WOz3bvXMcYtjhL6Z3iRWLewKrXCBq0bqwSP3iBMb/AerRCnHI4lx46A==} + resolution: {integrity: sha1-aKgPKZ81GJMUGEyIMByq2YLRwMI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/windows-64/-/windows-64-2.9.14.tgz} cpu: [x64] os: [win32] '@turbo/windows-arm64@2.9.14': - resolution: {integrity: sha512-fVdCsnmYoKICsycbWuuGp6Jvi51/3G/UluFWuAUCvR8PIW5IJkAk5BM9UF8PSm0Q2IphWHFZjYEgjHsh3B9y/g==} + resolution: {integrity: sha1-TcFmhPDdzlP6/latj1UgXERz0Xo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/windows-arm64/-/windows-arm64-2.9.14.tgz} cpu: [arm64] os: [win32] '@tybys/wasm-util@0.10.2': - resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} + resolution: {integrity: sha1-ErOhsz2x+crU3f8fYEq33QC/Rk4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@tybys/wasm-util/-/wasm-util-0.10.2.tgz} '@types/argparse@1.0.38': resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} @@ -7316,7 +7322,7 @@ packages: resolution: {integrity: sha512-cMQm7pxu6BxtHyqJ7mQZ2kXWV5SLmugybFdHCBbJ5eHzOo6VhBckEgAT3//rP5FwPHNPeEiq4SmQ5ucBwsOo4Q==} '@types/esrecurse@4.3.1': - resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + resolution: {integrity: sha1-b2Nq+WL75hkbgwvWdrpZhpJrzOw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/esrecurse/-/esrecurse-4.3.1.tgz} '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -7349,7 +7355,7 @@ packages: resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + resolution: {integrity: sha1-WWoXRyM2lNUPatinhp/Lb1bPWEE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/json-schema/-/json-schema-7.0.15.tgz} '@types/keyv@3.1.4': resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} @@ -7447,7 +7453,7 @@ packages: resolution: {integrity: sha512-hx0o7zWEUU4R2Amn+pjCBQQt23Khy/Dk56gQU5xi5jtPL1h83ACJCeFaB2M/+WO1AntvWrSoVnnCAfI1AQH4Cg==} '@types/trusted-types@2.0.7': - resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + resolution: {integrity: sha1-usywepcLkXB986PoumiWxX6tLRE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/trusted-types/-/trusted-types-2.0.7.tgz} '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} @@ -7474,7 +7480,7 @@ packages: resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} '@types/yoga-layout@1.9.2': - resolution: {integrity: sha512-S9q47ByT2pPvD65IvrWp7qppVMpk9WGMbVq9wbWZOHg6tnXSD4vyhao6nOSBwwfDdV2p3Kx9evA9vI+XWTfDvw==} + resolution: {integrity: sha1-76+emRpzkNwIGgtnkYWXmoOpY5o=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/yoga-layout/-/yoga-layout-1.9.2.tgz} '@typespec/ts-http-runtime@0.3.6': resolution: {integrity: sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og==} @@ -7600,47 +7606,47 @@ packages: hasBin: true '@vscode/vsce-sign-alpine-arm64@2.0.6': - resolution: {integrity: sha512-wKkJBsvKF+f0GfsUuGT0tSW0kZL87QggEiqNqK6/8hvqsXvpx8OsTEc3mnE1kejkh5r+qUyQ7PtF8jZYN0mo8Q==} + resolution: {integrity: sha1-LNJEyvXo7FQ/QvuR1N87kzZByPo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.6.tgz} cpu: [arm64] os: [alpine] '@vscode/vsce-sign-alpine-x64@2.0.6': - resolution: {integrity: sha512-YoAGlmdK39vKi9jA18i4ufBbd95OqGJxRvF3n6ZbCyziwy3O+JgOpIUPxv5tjeO6gQfx29qBivQ8ZZTUF2Ba0w==} + resolution: {integrity: sha1-sOgKR5IAHGbif+7iwR6CGtH6FoA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.6.tgz} cpu: [x64] os: [alpine] '@vscode/vsce-sign-darwin-arm64@2.0.6': - resolution: {integrity: sha512-5HMHaJRIQuozm/XQIiJiA0W9uhdblwwl2ZNDSSAeXGO9YhB9MH5C4KIHOmvyjUnKy4UCuiP43VKpIxW1VWP4tQ==} + resolution: {integrity: sha1-S4+hq1XygKmZhb48BvtzDleBDM4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.6.tgz} cpu: [arm64] os: [darwin] '@vscode/vsce-sign-darwin-x64@2.0.6': - resolution: {integrity: sha512-25GsUbTAiNfHSuRItoQafXOIpxlYj+IXb4/qarrXu7kmbH94jlm5sdWSCKrrREs8+GsXF1b+l3OB7VJy5jsykw==} + resolution: {integrity: sha1-0skYbZUFSYJyy93YODuwOOvPWCA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.6.tgz} cpu: [x64] os: [darwin] '@vscode/vsce-sign-linux-arm64@2.0.6': - resolution: {integrity: sha512-cfb1qK7lygtMa4NUl2582nP7aliLYuDEVpAbXJMkDq1qE+olIw/es+C8j1LJwvcRq1I2yWGtSn3EkDp9Dq5FdA==} + resolution: {integrity: sha1-s9hWAUQEC5INjG7dQ3QxS1glVIE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.6.tgz} cpu: [arm64] os: [linux] '@vscode/vsce-sign-linux-arm@2.0.6': - resolution: {integrity: sha512-UndEc2Xlq4HsuMPnwu7420uqceXjs4yb5W8E2/UkaHBB9OWCwMd3/bRe/1eLe3D8kPpxzcaeTyXiK3RdzS/1CA==} + resolution: {integrity: sha1-CifEKkrbN+lu7HjNe/o4jNTp++8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.6.tgz} cpu: [arm] os: [linux] '@vscode/vsce-sign-linux-x64@2.0.6': - resolution: {integrity: sha512-/olerl1A4sOqdP+hjvJ1sbQjKN07Y3DVnxO4gnbn/ahtQvFrdhUi0G1VsZXDNjfqmXw57DmPi5ASnj/8PGZhAA==} + resolution: {integrity: sha1-reEcru7VJPwWvWxDykmuoAKV3ow=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.6.tgz} cpu: [x64] os: [linux] '@vscode/vsce-sign-win32-arm64@2.0.6': - resolution: {integrity: sha512-ivM/MiGIY0PJNZBoGtlRBM/xDpwbdlCWomUWuLmIxbi1Cxe/1nooYrEQoaHD8ojVRgzdQEUzMsRbyF5cJJgYOg==} + resolution: {integrity: sha1-BoiWgUjgPrOSR5yEkcclBnIb7/w=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.6.tgz} cpu: [arm64] os: [win32] '@vscode/vsce-sign-win32-x64@2.0.6': - resolution: {integrity: sha512-mgth9Kvze+u8CruYMmhHw6Zgy3GRX2S+Ed5oSokDEK5vPEwGGKnmuXua9tmFhomeAnhgJnL4DCna3TiNuGrBTQ==} + resolution: {integrity: sha1-dEMO/0HSaBjCP5gmsEXYx1cy6us=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.6.tgz} cpu: [x64] os: [win32] @@ -7666,7 +7672,7 @@ packages: engines: {node: '>=14.6'} '@yarnpkg/cli@4.17.0': - resolution: {integrity: sha512-wSa5ljTrkGF4wJEAYWwZYdg0A0TA35/BRQwpLviFGQ98gRiX6Qzt9t8XLQmyT69laffuJHeeiIeGFKqjY7p8Fg==} + resolution: {integrity: sha1-ctHGq++az12AQWtbp4c2eD/3w40=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/cli/-/cli-4.17.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.9.0 @@ -7676,7 +7682,7 @@ packages: engines: {node: '>=18.12.0'} '@yarnpkg/extensions@2.0.6': - resolution: {integrity: sha512-3LciOqpKIuoc9MmYoX3k+NmCdcrvw7HqZT4N/AW3sYkujxfbFA9Ml01JNqu4InzdV9V9NcyFkAKAorCjhY8w6Q==} + resolution: {integrity: sha1-2bm3gIPFcna1N16iEa8uB8P1a30=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/extensions/-/extensions-2.0.6.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 @@ -7686,7 +7692,7 @@ packages: engines: {node: '>=18.12.0'} '@yarnpkg/libui@3.1.0': - resolution: {integrity: sha512-3R5juEPlnokseN+m19vh8pGmLOdWiU+q5oRLSJDGzpezKiGKiF7R2cZpOJi3A3tal/EFezmPwuHu00YWzfU4Bg==} + resolution: {integrity: sha1-B/7NVUqmbf18DMdjkTV1eTucHvI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/libui/-/libui-3.1.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: ink: ^3.0.8 @@ -7707,35 +7713,35 @@ packages: engines: {node: '>=18.12.0'} '@yarnpkg/plugin-catalog@1.0.2': - resolution: {integrity: sha512-Oz4pOtcAzU9pQHCMhHll3Supr5wOKhNubV0S1hXVbkevro5ZAqf9/L3XlhSMJAvi+9neXoNFwk12j69qTUHPSg==} + resolution: {integrity: sha1-sfydPw1zih1ptfmFs570f+p4zzI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-catalog/-/plugin-catalog-1.0.2.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.5.0 '@yarnpkg/plugin-pack': ^4.0.4 '@yarnpkg/plugin-compat@4.0.12': - resolution: {integrity: sha512-c8yEzdKSWcjWUc/lAJ08MI1EmpV4RgJYfd4yEs9iMeuwiF7v0hQPIOsXG75r7O2hzeTXqWB32aXSQU+tt1CV5Q==} + resolution: {integrity: sha1-pGARGVfIi9wKb2vxh7bvpfkcWDU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-compat/-/plugin-compat-4.0.12.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-patch': ^4.0.3 '@yarnpkg/plugin-constraints@4.0.5': - resolution: {integrity: sha512-36i2sOYHkINIMvY2fuDFi37jgzfRD+Qk1blUK1FIo9uET/cSXi0QNLW9ZfyBBwIaKC/NAIkx2oLI6YtaqcT+9w==} + resolution: {integrity: sha1-yNyWdZB2o0/wxAA3nVzDh4QKxt4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-constraints/-/plugin-constraints-4.0.5.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.3 '@yarnpkg/core': ^4.4.3 '@yarnpkg/plugin-dlx@4.0.2': - resolution: {integrity: sha512-d6bAh54j74xbVyOZQ72Hf4ggsW4SmUayzhUeutJNZyc4CkLrqMXSIfkmnWk4BXnjwXsdDAdmqRZpPlKw8Rgb+Q==} + resolution: {integrity: sha1-tVnZCvwX47h9EWVstCgHMgihzyk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-dlx/-/plugin-dlx-4.0.2.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.2 '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-essentials@4.6.1': - resolution: {integrity: sha512-18oGqcA7aWM95B5aXbJhXa1cDi52lBpwY7ZGs9sb8D1XpoadmZEwTg98xASmeYTtrboYHCsobMhFQiZq/iK1dA==} + resolution: {integrity: sha1-skISwTcZxnGXjYFUR1ztFh4qDFM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-essentials/-/plugin-essentials-4.6.1.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.17.0 @@ -7743,45 +7749,45 @@ packages: '@yarnpkg/plugin-git': ^3.2.0 '@yarnpkg/plugin-exec@3.1.0': - resolution: {integrity: sha512-c0PInm8BbyNwGorVJPZyvt2L03OsccLdtmuwtl4sCxSYQjrJ3fwKVhOstL9KaxpUBQ+I9tVzoJzzpe8SzySZ0A==} + resolution: {integrity: sha1-EQZYc8qXNf2CsspYOtn0mWhDaqU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-exec/-/plugin-exec-3.1.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.7.0 '@yarnpkg/plugin-file@3.0.2': - resolution: {integrity: sha512-sL47+nbBs5yC2MQS8ihKm1PzeVLPuZihWQRw0UCu1+2H5qgHV8hA/4kCvMSx98amksq4UjP8ybeBFrRvsdhAHA==} + resolution: {integrity: sha1-08zADstYTIcE3FxmGTejziOiKjU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-file/-/plugin-file-3.0.2.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-git@3.2.0': - resolution: {integrity: sha512-i/+3fJ7UYqAwmnfKYEc6Yrs9Y2mDVeCIWGXSpyQSZXokDYG0+YSf0ZSqlij4sFs5zSEOCkY0pK3wj6d4NcvhkQ==} + resolution: {integrity: sha1-wuAHvEfeG8B9r4qh1O3nc1XXUTU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-git/-/plugin-git-3.2.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.7.0 '@yarnpkg/plugin-github@3.0.2': - resolution: {integrity: sha512-NHEaxJkzBC59Z97I30fleJlm6jE7CVY7cXaDD+kYwzIp/qKCb7IaJBp3MqUhCRyvyerNYRf08nIO+PXJ9odMtg==} + resolution: {integrity: sha1-1LxamAaYaqys6ZOdwYPfG+LdcuQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-github/-/plugin-github-3.0.2.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-git': ^3.1.2 '@yarnpkg/plugin-http@3.0.3': - resolution: {integrity: sha512-IWPKbm34ZAQZO9JO6mmyRJwLofhbrzXd8LJ3kJ943IRgyKN1kCMuPbGNaL1XQqdXlSuxlxwf0UJM2iNjmkcEcQ==} + resolution: {integrity: sha1-ioTHkMiBd68sCoB0yceDCgpQixA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-http/-/plugin-http-3.0.3.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-init@4.1.2': - resolution: {integrity: sha512-xh1ll6o9h02L4uTAveIxqgfXZ71Qr1PoFaqT372zxPwyPyZxVVUxZFcIVzAqolQ6G4Ech2ygMAT6wqtpyS7R7Q==} + resolution: {integrity: sha1-Qd29EIGUt0rvs5mQ3z2m2TrXf2U=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-init/-/plugin-init-4.1.2.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.2 '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-interactive-tools@4.1.0': - resolution: {integrity: sha512-C/gIsjj+q7ekx5KyEBSQyydTGWggVenaw2gIpbkGKi56Gd9p3HfNdH5/Gp8aa93QZA+DEzy1t25ssxgX4+U6bg==} + resolution: {integrity: sha1-nmjtWCQnUX1IHmvFHGqxKh0CWSk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-interactive-tools/-/plugin-interactive-tools-4.1.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.13.0 @@ -7789,13 +7795,13 @@ packages: '@yarnpkg/plugin-essentials': ^4.4.5 '@yarnpkg/plugin-jsr@1.1.1': - resolution: {integrity: sha512-aukUcLl6FiOg04GXagVfT7wtkl7/qQlRQmECHyk+r5mt+gBWQX8H8lE4Nxmy0t3J4DX/aW5BTFRifTlQkF8nNQ==} + resolution: {integrity: sha1-man6uEC9j3l2sQ0RTzKE4YEl4kQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-jsr/-/plugin-jsr-1.1.1.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-link@3.0.2': - resolution: {integrity: sha512-cKRinNuxbNhEJLRWCDc0T1VkXqdOXhjakjcClaoCwyCrZnX+CQdK8bbYEhWzTVKPZIqffdMHd9/rIljGbBwcew==} + resolution: {integrity: sha1-nYat2D1IFw0U86wJIZUU6TzMSWc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-link/-/plugin-link-3.0.2.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 @@ -7808,7 +7814,7 @@ packages: '@yarnpkg/core': ^4.9.0 '@yarnpkg/plugin-npm-cli@4.5.0': - resolution: {integrity: sha512-mzREwl06NeTZL5Zvf4VBGzfxPAhY3Y8UUBdR4Ob5tAxSvc0rEDXXCcO35LQ2TA6655L5n1fjlkQZGPyiiic+og==} + resolution: {integrity: sha1-mSji8kPkfm5p8ByzLlta0/+X6YU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-npm-cli/-/plugin-npm-cli-4.5.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.16.0 @@ -7824,14 +7830,14 @@ packages: '@yarnpkg/plugin-pack': ^4.0.4 '@yarnpkg/plugin-pack@4.0.4': - resolution: {integrity: sha512-P+lLCMUsvAr8AXWzrgPYqUtZsBl7nhv7zM/x6jV06czyEcApRKWWJw42ekiFa6+xBlwU4ddvHZK4eWKYf27TIw==} + resolution: {integrity: sha1-SXIG9izYMXJblN+z6AUCBS5pIwE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-pack/-/plugin-pack-4.0.4.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.10.1 '@yarnpkg/core': ^4.4.4 '@yarnpkg/plugin-patch@4.0.4': - resolution: {integrity: sha512-kUh3A21WpiEG7dmKJ2/BF7AmCt2loTHLfkhng0MPFqg7JDyL35jT3POjtCEgDa/WA1c6u077GLp2GSI/zgdtIQ==} + resolution: {integrity: sha1-Y6KhgRfNEpN7jGElE8RNzblt1vI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-patch/-/plugin-patch-4.0.4.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.15.0 @@ -7845,7 +7851,7 @@ packages: '@yarnpkg/core': ^4.9.0 '@yarnpkg/plugin-pnpm@2.3.0': - resolution: {integrity: sha512-vCl7Pca9wXDQC5kUxhxAvIJn63MMOkhkr+XHtBwMshbyQBMMkH9yfjeuZ89K+rbEO9rWnvTgoP8z+7DXfjN3oA==} + resolution: {integrity: sha1-WCIRlulusKrsIemY6bJZgDrMNbA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-pnpm/-/plugin-pnpm-2.3.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.17.0 @@ -7859,7 +7865,7 @@ packages: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-typescript@4.1.3': - resolution: {integrity: sha512-szgbkWvtCm7pw9IUFNTeM5bgU5XLayDZFln0iPwGcWtfxXcGGpDcxGqDxnSMdHhrojSTtItb502xw8DVJRywJw==} + resolution: {integrity: sha1-SOQHCf/WuKffNrIfu+jw6kJL5RU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-typescript/-/plugin-typescript-4.1.3.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.2 @@ -7867,7 +7873,7 @@ packages: '@yarnpkg/plugin-essentials': ^4.4.1 '@yarnpkg/plugin-version@4.2.0': - resolution: {integrity: sha512-vE4NTsoe7lmmECrrqSF1/WkwYpYbAF4JbZY7cCqHVwIfvDHGpX3Y1cla+8FwGcvCU2XEKvSi55iMk59h9NN6fg==} + resolution: {integrity: sha1-BlIydkIRYEFxPmQyC55jbLzLg7M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-version/-/plugin-version-4.2.0.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.4 @@ -7875,7 +7881,7 @@ packages: '@yarnpkg/plugin-git': ^3.1.3 '@yarnpkg/plugin-workspace-tools@4.1.7': - resolution: {integrity: sha512-uVf0+73H6BPmSOVdB/9ueBiyKQy4Li1ztVLIrdGc9ogQW+KOOjQDiWZKNRosKwL/70hKxAt534K6EqQtjSpuqA==} + resolution: {integrity: sha1-5LPmjQQqdFwWBZLzbUdpdnHDukQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-workspace-tools/-/plugin-workspace-tools-4.1.7.tgz} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.13.0 @@ -7897,7 +7903,7 @@ packages: hasBin: true '@zkochan/boxen@5.1.2': - resolution: {integrity: sha512-MRUN24GOMTa14zkZ4Jd1BPmlagbk10+C6gegE5FgxzTVqiYMcm3KD+2qJs6OmlpEhqUKmm4pu/oTdn0KcMqbXg==} + resolution: {integrity: sha1-pPIZGyPcYrcQZqJhMBQeDypZVu4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@zkochan/boxen/-/boxen-5.1.2.tgz} engines: {node: '>=10'} '@zkochan/cmd-shim@5.4.1': @@ -7920,7 +7926,7 @@ packages: engines: {node: '>=18.12'} '@zkochan/which@2.0.3': - resolution: {integrity: sha512-C1ReN7vt2/2O0fyTsx5xnbQuxBrmG5NMSbcIkPKCCfCTJgpZBsuRYzFXHj3nVq8vTfK7vxHUmzfCpSHgO7j4rg==} + resolution: {integrity: sha1-okOQNZOQ04wVH6YHgbNiC8WhMtA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@zkochan/which/-/which-2.0.3.tgz} engines: {node: '>= 8'} hasBin: true @@ -7990,7 +7996,7 @@ packages: optional: true ajv@6.15.0: - resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + resolution: {integrity: sha1-B+mCx0YmFnqnoklcU4F4ktcTlJI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ajv/-/ajv-6.15.0.tgz} ajv@8.18.0: resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} @@ -7999,14 +8005,14 @@ packages: resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} algoliasearch@4.27.0: - resolution: {integrity: sha512-C88C5grLa5VOCp9eYZJt+q99ik7yNdm92l7Q9+4XK0Md8kL05Lg8l2v9ZVX0uMW3mH9pAFxMMXlLOvqNumA4lw==} + resolution: {integrity: sha1-zE/P+3kBPdFLGC9jshgtWasesFA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/algoliasearch/-/algoliasearch-4.27.0.tgz} am-i-vibing@0.3.0: resolution: {integrity: sha512-JTg9e3qPmVP6x8PG9/J4+eCVP6sGx9oS1pSbgf7fpPVlkHzQdRPSNMb6dBlp9BrdBNxDkctMzehPVYSnt16k4w==} hasBin: true ansi-align@3.0.1: - resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + resolution: {integrity: sha1-DN8S4RGs53OobpofrRIlxDyxmlk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ansi-align/-/ansi-align-3.0.1.tgz} ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} @@ -8016,7 +8022,7 @@ packages: resolution: {integrity: sha512-BIXwHKpjzghBjcwEV10Y4b17tjHfK4nhEqK3LqyQ3JgcMcjmi3DIevozNgrOpfvBMmrq9dfvrPJSu5/5vNUBQg==} ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + resolution: {integrity: sha1-ayKR0dt9mLZSHV8e+kLQ86n+tl4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ansi-escapes/-/ansi-escapes-4.3.2.tgz} engines: {node: '>=8'} ansi-escapes@7.3.0: @@ -8144,7 +8150,7 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} auto-bind@4.0.0: - resolution: {integrity: sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==} + resolution: {integrity: sha1-41ifxsLaj3ykO6n4T6UqdE/Jl/s=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/auto-bind/-/auto-bind-4.0.0.tgz} engines: {node: '>=8'} axobject-query@4.1.0: @@ -8186,7 +8192,7 @@ packages: optional: true bare-fs@4.7.2: - resolution: {integrity: sha512-aTvMFUWkBmjzKtEQMDGGDNF8bkfpD5N1b/FCwt7A3wrU4t1o/e/85Wzkluh6JlODCjqVESYCkQCdTXqZ9G7VFg==} + resolution: {integrity: sha1-D1mzF+W9vsahSJtRmgaiA80/4DU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bare-fs/-/bare-fs-4.7.2.tgz} engines: {bare: '>=1.16.0'} peerDependencies: bare-buffer: '*' @@ -8199,7 +8205,7 @@ packages: engines: {bare: '>=1.14.0'} bare-path@3.0.1: - resolution: {integrity: sha512-ghj2DSK/2e99a1anTVPCV4m4YIYtrbXhfM7V3D7XZLOTsybnYyaJloymGqssQc8l/or0UoDyRtNQkmkEF/ysgQ==} + resolution: {integrity: sha1-wSyBtSeTa2UOh8XQAmTVnvRYCCw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bare-path/-/bare-path-3.0.1.tgz} bare-stream@2.13.3: resolution: {integrity: sha512-Kc+brLqvEqGkjyfiwJmImAOqLZL7OsoLKuavx+hJjgVV3nLTOjloJyPMFxjUPerGGHrNH0fLU06jjykMLWrERQ==} @@ -8259,7 +8265,7 @@ packages: engines: {node: '>=18'} bole@5.0.29: - resolution: {integrity: sha512-eYR9i2ubLv5/4TFGyZsQ1cVH4jF9+qLJA72Aow+E7ZZQfqHqQNUZeX3w+pVWF76PQyjl5eDKf2xylyOOX76ozA==} + resolution: {integrity: sha1-W+filLqotowCf0h0qqEEpyD68Aw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bole/-/bole-5.0.29.tgz} boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -8406,7 +8412,7 @@ packages: engines: {node: '>=4'} chalk@3.0.0: - resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} + resolution: {integrity: sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/chalk/-/chalk-3.0.0.tgz} engines: {node: '>=8'} chalk@4.1.2: @@ -8466,7 +8472,7 @@ packages: engines: {node: '>=18'} ci-info@2.0.0: - resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} + resolution: {integrity: sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ci-info/-/ci-info-2.0.0.tgz} ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} @@ -8481,7 +8487,7 @@ packages: engines: {node: '>=6'} cli-boxes@2.2.1: - resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} + resolution: {integrity: sha1-3dUDXSUJT84iDpyrQKRYQKRAMY8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/cli-boxes/-/cli-boxes-2.2.1.tgz} engines: {node: '>=6'} cli-columns@4.0.0: @@ -8489,7 +8495,7 @@ packages: engines: {node: '>= 10'} cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + resolution: {integrity: sha1-JkMFp65JDR0Dvwybp8kl0XU68wc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/cli-cursor/-/cli-cursor-3.1.0.tgz} engines: {node: '>=8'} cli-cursor@5.0.0: @@ -8557,7 +8563,7 @@ packages: engines: {node: '>=16'} code-excerpt@3.0.0: - resolution: {integrity: sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw==} + resolution: {integrity: sha1-/PtnSMA9uoQxwZ9UdHR/rT8lDxA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/code-excerpt/-/code-excerpt-3.0.0.tgz} engines: {node: '>=10'} collapse-white-space@2.1.0: @@ -8670,7 +8676,7 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} convert-to-spaces@1.0.2: - resolution: {integrity: sha512-cj09EBuObp9gZNQCzc7hByQyrs6jVGE+o9kSJmeUoj+GiPiJvi5LYqEH/Hmme4+MTLHM+Ejtq+FChpjjEnsPdQ==} + resolution: {integrity: sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz} engines: {node: '>= 4'} cookie-es@1.2.3: @@ -8959,7 +8965,7 @@ packages: resolution: {integrity: sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==} data-uri-to-buffer@3.0.1: - resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} + resolution: {integrity: sha1-WUuJc5OMW8LDMEZTV4U0GrxPNjY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz} engines: {node: '>= 6'} data-urls@5.0.0: @@ -9023,7 +9029,7 @@ packages: engines: {node: '>=4.0.0'} deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + resolution: {integrity: sha1-pvLc5hL63S7x9Rm3NVHxfoUZmDE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/deep-is/-/deep-is-0.1.4.tgz} default-browser-id@5.0.1: resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} @@ -9220,7 +9226,7 @@ packages: resolution: {integrity: sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==} encoding@0.1.13: - resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + resolution: {integrity: sha1-VldK/deR9UqOmyeFwFgqLSYhD6k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/encoding/-/encoding-0.1.13.tgz} end-of-stream@1.4.5: resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} @@ -9313,7 +9319,7 @@ packages: engines: {node: '>=0.8.0'} escape-string-regexp@2.0.0: - resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + resolution: {integrity: sha1-owME6Z2qMuI7L9IPUbq9B8/8o0Q=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz} engines: {node: '>=8'} escape-string-regexp@4.0.0: @@ -9329,19 +9335,19 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} eslint-scope@9.1.2: - resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + resolution: {integrity: sha1-ud5qzi+rHP8k0uWNhbdMj86jmAI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint-scope/-/eslint-scope-9.1.2.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + resolution: {integrity: sha1-DNcv6FUOPC6uFWqWpN3c0cisWAA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} eslint-visitor-keys@5.0.1: - resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} + resolution: {integrity: sha1-njyUiWl4JNLUzjqK0SYo+R6fWb4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint@10.5.0: - resolution: {integrity: sha512-1y+7C+vi12bUK1IpZeaV3gsH9fHLBmPvYmPx42pvT/E9yG0IC8g3PUZZgp0+JLJl7ZDK0flc2gc+Aw9dpCvIsQ==} + resolution: {integrity: sha1-X8pp1rQf5+ALoi1BALLkTv5DmtU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint/-/eslint-10.5.0.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} hasBin: true peerDependencies: @@ -9351,7 +9357,7 @@ packages: optional: true espree@11.2.0: - resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + resolution: {integrity: sha1-AdXkfcMyqrowWQCDYkVKjMNMyqU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/espree/-/espree-11.2.0.tgz} engines: {node: ^20.19.0 || ^22.13.0 || >=24} esprima@4.0.1: @@ -9360,15 +9366,15 @@ packages: hasBin: true esquery@1.7.0: - resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} + resolution: {integrity: sha1-CNBI8mHw3e21uulfRoCUY9nJSW0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/esquery/-/esquery-1.7.0.tgz} engines: {node: '>=0.10'} esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + resolution: {integrity: sha1-eteWTWeauyi+5yzsY3WLHF0smSE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/esrecurse/-/esrecurse-4.3.0.tgz} engines: {node: '>=4.0'} estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + resolution: {integrity: sha1-LupSkHAvJquP5TcDcP+GyWXSESM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/estraverse/-/estraverse-5.3.0.tgz} engines: {node: '>=4.0'} estree-util-attach-comments@3.0.0: @@ -9421,7 +9427,7 @@ packages: engines: {node: '>=0.8.x'} execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + resolution: {integrity: sha1-+ArZy/Qpj3vR1MlVXCHpN0HEEd0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/execa/-/execa-5.1.1.tgz} engines: {node: '>=10'} execa@9.6.1: @@ -9474,10 +9480,10 @@ packages: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + resolution: {integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz} fast-safe-stringify@2.1.1: - resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + resolution: {integrity: sha1-xAaoO25w2eNc47MKgRQd8wrrqIQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz} fast-string-truncated-width@3.0.3: resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} @@ -9511,7 +9517,7 @@ packages: optional: true fetch-blob@2.1.2: - resolution: {integrity: sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow==} + resolution: {integrity: sha1-p4BdsTYb1Ewe9iu1f7X+jqFz7zw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fetch-blob/-/fetch-blob-2.1.2.tgz} engines: {node: ^10.17.0 || >=12.3.0} peerDependencies: domexception: '*' @@ -9527,7 +9533,7 @@ packages: engines: {node: '>=18'} file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + resolution: {integrity: sha1-d4e93PETG/+5JjbGlFe7wO3W2B8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/file-entry-cache/-/file-entry-cache-8.0.0.tgz} engines: {node: '>=16.0.0'} fill-range@7.1.1: @@ -9562,7 +9568,7 @@ packages: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + resolution: {integrity: sha1-Ds45/LFO4BL0sEEL0z3ZwfAREnw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/flat-cache/-/flat-cache-4.0.1.tgz} engines: {node: '>=16'} flatted@3.4.2: @@ -9626,12 +9632,12 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + resolution: {integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fsevents/-/fsevents-2.3.2.tgz} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + resolution: {integrity: sha1-ysZAd4XQNnWipeGlMFxpezR9kNY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fsevents/-/fsevents-2.3.3.tgz} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -9674,7 +9680,7 @@ packages: engines: {node: '>=8'} get-stream@6.0.1: - resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + resolution: {integrity: sha1-omLY7vZ6ztV8KFKtYWdSakPL97c=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/get-stream/-/get-stream-6.0.1.tgz} engines: {node: '>=10'} get-stream@9.0.1: @@ -9686,10 +9692,10 @@ packages: engines: {node: '>=20.20.0'} git-up@7.0.0: - resolution: {integrity: sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==} + resolution: {integrity: sha1-us4weG429W6jQbb2mt/YMoYzdGc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/git-up/-/git-up-7.0.0.tgz} git-url-parse@13.1.1: - resolution: {integrity: sha512-PCFJyeSSdtnbfhSNRw9Wk96dDCNx+sogTe4YNXeXSJxt7xz5hvXekuRn9JX7m+Mf4OscCu8h+mtAl3+h5Fo8lQ==} + resolution: {integrity: sha1-Zkvd8IV8anWzwfCuYjmrsIoUhtQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/git-url-parse/-/git-url-parse-13.1.1.tgz} github-from-package@0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} @@ -9702,7 +9708,7 @@ packages: engines: {node: '>= 6'} glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + resolution: {integrity: sha1-bSN9mQg5UMeSkPJMdkKj3poo+eM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/glob-parent/-/glob-parent-6.0.2.tgz} engines: {node: '>=10.13.0'} glob@10.5.0: @@ -9728,7 +9734,7 @@ packages: engines: {node: '>=20'} globalyzer@0.1.0: - resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} + resolution: {integrity: sha1-y3baeVVWaaFRnVqO3wk6+qC/FGU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/globalyzer/-/globalyzer-0.1.0.tgz} globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} @@ -9743,7 +9749,7 @@ packages: engines: {node: '>=20'} globrex@0.1.2: - resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + resolution: {integrity: sha1-3V2eyCYjJzDNZ5Ol4zqTApheYJg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/globrex/-/globrex-0.1.2.tgz} gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} @@ -9962,7 +9968,7 @@ packages: engines: {node: '>= 14'} human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + resolution: {integrity: sha1-3JH8ukLk0G5Kuu0zs+ejwC9RTqA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/human-signals/-/human-signals-2.1.0.tgz} engines: {node: '>=10.17.0'} human-signals@8.0.1: @@ -10034,7 +10040,7 @@ packages: engines: {node: '>=18'} individual@3.0.0: - resolution: {integrity: sha512-rUY5vtT748NMRbEMrTNiFfy29BgGZwGXUi2NFUVMWQrogSLzlJvQV9eeMWi+g1aVaQ53tpyLAQtd5x/JH0Nh1g==} + resolution: {integrity: sha1-58pPhfiVewGHNPKFdQ3CLsL5hi0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/individual/-/individual-3.0.0.tgz} inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} @@ -10058,14 +10064,14 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} ink-text-input@4.0.3: - resolution: {integrity: sha512-eQD01ik9ltmNoHmkeQ2t8LszYkv2XwuPSUz3ie/85qer6Ll/j0QSlSaLNl6ENHZakBHdCBVZY04iOXcLLXA0PQ==} + resolution: {integrity: sha1-Y0j++ULnSwakZfmIUXBlFqHivo0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ink-text-input/-/ink-text-input-4.0.3.tgz} engines: {node: '>=10'} peerDependencies: ink: ^3.0.0-3 react: ^16.5.2 || ^17.0.0 ink@3.2.0: - resolution: {integrity: sha512-firNp1q3xxTzoItj/eOOSZQnYSlyrWks5llCTVX37nJ59K3eXbQ8PtzCguqo8YI19EELo5QxaKnJd4VxzhU8tg==} + resolution: {integrity: sha1-Q0eTYw3FfWEcj+j/+h22tW8aFrs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ink/-/ink-3.2.0.tgz} engines: {node: '>=10'} peerDependencies: '@types/react': '>=16.8.0' @@ -10109,7 +10115,7 @@ packages: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} is-ci@2.0.0: - resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} + resolution: {integrity: sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/is-ci/-/is-ci-2.0.0.tgz} hasBin: true is-core-module@2.16.2: @@ -10211,7 +10217,7 @@ packages: engines: {node: '>=20'} is-ssh@1.4.1: - resolution: {integrity: sha512-JNeu1wQsHjyHgn9NcWTaXq6zWSR6hqE0++zhfZlkFBbScNkyvxCdeV8sRkSBaeLKxmbpR21brail63ACNxJ0Tg==} + resolution: {integrity: sha1-dt4c2+j5KouQXRoXK2vAlwTCA5Y=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/is-ssh/-/is-ssh-1.4.1.tgz} is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} @@ -10251,7 +10257,7 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} isexe@3.1.5: - resolution: {integrity: sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==} + resolution: {integrity: sha1-QuNo9o1eENrf7k/ae1ULwtiJLck=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/isexe/-/isexe-3.1.5.tgz} engines: {node: '>=18'} isexe@4.0.0: @@ -10332,13 +10338,13 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + resolution: {integrity: sha1-afaofZUTq4u4/mO9sJecRI5oRmA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz} json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz} json-with-bigint@3.5.8: resolution: {integrity: sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw==} @@ -10390,7 +10396,7 @@ packages: engines: {node: '>= 0.6'} keytar@7.9.0: - resolution: {integrity: sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==} + resolution: {integrity: sha1-TGIlcI9RtQy/d8Wq6BchlkwpGMs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/keytar/-/keytar-7.9.0.tgz} keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -10454,78 +10460,78 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + resolution: {integrity: sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/levn/-/levn-0.4.1.tgz} engines: {node: '>= 0.8.0'} lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} lightningcss-android-arm64@1.32.0: - resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + resolution: {integrity: sha1-8DOIURbf79nG9UeHUj41FLYeGWg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [android] lightningcss-darwin-arm64@1.32.0: - resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + resolution: {integrity: sha1-ULcYcbAcgZlYS2SeKSVH+up6+bU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] lightningcss-darwin-x64@1.32.0: - resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + resolution: {integrity: sha1-NfPpczLRMLnKGB4RtWje1q68bV4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] lightningcss-freebsd-x64@1.32.0: - resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + resolution: {integrity: sha1-l3enZHK2Ttb/lDQq1kx7r9eUpXU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] lightningcss-linux-arm-gnueabihf@1.32.0: - resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + resolution: {integrity: sha1-E65lLhq3O5E117faFy9mbEEK1T0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] lightningcss-linux-arm64-gnu@1.32.0: - resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + resolution: {integrity: sha1-QXhYeVqUWS9oASOhsfnaig4e8zU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: - resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + resolution: {integrity: sha1-a+NmkugQtxgECAL9gJYjz/5zITM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] libc: [musl] lightningcss-linux-x64-gnu@1.32.0: - resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + resolution: {integrity: sha1-C3gDr06yHP043Tn+Kru1PH3QkfY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] libc: [glibc] lightningcss-linux-x64-musl@1.32.0: - resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + resolution: {integrity: sha1-iNyLqGXd3bGsXvBLDxYYBEGMFjs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: - resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + resolution: {integrity: sha1-TzC6P6XpJfW3n5RejMDRdsOxqzg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] lightningcss-win32-x64-msvc@1.32.0: - resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + resolution: {integrity: sha1-FBqlYFZFBkkokCu0rwRfp9n0Igo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] @@ -10615,7 +10621,7 @@ packages: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + resolution: {integrity: sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/loose-envify/-/loose-envify-1.4.0.tgz} hasBin: true loupe@3.2.1: @@ -10801,7 +10807,7 @@ packages: engines: {node: '>=18'} merge-stream@2.0.0: - resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + resolution: {integrity: sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/merge-stream/-/merge-stream-2.0.0.tgz} merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -10952,7 +10958,7 @@ packages: hasBin: true mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + resolution: {integrity: sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/mimic-fn/-/mimic-fn-2.1.0.tgz} engines: {node: '>=6'} mimic-fn@3.1.0: @@ -11094,7 +11100,7 @@ packages: resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/natural-compare/-/natural-compare-1.4.0.tgz} negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} @@ -11162,7 +11168,7 @@ packages: engines: {node: '>=20'} node-watch@0.7.3: - resolution: {integrity: sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==} + resolution: {integrity: sha1-bU24jjnI0J0+ph1laNgOWXWrx6s=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/node-watch/-/node-watch-0.7.3.tgz} engines: {node: '>=6'} nopt@1.0.10: @@ -11244,7 +11250,7 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + resolution: {integrity: sha1-t+zR5e1T2o43pV4cImnguX7XSOo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/npm-run-path/-/npm-run-path-4.0.1.tgz} engines: {node: '>=8'} npm-run-path@6.0.0: @@ -11261,7 +11267,7 @@ packages: resolution: {integrity: sha512-7YRhZ3jS45LwmSCT4b2sVFHt/WuovaktDU07QrtOBY2PXskss5a9jfmR9jptyumwXST+rFjrmppMY1KT/yn35A==} object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/object-assign/-/object-assign-4.1.1.tgz} engines: {node: '>=0.10.0'} object-inspect@1.13.4: @@ -11294,7 +11300,7 @@ packages: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} onetime@5.1.2: - resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + resolution: {integrity: sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/onetime/-/onetime-5.1.2.tgz} engines: {node: '>=6'} onetime@7.0.0: @@ -11316,7 +11322,7 @@ packages: engines: {node: '>=20'} optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} + resolution: {integrity: sha1-fqHBpdkddk+yghOciP4R4YKjpzQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/optionator/-/optionator-0.9.4.tgz} engines: {node: '>= 0.8.0'} ora@8.2.0: @@ -11487,13 +11493,13 @@ packages: engines: {node: '>=18.12'} parse-path@7.1.0: - resolution: {integrity: sha512-EuCycjZtfPcjWk7KTksnJ5xPMvWGA/6i4zrLYhRG0hGvC3GPU/jGUj3Cy+ZR0v30duV3e23R95T1lE2+lsndSw==} + resolution: {integrity: sha1-QftRPLEigxgHpMeynIcnlHoJ2MY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/parse-path/-/parse-path-7.1.0.tgz} parse-semver@1.1.1: resolution: {integrity: sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==} parse-url@8.1.0: - resolution: {integrity: sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==} + resolution: {integrity: sha1-ly4IJ+1LV/yF8OprDYOfDYpXpX0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/parse-url/-/parse-url-8.1.0.tgz} parse5-htmlparser2-tree-adapter@7.1.0: resolution: {integrity: sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==} @@ -11512,7 +11518,7 @@ packages: engines: {node: '>= 0.8'} patch-console@1.0.0: - resolution: {integrity: sha512-nxl9nrnLQmh64iTzMfyylSlRozL7kAXIaxw1fVcLYdyhNkJCRUzirRZTikXGJsg+hc4fqpneTK6iU2H1Q8THSA==} + resolution: {integrity: sha1-GbnwKHE/64o8AjcCqMyMufdGb50=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/patch-console/-/patch-console-1.0.0.tgz} engines: {node: '>=10'} path-absolute@1.0.1: @@ -11695,7 +11701,7 @@ packages: engines: {node: '>=10'} prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + resolution: {integrity: sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/prelude-ls/-/prelude-ls-1.2.1.tgz} engines: {node: '>= 0.8.0'} prettier-plugin-astro@0.14.1: @@ -11802,7 +11808,7 @@ packages: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} protocols@2.0.2: - resolution: {integrity: sha512-hHVTzba3wboROl0/aWRRG9dMytgH6ow//STBZh43l/wQgmMhYhOFi0EHWAPtoCz9IAUymsyP0TSBHkhgMEGNnQ==} + resolution: {integrity: sha1-gi6Pzcs99TVlOLPpG/2JCwZ/0KQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/protocols/-/protocols-2.0.2.tgz} proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} @@ -11844,7 +11850,7 @@ packages: engines: {node: '>=10'} qunit@2.26.0: - resolution: {integrity: sha512-KSv16YomcYmiK90qTOJl3Bm5IvTf2upqQDdBQWCvSQWe94FWobnUgKOpvpvZdG7VkDt3TJSI8k8g9+GGGEd7Fw==} + resolution: {integrity: sha1-G7UZ8MaZPy5AR0uPtWQSb6CL604=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/qunit/-/qunit-2.26.0.tgz} engines: {node: '>=10'} hasBin: true @@ -11867,7 +11873,7 @@ packages: hasBin: true react-devtools-core@4.28.5: - resolution: {integrity: sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==} + resolution: {integrity: sha1-yEQrkfBozfDImcVDkH9/J9ecJQg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react-devtools-core/-/react-devtools-core-4.28.5.tgz} react-docgen-typescript@2.4.0: resolution: {integrity: sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg==} @@ -11904,7 +11910,7 @@ packages: react: '>=18' react-reconciler@0.26.2: - resolution: {integrity: sha512-nK6kgY28HwrMNwDnMui3dvm3rCFjZrcGiuwLc5COUipBK5hWHLOxMJhSnSomirqWwjPBJKV1QcbkI0VJr7Gl1Q==} + resolution: {integrity: sha1-u60OLRMJQj92zzwzCaxsluBenZE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react-reconciler/-/react-reconciler-0.26.2.tgz} engines: {node: '>=0.10.0'} peerDependencies: react: ^17.0.2 @@ -11914,7 +11920,7 @@ packages: engines: {node: '>=0.10.0'} react@17.0.2: - resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==} + resolution: {integrity: sha1-0LXMUW0p6z7uOD91tihkz7aAADc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react/-/react-17.0.2.tgz} engines: {node: '>=0.10.0'} react@19.2.7: @@ -11961,7 +11967,7 @@ packages: engines: {node: '>= 20.19.0'} readline-sync@1.4.9: - resolution: {integrity: sha512-mp5h1N39kuKbCRGebLPIKTBOhuDw55GaNg5S+K9TW9uDAS1wIHpGUc2YokdUMZJb8GqS49sWmWEDijaESYh0Hg==} + resolution: {integrity: sha1-PtqOZfI80qF+YTAbHwADOWr17No=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/readline-sync/-/readline-sync-1.4.9.tgz} engines: {node: '>= 0.8.0'} realpath-missing@1.1.0: @@ -12103,7 +12109,7 @@ packages: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} + resolution: {integrity: sha1-OfZ8VLOnpYzqUjbZXPADQjljH34=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/restore-cursor/-/restore-cursor-3.1.0.tgz} engines: {node: '>=8'} restore-cursor@5.1.0: @@ -12171,7 +12177,7 @@ packages: optional: true rollup@4.62.2: - resolution: {integrity: sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==} + resolution: {integrity: sha1-2Q/Ey4EfBxMDyJC3eVlWNPNflUE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/rollup/-/rollup-4.62.2.tgz} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -12222,7 +12228,7 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} safe-execa@0.1.2: - resolution: {integrity: sha512-vdTshSQ2JsRCgT8eKZWNJIL26C6bVqy1SOmuCMlKHegVeo8KYRobRrefOdUq9OozSPUUiSxrylteeRmLOMFfWg==} + resolution: {integrity: sha1-L7sKbxoAx6RexwM/gmWXV/kb6Mc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/safe-execa/-/safe-execa-0.1.2.tgz} engines: {node: '>=12'} safe-execa@0.1.4: @@ -12250,7 +12256,7 @@ packages: engines: {node: '>=v12.22.7'} scheduler@0.20.2: - resolution: {integrity: sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==} + resolution: {integrity: sha1-S67jlDbjSqk7SHS93L8P6Li1DpE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/scheduler/-/scheduler-0.20.2.tgz} scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -12311,7 +12317,7 @@ packages: engines: {node: '>=8'} sharp@0.34.5: - resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} + resolution: {integrity: sha1-tvFI5LjGHxeXveEanRz+u64sV7A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/sharp/-/sharp-0.34.5.tgz} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} sharp@0.35.2: @@ -12464,7 +12470,7 @@ packages: resolution: {integrity: sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==} split2@4.2.0: - resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + resolution: {integrity: sha1-ycWSCQTRSLqwufZxRfJFqGqtv6Q=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/split2/-/split2-4.2.0.tgz} engines: {node: '>= 10.x'} sprintf-js@1.0.3: @@ -12483,7 +12489,7 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} stack-utils@2.0.6: - resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + resolution: {integrity: sha1-qvB0gWnAL8M8gjKrzPkz9Uocw08=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/stack-utils/-/stack-utils-2.0.6.tgz} engines: {node: '>=10'} stackback@0.0.2: @@ -12555,7 +12561,7 @@ packages: engines: {node: '>=8'} string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + resolution: {integrity: sha1-FPja7G2B5yIdKjV+Zoyrc728p5Q=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/string-width/-/string-width-5.1.2.tgz} engines: {node: '>=12'} string-width@7.2.0: @@ -12599,7 +12605,7 @@ packages: resolution: {integrity: sha512-zwF4bmnyEjZwRhaak9jUWNxc0DoeKBJ7lwSN/LEc8dQXZcUFG6auaaTQJokQWXopLdM3iTx01nQT8E4aL29DAQ==} strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + resolution: {integrity: sha1-ibhS+y/L6Tb29LMYevsKEsGrWK0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/strip-final-newline/-/strip-final-newline-2.0.0.tgz} engines: {node: '>=6'} strip-final-newline@4.0.0: @@ -12715,7 +12721,7 @@ packages: engines: {node: '>=18'} tau-prolog@0.2.81: - resolution: {integrity: sha512-cHSdGumv+GfRweqE3Okd81+ZH1Ux6PoJ+WPjzoAFVar0SRoUxW93vPvWTbnTtlz++IpSEQ0yUPWlLBcTMQ8uOg==} + resolution: {integrity: sha1-iYHeMY2HuOm9T6Rj8IZRrbyam+U=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/tau-prolog/-/tau-prolog-0.2.81.tgz} teex@1.0.1: resolution: {integrity: sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==} @@ -12763,7 +12769,7 @@ packages: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} tiny-glob@0.2.9: - resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} + resolution: {integrity: sha1-IhLUQawXkoAzsRD4s2QGgxKdMeI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/tiny-glob/-/tiny-glob-0.2.9.tgz} tiny-inflate@1.0.3: resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} @@ -12941,18 +12947,18 @@ packages: hasBin: true typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} + resolution: {integrity: sha1-p2apGBDOglgDOXVzPoNsQ6KSm5Q=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/typanion/-/typanion-3.14.0.tgz} type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + resolution: {integrity: sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-check/-/type-check-0.4.0.tgz} engines: {node: '>= 0.8.0'} type-fest@0.12.0: - resolution: {integrity: sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg==} + resolution: {integrity: sha1-9Xonq4HGjRNqUf1xRn7/lBV/oe4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.12.0.tgz} engines: {node: '>=10'} type-fest@0.15.1: - resolution: {integrity: sha512-n+UXrN8i5ioo7kqT/nF8xsEzLaqFra7k32SEsSPwvXVGyAcRgV/FUQN/sgfptJTR1oRmmq7z4IXMFSM7im7C9A==} + resolution: {integrity: sha1-0sTnPT5KU88akGOW3UYKHFF4ygA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.15.1.tgz} engines: {node: '>=10'} type-fest@0.16.0: @@ -12960,11 +12966,11 @@ packages: engines: {node: '>=10'} type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + resolution: {integrity: sha1-G/IH9LKPkVg2ZstfvTJ4hzAc1fQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.20.2.tgz} engines: {node: '>=10'} type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + resolution: {integrity: sha1-0mCiSwGYQ24TP6JqUkptZfo7Ljc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.21.3.tgz} engines: {node: '>=10'} type-fest@0.6.0: @@ -13251,7 +13257,7 @@ packages: browserslist: '>= 4.21.0' uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + resolution: {integrity: sha1-mxpSWVIlhZ5V9mnZKPiMbFfyp34=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/uri-js/-/uri-js-4.4.1.tgz} uri-template@2.0.0: resolution: {integrity: sha512-r/i44nPoo0ktEZDjx+hxp9PSjQuBBfsd6RgCRuuMqCP0FZEp+YE0SpihThI4UGc5ePqQEFsdyZc7UVlowp+LLw==} @@ -13628,12 +13634,12 @@ packages: hasBin: true which@4.0.0: - resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} + resolution: {integrity: sha1-zWC150UDo/vPv2zWtBOKi65kTBo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/which/-/which-4.0.0.tgz} engines: {node: ^16.13.0 || >=18.0.0} hasBin: true which@5.0.0: - resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==} + resolution: {integrity: sha1-2T8tk/eYNNQ2PH0MI+ANB8RmyNY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/which/-/which-5.0.0.tgz} engines: {node: ^18.17.0 || >=20.5.0} hasBin: true @@ -13653,11 +13659,11 @@ packages: hasBin: true widest-line@3.1.0: - resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} + resolution: {integrity: sha1-gpIzO79my0X/DeFgOxNreuFJbso=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/widest-line/-/widest-line-3.1.0.tgz} engines: {node: '>=8'} word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} + resolution: {integrity: sha1-0sRcbdT7zmIaZvE2y+Mor9BBCzQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/word-wrap/-/word-wrap-1.2.5.tgz} engines: {node: '>=0.10.0'} wordwrapjs@4.0.1: @@ -13668,7 +13674,7 @@ packages: resolution: {integrity: sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==} wrap-ansi@6.2.0: - resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + resolution: {integrity: sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/wrap-ansi/-/wrap-ansi-6.2.0.tgz} engines: {node: '>=8'} wrap-ansi@7.0.0: @@ -13676,7 +13682,7 @@ packages: engines: {node: '>=10'} wrap-ansi@8.1.0: - resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + resolution: {integrity: sha1-VtwiNo7lcPrOG0mBmXXZuaXq0hQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/wrap-ansi/-/wrap-ansi-8.1.0.tgz} engines: {node: '>=12'} wrap-ansi@9.0.2: @@ -13698,7 +13704,7 @@ packages: engines: {node: '>=16.14'} ws@7.5.11: - resolution: {integrity: sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==} + resolution: {integrity: sha1-lGDa8YEruBpCPFuerHRpQahjEPo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ws/-/ws-7.5.11.tgz} engines: {node: '>=8.3.0'} peerDependencies: bufferutil: ^4.0.1 @@ -13822,7 +13828,7 @@ packages: engines: {node: '>=18'} yoga-layout-prebuilt@1.10.0: - resolution: {integrity: sha512-YnOmtSbv4MTf7RGJMK0FvZ+KD8OEe/J5BNnR0GHhD8J/XcG/Qvxgszm0Un6FTHWW4uHlTgP0IztiXQnGyIR45g==} + resolution: {integrity: sha1-KTb7r0s2KO4LPjsd9Ek21sFG+qY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/yoga-layout-prebuilt/-/yoga-layout-prebuilt-1.10.0.tgz} engines: {node: '>=8'} zod@3.25.76: @@ -20108,7 +20114,7 @@ snapshots: algoliasearch: 4.27.0 clipanion: 4.0.0-rc.4(typanion@3.14.0) diff: 5.2.2 - ink: 3.2.0(@types/react@19.2.17)(react@19.2.7) + ink: 3.2.0(@types/react@19.2.17)(react@17.0.2) ink-text-input: 4.0.3(ink@3.2.0(@types/react@19.2.17)(react@17.0.2))(react@17.0.2) react: 17.0.2 semver: 7.8.5 @@ -20258,7 +20264,7 @@ snapshots: '@yarnpkg/plugin-git': 3.2.0(@yarnpkg/core@4.9.0(typanion@3.14.0))(typanion@3.14.0) clipanion: 4.0.0-rc.4(typanion@3.14.0) es-toolkit: 1.48.1 - ink: 3.2.0(@types/react@19.2.17)(react@17.0.2) + ink: 3.2.0(@types/react@19.2.17)(react@19.2.7) react: 17.0.2 semver: 7.8.5 tslib: 2.8.1 From 025142ff1a4d17fbaa5245162a23cd548577e631 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 13:36:29 -0400 Subject: [PATCH 032/249] refactor(compiler): introduce TemplateSource abstraction for tsp init (#11303) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extracts the self-contained `tsp init` template-loading refactor out of #11299 into its own PR. ## What Replaces `getExecutionRoot()`-based template resolution in `tsp init` with a first-class `TemplateSource` abstraction, with three implementations behind one interface: - **`FileSystemTemplateSource`** — the default (installed/`node`) path; reads `templates/` from the compiler package root. No `getExecutionRoot()` dependency. - **`InMemoryTemplateSource`** — serves the index and every template file from an in-memory map (used by the standalone single-executable to serve templates offline). - **`RemoteTemplateSource`** — `--templates-url`; keeps the untrusted-source confirmation and relative-file resolution. ## Why Template loading previously went through the `CompilerHost` filesystem contract anchored at `getExecutionRoot()`, which also serves the stdlib. Serving templates from an embedded/offline source required masquerading an in-memory map as a real filesystem and overloading `getExecutionRoot()`. This refactor decouples template resolution from the host FS contract so each context supplies its own source, and leaves `getExecutionRoot()` solely for the stdlib. ## Notes - No behavior change on the normal path: `init` defaults to `FileSystemTemplateSource`. - Language server (`getTypeSpecCoreTemplates` / `scaffoldNewProject`) and the VS Code extension keep working; the extension threads a `TemplateSource` through `create-tsp-project`. - Backward-compatible: `serverlib.ts` / `server/types.ts` are unchanged. - This is the first of a split of #11299; the standalone single-executable feature remains in #11299 and builds on top of this. --- .../init-template-source-2026-7-14-21-30-0.md | 7 ++ ...-source-loader-vscode-2026-7-18-14-55-0.md | 7 ++ packages/compiler/src/init/core-templates.ts | 12 +- packages/compiler/src/init/init.ts | 116 +++++++++--------- packages/compiler/src/init/scaffold.ts | 16 ++- .../template-source/default-core-templates.ts | 14 +++ .../in-memory-template-source.ts | 55 +++++++++ .../src/init/template-source/index.ts | 4 + .../src/init/template-source/types.ts | 22 ++++ .../template-source/uri-template-source.ts | 55 +++++++++ packages/compiler/src/internals/index.ts | 3 + packages/compiler/test/cli/init.test.ts | 73 ++++++----- .../compiler/test/e2e/init-templates.e2e.ts | 3 +- .../test/init/template-source.test.ts | 88 +++++++++++++ .../src/vscode-cmd/create-tsp-project.ts | 76 ++++-------- 15 files changed, 390 insertions(+), 161 deletions(-) create mode 100644 .chronus/changes/init-template-source-2026-7-14-21-30-0.md create mode 100644 .chronus/changes/reuse-template-source-loader-vscode-2026-7-18-14-55-0.md create mode 100644 packages/compiler/src/init/template-source/default-core-templates.ts create mode 100644 packages/compiler/src/init/template-source/in-memory-template-source.ts create mode 100644 packages/compiler/src/init/template-source/index.ts create mode 100644 packages/compiler/src/init/template-source/types.ts create mode 100644 packages/compiler/src/init/template-source/uri-template-source.ts create mode 100644 packages/compiler/test/init/template-source.test.ts diff --git a/.chronus/changes/init-template-source-2026-7-14-21-30-0.md b/.chronus/changes/init-template-source-2026-7-14-21-30-0.md new file mode 100644 index 00000000000..372a355607c --- /dev/null +++ b/.chronus/changes/init-template-source-2026-7-14-21-30-0.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/compiler" +--- + +Refactor `tsp init` template loading around a URI-based `TemplateSource` abstraction. A `UriTemplateSource` handles local and remote templates (paths and URLs), while built-in ("core") templates are addressed through an `internal:` scheme that resolves to an injectable provider. This lets alternative hosts (e.g. an offline single-executable compiler) serve bundled templates via an `InMemoryTemplateSource` without coupling template loading to the `CompilerHost` filesystem. diff --git a/.chronus/changes/reuse-template-source-loader-vscode-2026-7-18-14-55-0.md b/.chronus/changes/reuse-template-source-loader-vscode-2026-7-18-14-55-0.md new file mode 100644 index 00000000000..1ebe1e40453 --- /dev/null +++ b/.chronus/changes/reuse-template-source-loader-vscode-2026-7-18-14-55-0.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "typespec-vscode" +--- + +Reuse the compiler's `UriTemplateSource.loadIndex()` to load `tsp init` template indexes instead of the extension's own file/URL reading and JSON parsing, unifying how core and configured templates are loaded. diff --git a/packages/compiler/src/init/core-templates.ts b/packages/compiler/src/init/core-templates.ts index 8e9f3ab45cb..1aa30bc2df8 100644 --- a/packages/compiler/src/init/core-templates.ts +++ b/packages/compiler/src/init/core-templates.ts @@ -1,8 +1,6 @@ -import { CompilerPackageRoot } from "../core/node-host.js"; -import { resolvePath } from "../core/path-utils.js"; import type { SystemHost } from "../core/types.js"; +import { defaultInternalTemplateSource } from "./template-source/index.js"; -export const templatesDir = resolvePath(CompilerPackageRoot, "templates"); export interface LoadedCoreTemplates { readonly baseUri: string; readonly templates: Record; @@ -11,12 +9,8 @@ export interface LoadedCoreTemplates { let typeSpecCoreTemplates: LoadedCoreTemplates | undefined; export async function getTypeSpecCoreTemplates(host: SystemHost): Promise { if (typeSpecCoreTemplates === undefined) { - const file = await host.readFile(resolvePath(templatesDir, "scaffolding.json")); - const content = JSON.parse(file.text); - typeSpecCoreTemplates = { - baseUri: templatesDir, - templates: content, - }; + const { templates, baseUri } = await defaultInternalTemplateSource(host).loadIndex(); + typeSpecCoreTemplates = { baseUri, templates }; } return typeSpecCoreTemplates; } diff --git a/packages/compiler/src/init/init.ts b/packages/compiler/src/init/init.ts index a3d716838d7..27bc648d9fc 100644 --- a/packages/compiler/src/init/init.ts +++ b/packages/compiler/src/init/init.ts @@ -5,16 +5,20 @@ import * as semver from "semver"; import { CliCompilerHost } from "../core/cli/types.js"; import { parseCliArgsArgOption } from "../core/cli/utils.js"; import { createDiagnostic } from "../core/messages.js"; -import { getBaseFileName, getDirectoryPath } from "../core/path-utils.js"; -import { CompilerHost, Diagnostic, NoTarget, SourceFile } from "../core/types.js"; +import { getBaseFileName } from "../core/path-utils.js"; +import { Diagnostic, NoTarget } from "../core/types.js"; import { installTypeSpecDependencies } from "../install/install.js"; import { MANIFEST } from "../manifest.js"; -import { readUrlOrPath } from "../utils/misc.js"; -import { getTypeSpecCoreTemplates } from "./core-templates.js"; import { validateTemplateDefinitions, ValidationResult } from "./init-template-validate.js"; import { EmitterTemplate, InitTemplate, InitTemplateInput } from "./init-template.js"; import { checkbox } from "./prompts.js"; import { isFileSkipGeneration, makeScaffoldingConfig, scaffoldNewProject } from "./scaffold.js"; +import { + defaultInternalTemplateSource, + UriTemplateSource, + type LoadedTemplateIndex, + type TemplateSource, +} from "./template-source/index.js"; export interface InitTypeSpecProjectOptions { readonly templatesUrl?: string; @@ -23,6 +27,12 @@ export interface InitTypeSpecProjectOptions { readonly args?: string[]; readonly "project-name"?: string; readonly emitters?: string[]; + /** + * Provider that the `internal:` scheme resolves to (the built-in templates). Defaults to the + * compiler's on-disk `templates/` directory; the standalone single-executable injects an in-memory + * bundle instead. + */ + readonly internalTemplateSource?: TemplateSource; } export async function initTypeSpecProject( @@ -55,45 +65,54 @@ export async function initTypeSpecProjectWorker( const folderName = getBaseFileName(directory); - // 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) - : await downloadTemplates(host, options.templatesUrl, skipPrompts); + const isRemote = options.templatesUrl !== undefined; + // A `templatesUrl` points at a filesystem path or URL; otherwise use the built-in ("internal") + // templates, either an injected provider (e.g. bundled in the standalone executable) or the + // compiler's on-disk `templates/` directory. + const source: TemplateSource = + options.templatesUrl !== undefined + ? new UriTemplateSource(host, options.templatesUrl) + : (options.internalTemplateSource ?? defaultInternalTemplateSource(host)); + + if (isRemote) { + warning( + `Downloading or using an untrusted template may contain malicious packages that can compromise your system and data. Proceed with caution and verify the source.`, + ); + if (!skipPrompts && !(await confirm("Continue"))) { + process.exit(1); + } + } + + // No validation is done until a template has been selected. + const index = await loadTemplateIndex(source, options.templatesUrl); if (skipPrompts && !options.template) { // A template has to be defined if we're skipping prompts throw new Error( `A template must be specified when --no-prompt is used. Specify one of the following templates via --template: ${Object.keys( - result.templates, + index.templates, ) .map((t) => `"${t}"`) .join(", ")}`, ); } - const templateName = options.template ?? (await promptTemplateSelection(result.templates)); + const templateName = options.template ?? (await promptTemplateSelection(index.templates)); - if (!result.templates[templateName]) { + if (!index.templates[templateName]) { throw new Error(`Unexpected error: Cannot find template ${templateName}`); } // Validate minimum compiler version for non built-in templates - if ( - !skipPrompts && - result !== typeSpecCoreTemplates && - !(await validateTemplate(result.templates[templateName], result)) - ) { + if (!skipPrompts && isRemote && !(await validateTemplate(index.templates[templateName], index))) { return; } - const template = result.templates[templateName] as InitTemplate; + const template = index.templates[templateName] as InitTemplate; const name = await resolveProjectName(folderName, options); const emitters = await selectEmitters(template, options); const parameters = await promptCustomParameters(template, options); const scaffoldingConfig = makeScaffoldingConfig(template, { - baseUri: result.baseUri, + source, name, directory, parameters, @@ -246,49 +265,26 @@ async function confirm(message: string): Promise { }); } -export interface LoadedTemplate { - readonly baseUri: string; - readonly templates: Record; - readonly file: SourceFile; -} -async function downloadTemplates( - host: CompilerHost, - url: string, - skipCheck: boolean, -): Promise { - warning( - `Downloading or using an untrusted template may contain malicious packages that can compromise your system and data. Proceed with caution and verify the source.`, - ); - if (!skipCheck && !(await confirm("Continue"))) { - process.exit(1); - } - let file: SourceFile; +async function loadTemplateIndex( + source: TemplateSource, + url: string | undefined, +): Promise { try { - file = await readUrlOrPath(host, url); - } catch (e: any) { - throw new InitTemplateError([ - createDiagnostic({ - code: "init-template-download-failed", - target: NoTarget, - format: { url: url, message: e.message }, - }), - ]); - } - - let json: unknown; - try { - json = JSON.parse(file.text); + return await source.loadIndex(); } catch (e: any) { + if (url === undefined) { + throw e; + } + const code = + e instanceof SyntaxError ? "init-template-invalid-json" : "init-template-download-failed"; throw new InitTemplateError([ createDiagnostic({ - code: "init-template-invalid-json", + code, target: NoTarget, - format: { url: url, message: e.message }, + format: { url, message: e.message }, }), ]); } - - return { templates: json as any, baseUri: getDirectoryPath(file.path), file }; } function getTemplateName(template: InitTemplate) { @@ -331,17 +327,17 @@ function isTemplateCompatibleWithTspVersion(template: InitTemplate): boolean { ); } -async function validateTemplate(template: any, loaded: LoadedTemplate): Promise { +async function validateTemplate(template: any, index: LoadedTemplateIndex): Promise { // After selection, validate the template definition const currentCompilerVersion = MANIFEST.version; let validationResult: ValidationResult; // 1. If current version > compilerVersion, proceed with strict validation if (isTemplateCompatibleWithTspVersion(template)) { - validationResult = validateTemplateDefinitions(template, loaded.file, true); + validationResult = validateTemplateDefinitions(template, index.indexFile, true); // 1.1 If strict validation fails, try relaxed validation if (!validationResult.valid) { - validationResult = validateTemplateDefinitions(template, loaded.file, false); + validationResult = validateTemplateDefinitions(template, index.indexFile, false); } } else { // 2. if version mis-match or none specified, warn and prompt user to continue or not @@ -352,7 +348,7 @@ async function validateTemplate(template: any, loaded: LoadedTemplate): Promise< ) ) { // 2.1 If user choose to continue, proceed with relaxed validation - validationResult = validateTemplateDefinitions(template, loaded.file, false); + validationResult = validateTemplateDefinitions(template, index.indexFile, false); } else { return false; } diff --git a/packages/compiler/src/init/scaffold.ts b/packages/compiler/src/init/scaffold.ts index eb369ccb20b..d3ce68b2123 100644 --- a/packages/compiler/src/init/scaffold.ts +++ b/packages/compiler/src/init/scaffold.ts @@ -4,7 +4,6 @@ import { getDirectoryPath, joinPaths } from "../core/path-utils.js"; import type { SystemHost } from "../core/types.js"; import { fetchLatestPackageManifest } from "../package-manger/npm-registry.js"; import type { PackageJson } from "../types/package-json.js"; -import { readUrlOrPath, resolveRelativeUrlOrPath } from "../utils/misc.js"; import { createFileTemplatingContext, type FileTemplatingContext, @@ -16,6 +15,7 @@ import type { InitTemplateLibrary, InitTemplateLibrarySpec, } from "./init-template.js"; +import type { TemplateSource } from "./template-source/index.js"; export const TypeSpecConfigFilename = "tspconfig.yaml"; @@ -24,9 +24,10 @@ export interface ScaffoldingConfig { template: InitTemplate; /** - * Path where this template was loaded from. + * Source the template was loaded from. Used to read the template's files during scaffolding. + * Optional: templates that declare no `files` never need it. */ - baseUri: string; + source?: TemplateSource; /** * Directory full path where the project should be initialized. @@ -73,7 +74,6 @@ export function makeScaffoldingConfig( return { template, libraries: config.libraries ?? template.libraries?.map(normalizeLibrary) ?? [], - baseUri: config.baseUri ?? ".", name: config.name ?? "", directory: config.directory ?? "", parameters: config.parameters ?? {}, @@ -248,8 +248,12 @@ async function writeFile( context: FileTemplatingContext, file: InitTemplateFile, ) { - const baseDir = config.baseUri + "/"; - const template = await readUrlOrPath(host, resolveRelativeUrlOrPath(baseDir, file.path)); + if (config.source === undefined) { + throw new Error( + `Cannot resolve template file "${file.path}": template was loaded without a source.`, + ); + } + const template = await config.source.readFile(file.path); const content = render(template.text, context); const destinationFilePath = joinPaths(config.directory, file.destination); // create folders in case they don't exist diff --git a/packages/compiler/src/init/template-source/default-core-templates.ts b/packages/compiler/src/init/template-source/default-core-templates.ts new file mode 100644 index 00000000000..3bf76b30398 --- /dev/null +++ b/packages/compiler/src/init/template-source/default-core-templates.ts @@ -0,0 +1,14 @@ +import { CompilerPackageRoot } from "../../core/node-host.js"; +import { resolvePath } from "../../core/path-utils.js"; +import type { SystemHost } from "../../core/types.js"; +import type { TemplateSource } from "./types.js"; +import { UriTemplateSource } from "./uri-template-source.js"; + +/** + * The default source of built-in ("internal") templates: the compiler package's on-disk + * `templates/` directory, read through the given {@link SystemHost}. The standalone single-executable + * overrides this by injecting its own {@link InMemoryTemplateSource} bundle. + */ +export function defaultInternalTemplateSource(host: SystemHost): TemplateSource { + return UriTemplateSource.fromDirectory(host, resolvePath(CompilerPackageRoot, "templates")); +} diff --git a/packages/compiler/src/init/template-source/in-memory-template-source.ts b/packages/compiler/src/init/template-source/in-memory-template-source.ts new file mode 100644 index 00000000000..0867cbec15b --- /dev/null +++ b/packages/compiler/src/init/template-source/in-memory-template-source.ts @@ -0,0 +1,55 @@ +import { normalizePath } from "../../core/path-utils.js"; +import { createSourceFile } from "../../core/source-file.js"; +import type { SourceFile } from "../../core/types.js"; +import type { LoadedTemplateIndex, TemplateSource } from "./types.js"; +import { SCAFFOLDING_FILENAME } from "./uri-template-source.js"; + +/** Prefix used to label the virtual files this source serves in diagnostics. */ +const INTERNAL_URI_PREFIX = "internal:"; + +/** + * A {@link TemplateSource} serving an index and its template files from an in-memory map keyed by + * relative path. Used for built-in templates that are bundled rather than on disk — e.g. the + * standalone single-executable injects one built from its embedded assets. Keys and lookups are + * normalized so callers can use `./`-relative or backslash paths interchangeably. + */ +export class InMemoryTemplateSource implements TemplateSource { + #files: ReadonlyMap; + #indexPath: string; + + /** + * @param files Template files keyed by their relative path (including the index). + * @param indexPath Relative path of the index within {@link files}. + */ + constructor(files: ReadonlyMap, indexPath: string = SCAFFOLDING_FILENAME) { + this.#indexPath = indexPath; + this.#files = new Map([...files].map(([key, value]) => [normalizeKey(key), value])); + } + + async loadIndex(): Promise { + const indexFile = this.#read(this.#indexPath); + const templates = JSON.parse(indexFile.text); + return { templates, indexFile, baseUri: INTERNAL_URI_PREFIX }; + } + + async readFile(relativePath: string): Promise { + return this.#read(relativePath); + } + + #read(relativePath: string): SourceFile { + const key = normalizeKey(relativePath); + const content = this.#files.get(key); + if (content === undefined) { + const error: NodeJS.ErrnoException = new Error( + `ENOENT: bundled template file not found, '${relativePath}'`, + ); + error.code = "ENOENT"; + throw error; + } + return createSourceFile(content, `${INTERNAL_URI_PREFIX}${key}`); + } +} + +function normalizeKey(path: string): string { + return normalizePath(path).replace(/^\/+/, ""); +} diff --git a/packages/compiler/src/init/template-source/index.ts b/packages/compiler/src/init/template-source/index.ts new file mode 100644 index 00000000000..b89038435e3 --- /dev/null +++ b/packages/compiler/src/init/template-source/index.ts @@ -0,0 +1,4 @@ +export { defaultInternalTemplateSource } from "./default-core-templates.js"; +export { InMemoryTemplateSource } from "./in-memory-template-source.js"; +export type { LoadedTemplateIndex, TemplateSource } from "./types.js"; +export { SCAFFOLDING_FILENAME, UriTemplateSource } from "./uri-template-source.js"; diff --git a/packages/compiler/src/init/template-source/types.ts b/packages/compiler/src/init/template-source/types.ts new file mode 100644 index 00000000000..c8154dfe2fd --- /dev/null +++ b/packages/compiler/src/init/template-source/types.ts @@ -0,0 +1,22 @@ +import type { SourceFile } from "../../core/types.js"; +import type { InitTemplate } from "../init-template.js"; + +/** Result of loading a template index (the set of templates offered by a {@link TemplateSource}). */ +export interface LoadedTemplateIndex { + /** Templates keyed by their id. */ + readonly templates: Record; + /** Source file the index was parsed from. Used to position validation diagnostics. */ + readonly indexFile: SourceFile; + /** Location the index was loaded from (a directory path or URL). Informational only. */ + readonly baseUri: string; +} + +/** + * A source of `tsp init` templates. Decouples template loading from the host filesystem: each context + * supplies its own implementation — {@link UriTemplateSource} for a path or URL, or + * {@link InMemoryTemplateSource} for a bundle addressed through the `internal:` scheme. + */ +export interface TemplateSource { + loadIndex(): Promise; + readFile(relativePath: string): Promise; +} diff --git a/packages/compiler/src/init/template-source/uri-template-source.ts b/packages/compiler/src/init/template-source/uri-template-source.ts new file mode 100644 index 00000000000..7b42275d07d --- /dev/null +++ b/packages/compiler/src/init/template-source/uri-template-source.ts @@ -0,0 +1,55 @@ +import { getDirectoryPath } from "../../core/path-utils.js"; +import type { SourceFile, SystemHost } from "../../core/types.js"; +import { readUrlOrPath, resolveRelativeUrlOrPath } from "../../utils/misc.js"; +import type { LoadedTemplateIndex, TemplateSource } from "./types.js"; + +/** File name of the template index within a template source directory. */ +export const SCAFFOLDING_FILENAME = "scaffolding.json"; + +/** + * A {@link TemplateSource} backed by a location: a filesystem path or a URL. The index and every + * template file are read through a {@link SystemHost} via {@link readUrlOrPath}, so this handles both + * a local directory and a remote `tsp init ` uniformly. Built-in templates are served through + * {@link defaultInternalTemplateSource} (or an injected provider) instead. + * + * Loading an untrusted remote template can execute arbitrary code during scaffolding; callers are + * responsible for confirming the source with the user before using it. + */ +export class UriTemplateSource implements TemplateSource { + #host: SystemHost; + #indexLocation: string; + /** Directory (path or URL) that template file paths are resolved against. */ + #baseUri: string; + + /** + * @param host Host used to read the index and template files. + * @param indexLocation Location of the index file (a path or URL). Template files are resolved + * relative to its containing directory. + */ + constructor(host: SystemHost, indexLocation: string) { + this.#host = host; + this.#indexLocation = indexLocation; + this.#baseUri = getDirectoryPath(indexLocation); + } + + /** + * Create a source for a template root directory (path or URL) whose index is a + * `scaffolding.json` at its root. + */ + static fromDirectory(host: SystemHost, directory: string): UriTemplateSource { + return new UriTemplateSource( + host, + resolveRelativeUrlOrPath(directory + "/", SCAFFOLDING_FILENAME), + ); + } + + async loadIndex(): Promise { + const indexFile = await readUrlOrPath(this.#host, this.#indexLocation); + const templates = JSON.parse(indexFile.text); + return { templates, indexFile, baseUri: this.#baseUri }; + } + + async readFile(relativePath: string): Promise { + return readUrlOrPath(this.#host, resolveRelativeUrlOrPath(this.#baseUri + "/", relativePath)); + } +} diff --git a/packages/compiler/src/internals/index.ts b/packages/compiler/src/internals/index.ts index a709fe35c0d..a94360e237b 100644 --- a/packages/compiler/src/internals/index.ts +++ b/packages/compiler/src/internals/index.ts @@ -11,5 +11,8 @@ export { resolveCompilerOptions } from "../config/config-to-options.js"; export { NodeSystemHost } from "../core/node-system-host.js"; export { InitTemplateSchema } from "../init/init-template.js"; export { makeScaffoldingConfig, scaffoldNewProject } from "../init/scaffold.js"; +// From uri-template-source directly (not the barrel) to avoid pulling node-host's top-level await. +export type { TemplateSource } from "../init/template-source/types.js"; +export { UriTemplateSource } from "../init/template-source/uri-template-source.js"; export { resolveEntrypointFile } from "../server/entrypoint-resolver.js"; export { InternalCompileResult, ServerDiagnostic } from "../server/index.js"; diff --git a/packages/compiler/test/cli/init.test.ts b/packages/compiler/test/cli/init.test.ts index 064ef45d318..e12e98d1ae6 100644 --- a/packages/compiler/test/cli/init.test.ts +++ b/packages/compiler/test/cli/init.test.ts @@ -1,9 +1,9 @@ import { afterAll, afterEach, beforeEach, expect, it, vi } from "vitest"; import { CliCompilerHost } from "../../src/core/cli/types.js"; -import { CompilerPackageRoot } from "../../src/core/node-host.js"; import { resolvePath } from "../../src/core/path-utils.js"; import { LogSink } from "../../src/index.js"; -import { initTypeSpecProject } from "../../src/init/init.js"; +import { initTypeSpecProject, InitTypeSpecProjectOptions } from "../../src/init/init.js"; +import { UriTemplateSource } from "../../src/init/template-source/index.js"; import { createTestFileSystem } from "../../src/testing/fs.js"; import { TestFileSystem } from "../../src/testing/types.js"; import { parseYaml as coreParseYaml } from "../../src/yaml/parser.js"; @@ -88,17 +88,19 @@ const TEST_SCAFFOLDING = { }; async function createTestFSWithCliCompilerHost(): Promise< - TestFileSystem & { compilerHost: CliCompilerHost } + TestFileSystem & { + compilerHost: CliCompilerHost; + init: (directory: string, options?: InitTypeSpecProjectOptions) => Promise; + } > { const testHost = await createTestFileSystem(); - testHost.fs.set( - resolvePath(CompilerPackageRoot, "templates", "scaffolding.json"), - JSON.stringify(TEST_SCAFFOLDING), - ); + const executionRoot = testHost.compilerHost.getExecutionRoot(); + const templatesRoot = resolvePath(executionRoot, "templates"); + testHost.fs.set(resolvePath(templatesRoot, "scaffolding.json"), JSON.stringify(TEST_SCAFFOLDING)); testHost.fs.set( - resolvePath(CompilerPackageRoot, "templates", "withParams", "tspconfig.yaml"), + resolvePath(templatesRoot, "withParams", "tspconfig.yaml"), ` emit: @typespec/openapi3 options: @@ -125,7 +127,12 @@ parameters: }; Object.assign(testHost.compilerHost as CliCompilerHost, { logSink }); - return testHost as TestFileSystem & { compilerHost: CliCompilerHost }; + const compilerHost = testHost.compilerHost as CliCompilerHost; + // Serve the built-in templates from the test file system rather than the real compiler package. + const internalTemplateSource = UriTemplateSource.fromDirectory(compilerHost, templatesRoot); + const init = (directory: string, options: InitTypeSpecProjectOptions = {}) => + initTypeSpecProject(compilerHost, directory, { ...options, internalTemplateSource }); + return Object.assign(testHost as TestFileSystem & { compilerHost: CliCompilerHost }, { init }); } function parseJson(host: CliCompilerHost, path: string): Promise> { @@ -142,9 +149,9 @@ afterAll(() => { }); it("should create a new project with the specified template", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + await init("/tmp/test-project", { template: "foo", "no-prompt": true, }); @@ -157,10 +164,10 @@ it("should create a new project with the specified template", async () => { }); it("does not ask for permission if directory has files", async () => { - const { fs, compilerHost } = await createTestFSWithCliCompilerHost(); + const { fs, compilerHost, init } = await createTestFSWithCliCompilerHost(); fs.set("/tmp/test-project/some-file.txt", "content"); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + await init("/tmp/test-project", { template: "foo", "no-prompt": true, }); @@ -169,9 +176,9 @@ it("does not ask for permission if directory has files", async () => { }); it("should support overriding project name", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + await init("/tmp/test-project", { template: "foo", "no-prompt": true, "project-name": "custom-project-name", @@ -182,9 +189,9 @@ it("should support overriding project name", async () => { }); it("should support overriding emitters", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + await init("/tmp/test-project", { template: "foo", "no-prompt": true, emitters: ["@typespec/openapi3", "@typespec/http-client-csharp"], @@ -195,8 +202,8 @@ it("should support overriding emitters", async () => { }); it("defaults to initialValue for parameters", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); + await init("/tmp/test-project", { template: "withParams", "no-prompt": true, args: ["param1=value1"], @@ -211,8 +218,8 @@ it("defaults to initialValue for parameters", async () => { }); it("should support passing in arguments", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); + await init("/tmp/test-project", { template: "withParams", "no-prompt": true, args: ["param1=value1", "param2=value2", "param3=value3"], @@ -227,9 +234,9 @@ it("should support passing in arguments", async () => { }); it("can't add emitters not specified by the template", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + await init("/tmp/test-project", { template: "foo", "no-prompt": true, emitters: ["@typespec/openapi3", "@typespec/http-client-csharp", "my-fake-emitter"], @@ -240,10 +247,10 @@ it("can't add emitters not specified by the template", async () => { }); it("should throw an error if no template is specified with no-prompt", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { init } = await createTestFSWithCliCompilerHost(); await expect( - initTypeSpecProject(compilerHost, "/tmp/test-project", { + init("/tmp/test-project", { "no-prompt": true, }), ).rejects.toThrowError( @@ -252,10 +259,10 @@ it("should throw an error if no template is specified with no-prompt", async () }); it("should throw an error if the specified template does not exist", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { init } = await createTestFSWithCliCompilerHost(); await expect( - initTypeSpecProject(compilerHost, "/tmp/test-project", { + init("/tmp/test-project", { template: "non-existent-template", "no-prompt": true, }), @@ -263,10 +270,10 @@ it("should throw an error if the specified template does not exist", async () => }); it("should throw an error if a required argument is not provided", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { init } = await createTestFSWithCliCompilerHost(); await expect( - initTypeSpecProject(compilerHost, "/tmp/test-project", { + init("/tmp/test-project", { template: "withParams", "no-prompt": true, }), @@ -276,9 +283,9 @@ it("should throw an error if a required argument is not provided", async () => { }); it("should resolve package versions from npm registry", async () => { - const { compilerHost } = await createTestFSWithCliCompilerHost(); + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + await init("/tmp/test-project", { template: "foo", "no-prompt": true, }); @@ -292,8 +299,8 @@ it("should resolve package versions from npm registry", async () => { it("should fallback to 'latest' when npm registry is unreachable", async () => { fetchMock.mockRejectedValue(new Error("Network error")); - const { compilerHost } = await createTestFSWithCliCompilerHost(); - await initTypeSpecProject(compilerHost, "/tmp/test-project", { + const { compilerHost, init } = await createTestFSWithCliCompilerHost(); + await init("/tmp/test-project", { template: "foo", "no-prompt": true, }); diff --git a/packages/compiler/test/e2e/init-templates.e2e.ts b/packages/compiler/test/e2e/init-templates.e2e.ts index c9400af6491..bc663760bb4 100644 --- a/packages/compiler/test/e2e/init-templates.e2e.ts +++ b/packages/compiler/test/e2e/init-templates.e2e.ts @@ -7,6 +7,7 @@ import { afterAll, beforeAll, describe, it, vi } from "vitest"; import { NodeHost } from "../../src/index.js"; import { getTypeSpecCoreTemplates } from "../../src/init/core-templates.js"; import { makeScaffoldingConfig, scaffoldNewProject } from "../../src/init/scaffold.js"; +import { defaultInternalTemplateSource } from "../../src/init/template-source/index.js"; const fetchMock = vi.fn().mockResolvedValue({ json: () => Promise.resolve({ name: "mock-pkg", version: "1.0.0" }), @@ -122,7 +123,7 @@ describe("Init templates e2e tests", () => { makeScaffoldingConfig(template, { name, directory: targetFolder, - baseUri: typeSpecCoreTemplates.baseUri, + source: defaultInternalTemplateSource(NodeHost), }), ); } diff --git a/packages/compiler/test/init/template-source.test.ts b/packages/compiler/test/init/template-source.test.ts new file mode 100644 index 00000000000..60648cf5e45 --- /dev/null +++ b/packages/compiler/test/init/template-source.test.ts @@ -0,0 +1,88 @@ +import { beforeEach, describe, expect, it } from "vitest"; +import { resolvePath } from "../../src/core/path-utils.js"; +import type { CompilerHost } from "../../src/core/types.js"; +import { InMemoryTemplateSource, UriTemplateSource } from "../../src/init/template-source/index.js"; +import { createTestFileSystem } from "../../src/testing/fs.js"; +import type { TestFileSystem } from "../../src/testing/types.js"; + +const scaffolding = { + sample: { title: "Sample", description: "A sample template", files: [] }, +}; + +describe("UriTemplateSource", () => { + let testFs: TestFileSystem; + const root = resolvePath("/root/templates"); + + beforeEach(async () => { + testFs = await createTestFileSystem(); + testFs.fs.set(resolvePath(root, "scaffolding.json"), JSON.stringify(scaffolding)); + testFs.fs.set(resolvePath(root, "sample", "main.tsp"), "op ping(): void;"); + }); + + it("loads the index from the given index location", async () => { + const source = new UriTemplateSource( + testFs.compilerHost, + resolvePath(root, "scaffolding.json"), + ); + const index = await source.loadIndex(); + expect(index.templates.sample.title).toBe("Sample"); + expect(index.baseUri).toBe(root); + }); + + it("reads template files relative to the index directory", async () => { + const source = new UriTemplateSource( + testFs.compilerHost, + resolvePath(root, "scaffolding.json"), + ); + const file = await source.readFile("sample/main.tsp"); + expect(file.text).toBe("op ping(): void;"); + }); + + it("fromDirectory resolves scaffolding.json at the directory root", async () => { + const source = UriTemplateSource.fromDirectory(testFs.compilerHost, root); + const index = await source.loadIndex(); + expect(index.templates.sample.title).toBe("Sample"); + expect((await source.readFile("sample/main.tsp")).text).toBe("op ping(): void;"); + }); + + it("resolves remote template files relative to the index URL", async () => { + const reads: string[] = []; + const host = { + readUrl: async (url: string) => { + reads.push(url); + return { path: url, text: url.endsWith("index.json") ? JSON.stringify(scaffolding) : "hi" }; + }, + } as unknown as CompilerHost; + + const source = new UriTemplateSource(host, "https://example.com/tpl/index.json"); + const index = await source.loadIndex(); + expect(index.templates.sample.title).toBe("Sample"); + + await source.readFile("sample/main.tsp"); + expect(reads).toContain("https://example.com/tpl/sample/main.tsp"); + }); +}); + +describe("InMemoryTemplateSource", () => { + const files = new Map([ + ["scaffolding.json", JSON.stringify(scaffolding)], + ["sample/main.tsp", "op ping(): void;"], + ]); + + it("loads the index from the in-memory bundle", async () => { + const source = new InMemoryTemplateSource(files); + const index = await source.loadIndex(); + expect(index.templates.sample.title).toBe("Sample"); + expect(index.baseUri).toBe("internal:"); + }); + + it("reads template files from the in-memory bundle", async () => { + const source = new InMemoryTemplateSource(files); + expect((await source.readFile("sample/main.tsp")).text).toBe("op ping(): void;"); + }); + + it("throws a helpful error for a missing file", async () => { + const source = new InMemoryTemplateSource(files); + await expect(source.readFile("missing.tsp")).rejects.toThrow(/missing\.tsp/); + }); +}); diff --git a/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts b/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts index 5e17161f81c..289b6207f39 100644 --- a/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts +++ b/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts @@ -8,6 +8,7 @@ import { makeScaffoldingConfig, NodeSystemHost, scaffoldNewProject, + UriTemplateSource, } from "@typespec/compiler/internals"; import { Ajv } from "ajv"; import * as semver from "semver"; @@ -16,13 +17,7 @@ import vscode, { ExtensionContext, QuickPickItem } from "vscode"; import pkgJson from "../../package.json" with { type: "json" }; import { ExtensionStateManager } from "../extension-state-manager.js"; import logger from "../log/logger.js"; -import { - getBaseFileName, - getDirectoryPath, - joinPaths, - normalizePath, - resolvePath, -} from "../path-utils.js"; +import { getBaseFileName, joinPaths, normalizePath } from "../path-utils.js"; import telemetryClient from "../telemetry/telemetry-client.js"; import { TelemetryEventName } from "../telemetry/telemetry-event.js"; import { Result, ResultCode, SettingName } from "../types.js"; @@ -41,9 +36,6 @@ import { isFile, isWhitespaceStringOrUndefined, spawnExecutionAndLogToOutput, - tryParseJson, - tryReadFile, - tryReadFileOrUrl, } from "../utils.js"; export type InitTemplatesUrlSetting = { @@ -194,7 +186,7 @@ export async function createTypeSpecProject( } const initTemplateConfig = makeScaffoldingConfig(info.template!, { - baseUri: info.baseUrl, + source: UriTemplateSource.fromDirectory(NodeSystemHost, info.baseUrl), name: projectName!, directory: selectedRootFolder, parameters: inputs ?? {}, @@ -630,19 +622,12 @@ async function selectTemplate( return selected?.info; } -async function getTypeSpecCoreTemplates( - context: ExtensionContext, -): Promise<{ readonly baseUri: string; readonly templates: Record } | undefined> { +async function getTypeSpecCoreTemplates(context: ExtensionContext) { const templatesDir = context.asAbsolutePath("templates"); - const file = await tryReadFile(resolvePath(templatesDir, "scaffolding.json")); - if (file) { - const content = tryParseJson(file); - return { - baseUri: templatesDir, - templates: content, - }; - } else { - logger.error(`Failed to read core typespec templates from extension: ${templatesDir}`); + try { + return await UriTemplateSource.fromDirectory(NodeSystemHost, templatesDir).loadIndex(); + } catch (e) { + logger.error(`Failed to read core typespec templates from extension: ${templatesDir}`, [e]); return undefined; } } @@ -693,39 +678,26 @@ async function loadInitTemplates( logger.info("Loading configured and registed init templates..."); const loadFromConfig = async () => { for (const item of all) { - const { content, url } = (await tryReadFileOrUrl(item.url)) ?? { - content: undefined, - url: item.url, - }; - if (!content) { - logger.warning(`Failed to read template from ${item.url}. The url will be skipped`, [], { + let index; + try { + index = await new UriTemplateSource(NodeSystemHost, item.url).loadIndex(); + } catch (e) { + logger.warning(`Failed to load templates from ${item.url}. The url will be skipped`, [], { showOutput: false, showPopup: true, }); continue; - } else { - const json = tryParseJson(content); - if (!json) { - logger.warning( - `Failed to parse templates content from ${item.url}. The url will be skipped`, - [], - { showOutput: false, showPopup: true }, - ); - continue; - } else { - for (const [key, value] of Object.entries(json)) { - if (value !== undefined) { - const info: InitTemplateInfo = { - source: item.name, - sourceType: item.source, - baseUrl: getDirectoryPath(url), - name: key, - template: value as InitProjectTemplate, - }; - templateInfoMap.get(item.name)?.push(info) ?? - templateInfoMap.set(item.name, [info]); - } - } + } + for (const [key, value] of Object.entries(index.templates)) { + if (value !== undefined) { + const info: InitTemplateInfo = { + source: item.name, + sourceType: item.source, + baseUrl: index.baseUri, + name: key, + template: value as InitProjectTemplate, + }; + templateInfoMap.get(item.name)?.push(info) ?? templateInfoMap.set(item.name, [info]); } } } From 58b58482a61c7d0f047f660aefc367c15ed05c59 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 14:26:36 -0400 Subject: [PATCH 033/249] refactor(compiler): remove unused runScript backupPath fallback (#11312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Removes the unused `backupPath` fallback argument from the internal `runScript` helper (`packages/compiler/src/runner.ts`) and its two callers. `runScript(relativePath, backupPath)` used to fall back to `backupPath` when `relativePath` did not exist under the resolved package root. Both call sites (`cmd/tsp.js`, `cmd/tsp-server.js`) always pass a `relativePath` that exists, so the fallback (and its `checkFileExists` helper + `access` import) is dead code. This is a pure, self-contained cleanup extracted out of #11299 (standalone SEA rewrite) so that PR stays focused on the feature. The standalone CLI does not use `runScript`. ## History / why it is safe to remove The `backupPath` fallback was added in #1410 and shipped in `@cadl-lang/compiler` **0.38.2** (Dec 2022) as a patch: _"Revert breaking change to global cli usage."_ That PR introduced the stable indirection entrypoints `entrypoints/cli.js` and `entrypoints/server.js`. Before 0.38.2 the global CLI booted the compiler directly at `dist/core/cli/cli.js` (and `dist/server/server.js`). Because a **globally-installed** CLI resolves and runs the **locally-installed** compiler, a global 0.38.2 CLI could hit an older local compiler that did not yet have the `entrypoints/` files. The `backupPath` (`dist/core/cli/cli.js` / `dist/server/server.js`) was the fallback so the global CLI could still boot those pre-0.38.2 local installs. Every supported compiler version has shipped `entrypoints/cli.js` / `entrypoints/server.js` since 0.38.2, so the fallback branch is now unreachable dead code. ## Changes - `runner.ts`: `runScript(relativePath)` — dropped `backupPath` param, `checkFileExists`, and the now-unused `access` import. - `cmd/tsp.js` / `cmd/tsp-server.js`: drop the second argument. ## Validation - `tsc -p packages/compiler/tsconfig.build.json` passes. --- ...runner-remove-backup-path-2026-7-20-13-30-0.md | 7 +++++++ packages/compiler/cmd/tsp-server.js | 2 +- packages/compiler/cmd/tsp.js | 2 +- packages/compiler/src/runner.ts | 15 +++------------ 4 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 .chronus/changes/runner-remove-backup-path-2026-7-20-13-30-0.md diff --git a/.chronus/changes/runner-remove-backup-path-2026-7-20-13-30-0.md b/.chronus/changes/runner-remove-backup-path-2026-7-20-13-30-0.md new file mode 100644 index 00000000000..d478f01ee77 --- /dev/null +++ b/.chronus/changes/runner-remove-backup-path-2026-7-20-13-30-0.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/compiler" +--- + +Remove the unused `backupPath` fallback argument from the internal `runScript` helper diff --git a/packages/compiler/cmd/tsp-server.js b/packages/compiler/cmd/tsp-server.js index 971b2bd53e4..ba7e6517f0d 100755 --- a/packages/compiler/cmd/tsp-server.js +++ b/packages/compiler/cmd/tsp-server.js @@ -1,3 +1,3 @@ #!/usr/bin/env node import { runScript } from "../dist/src/runner.js"; -await runScript("entrypoints/server.js", "dist/server/server.js"); +await runScript("entrypoints/server.js"); diff --git a/packages/compiler/cmd/tsp.js b/packages/compiler/cmd/tsp.js index 4f4b95ecccb..528a587a778 100755 --- a/packages/compiler/cmd/tsp.js +++ b/packages/compiler/cmd/tsp.js @@ -1,3 +1,3 @@ #!/usr/bin/env node import { runScript } from "../dist/src/runner.js"; -await runScript("entrypoints/cli.js", "dist/core/cli/cli.js"); +await runScript("entrypoints/cli.js"); diff --git a/packages/compiler/src/runner.ts b/packages/compiler/src/runner.ts index 6c7039d42f8..7dc98b48b7b 100644 --- a/packages/compiler/src/runner.ts +++ b/packages/compiler/src/runner.ts @@ -1,4 +1,4 @@ -import { access, readFile, realpath, stat } from "fs/promises"; +import { readFile, realpath, stat } from "fs/promises"; import { join, resolve } from "path"; import { fileURLToPath, pathToFileURL } from "url"; import { ResolveModuleHost, resolveModule } from "./module-resolver/index.js"; @@ -10,14 +10,11 @@ import { ResolveModuleHost, resolveModule } from "./module-resolver/index.js"; * Prevents loading two conflicting copies of TypeSpec modules from global and * local package locations. */ -export async function runScript(relativePath: string, backupPath: string): Promise { +export async function runScript(relativePath: string): Promise { const packageRoot = await resolvePackageRoot(); if (packageRoot) { - let script = join(packageRoot, relativePath); - if (!(await checkFileExists(script)) && backupPath) { - script = join(packageRoot, backupPath); - } + const script = join(packageRoot, relativePath); const scriptUrl = pathToFileURL(script).toString(); await import(scriptUrl); } else { @@ -27,12 +24,6 @@ export async function runScript(relativePath: string, backupPath: string): Promi } } -function checkFileExists(file: string) { - return access(file) - .then(() => true) - .catch(() => false); -} - async function resolvePackageRoot(): Promise { if (process.env.TYPESPEC_SKIP_COMPILER_RESOLVE === "1") { return await getThisPackageRoot(); From e0248a1462a7e6f6332b8b3a4b7093ccc0f9b2e5 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 15:06:29 -0400 Subject: [PATCH 034/249] feat(tspd): add --rules-dir option to control rule reference page location (#11316) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds a `--rules-dir` option (and matching `rulesDir` API option) to `tspd doc` to control the directory where the per-rule reference pages are written. Since the tspd change that auto-generates one reference page per linter rule, those pages are always emitted under `/rules/`. Some consumers (e.g. `typespec-azure`) generate their reference docs into a `reference/` output dir but want the rule pages to keep their historical location one level up (`libraries//rules/`), so that existing rule URLs stay stable. This adds a small, backwards-compatible knob to control that location. ## Details - New CLI flag `--rules-dir ` on `tspd doc`. - New `rulesDir` option on `GenerateLibraryDocsOptions` and `RenderToStarlightMarkdownOptions`. - Defaults to `"rules"` (relative to `--output-dir`) — **no change** to existing behavior. - Can be set to a path that escapes the output dir (e.g. `"../rules"`) to place rule pages outside the generated reference folder. - The `StarlightRenderer.linterRuleLink` (used by `linter.md`) honors the configured dir so cross-links resolve correctly. ## Example ```bash # default (unchanged): pages at /rules/.md tspd doc . --enable-experimental --output-dir ./reference # keep rule pages outside the reference folder: /../rules/.md tspd doc . --enable-experimental --output-dir ./reference --rules-dir ../rules ``` --- ...d-doc-rules-dir-option-2026-7-20-14-0-0.md | 7 +++++++ packages/tspd/src/cli.ts | 6 ++++++ .../tspd/src/ref-doc/emitters/starlight.ts | 19 ++++++++++++++++--- packages/tspd/src/ref-doc/experimental.ts | 10 +++++++++- 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 .chronus/changes/tspd-doc-rules-dir-option-2026-7-20-14-0-0.md diff --git a/.chronus/changes/tspd-doc-rules-dir-option-2026-7-20-14-0-0.md b/.chronus/changes/tspd-doc-rules-dir-option-2026-7-20-14-0-0.md new file mode 100644 index 00000000000..857a669ab11 --- /dev/null +++ b/.chronus/changes/tspd-doc-rules-dir-option-2026-7-20-14-0-0.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/tspd" +--- + +Add a `--rules-dir` option (and `rulesDir` API option) to `tspd doc` to control where per-rule reference pages are written. Defaults to `rules` (relative to `--output-dir`); can be set to a path escaping the output dir (e.g. `../rules`) to keep rule pages outside the generated reference folder. diff --git a/packages/tspd/src/cli.ts b/packages/tspd/src/cli.ts index 4291f3834ea..aa6995ea5ec 100644 --- a/packages/tspd/src/cli.ts +++ b/packages/tspd/src/cli.ts @@ -85,6 +85,11 @@ async function main() { description: "Add llmstxt frontmatter to generated docs to aide in generating llms.txt files.", type: "boolean", + }) + .option("rules-dir", { + description: + "Relative directory (from --output-dir) where per-rule reference pages are written. Defaults to 'rules'. Use e.g. '../rules' to place them outside the reference folder.", + type: "string", }); }, async (args) => { @@ -97,6 +102,7 @@ async function main() { skipJSApi: args["skip-js"], typekits: args["typekits"], llmstxt: args["llmstxt"], + rulesDir: args["rules-dir"], }, ); // const diagnostics = await generateExternSignatures(host, resolvedRoot); diff --git a/packages/tspd/src/ref-doc/emitters/starlight.ts b/packages/tspd/src/ref-doc/emitters/starlight.ts index 96d88252daa..bad5ee311a1 100644 --- a/packages/tspd/src/ref-doc/emitters/starlight.ts +++ b/packages/tspd/src/ref-doc/emitters/starlight.ts @@ -20,6 +20,12 @@ import { MarkdownRenderer, groupByNamespace } from "./markdown.js"; export interface RenderToStarlightMarkdownOptions { llmstxt?: boolean; + /** + * Relative directory (from the output dir) where the per-rule reference pages are written. + * Defaults to `"rules"` (i.e. `/rules`). Can be set to a path escaping the output + * dir (e.g. `"../rules"`) to keep rule pages at a location outside the generated reference folder. + */ + rulesDir?: string; } /** @@ -29,7 +35,7 @@ export function renderToAstroStarlightMarkdown( refDoc: TypeSpecRefDoc, options: RenderToStarlightMarkdownOptions = {}, ): Record { - const renderer = new StarlightRenderer(refDoc); + const renderer = new StarlightRenderer(refDoc, options); const files: Record = { "index.mdx": renderIndexFile(renderer, refDoc), }; @@ -58,8 +64,9 @@ export function renderToAstroStarlightMarkdown( files["linter.md"] = linter; } + const rulesDir = options.rulesDir ?? "rules"; for (const rule of refDoc.linter?.rules ?? []) { - files[`rules/${rule.rule.name}.md`] = renderRule(rule); + files[`${rulesDir}/${rule.rule.name}.md`] = renderRule(rule); } // Generate one page per documented diagnostic, under `diagnostics/`. No index page. @@ -431,6 +438,11 @@ function renderSubExport( } export class StarlightRenderer extends MarkdownRenderer { + #rulesDir: string; + constructor(refDoc: TypeSpecRefDoc, options: RenderToStarlightMarkdownOptions = {}) { + super(refDoc); + this.#rulesDir = options.rulesDir ?? "rules"; + } headingTitle(item: NamedTypeRefDoc): string { // Set an explicit anchor id. return `${inlinecode(item.name)} {#${item.id}}`; @@ -473,7 +485,8 @@ export class StarlightRenderer extends MarkdownRenderer { } linterRuleLink(rule: LinterRuleRefDoc) { - return `./rules/${rule.rule.name}.md`; + const prefix = this.#rulesDir.startsWith(".") ? this.#rulesDir : `./${this.#rulesDir}`; + return `${prefix}/${rule.rule.name}.md`; } deprecationNotice(notice: DeprecationNotice): MarkdownDoc { diff --git a/packages/tspd/src/ref-doc/experimental.ts b/packages/tspd/src/ref-doc/experimental.ts index 188dd252b3a..886f96a2c24 100644 --- a/packages/tspd/src/ref-doc/experimental.ts +++ b/packages/tspd/src/ref-doc/experimental.ts @@ -19,6 +19,11 @@ export interface GenerateLibraryDocsOptions { typekits?: boolean; skipJSApi?: boolean; llmstxt?: boolean; + /** + * Relative directory (from the output dir) where the per-rule reference pages are written. + * Defaults to `"rules"`. Pass e.g. `"../rules"` to keep rule pages outside the reference folder. + */ + rulesDir?: string; } /** * @experimental this is for experimental and is for internal use only. Breaking change to this API can happen at anytime. @@ -31,7 +36,10 @@ export async function generateLibraryDocs( const diagnostics = createDiagnosticCollector(); const pkgJson = await readPackageJson(libraryPath); const refDoc = diagnostics.pipe(await extractLibraryRefDocs(libraryPath)); - const files = renderToAstroStarlightMarkdown(refDoc, options); + const files = renderToAstroStarlightMarkdown(refDoc, { + llmstxt: options.llmstxt, + rulesDir: options.rulesDir, + }); await mkdir(outputDir, { recursive: true }); const config = await prettier.resolveConfig(libraryPath); for (const [name, content] of Object.entries(files)) { From 551056578294891f8a3b4cb5e4c79832639937cc Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:40:03 -0500 Subject: [PATCH 035/249] Check custom code when preserving enum member underscores for backcompat (#11315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The underscore back-compat pass restores previously-shipped underscore names (e.g. `Tls1_0`) when the current spec normalizes them (e.g. `Tls10`). For extensible enums whose custom code re-adds the underscore member, the restoration renamed the *generated* member back to the underscore form — colliding with the custom member and removing the generated symbol it referenced. Example custom code that broke: ```csharp public partial struct ServiceBusMinimumTlsVersion { // references the generated `Tls10`; back-compat renamed it to `Tls1_0`, // producing a duplicate and dropping `Tls10` public static ServiceBusMinimumTlsVersion Tls1_0 { get; } = Tls10; } ``` ## Changes - **`EnumProvider.GetBackCompatibleName`**: new optional `customMemberNames` argument; skips the underscore restoration when the restored name already exists in custom code, keeping the generated name. - **`ExtensibleEnumProvider.BuildEnumValues`**: collects custom member names from `CustomCodeView.Properties` (case-insensitive) and threads them through. Uses `CustomCodeView` rather than `CanonicalView` to avoid the `CanonicalView → Properties → EnumValues → BuildEnumValues` recursion cycle; it contributes the same custom members. - **Tests**: adds `BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores` with `(Custom)`/`(Last)` TestData; existing `BackCompat_ExtensibleEnumUnderscoresPreserved` remains as the no-custom-code case. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com> --- .../src/Providers/EnumProvider.cs | 37 ++++++++++++++- .../EnumProviders/EnumProviderTests.cs | 27 +++++++++++ .../MockInputEnum.cs | 9 ++++ .../MockInputEnum.cs | 10 ++++ ...TakesPrecedenceOverPreservedUnderscores.cs | 46 +++++++++++++++++++ 5 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores.cs diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs index e164342ed20..e8496d8987e 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/EnumProvider.cs @@ -67,11 +67,33 @@ protected override string BuildNamespace() => string.IsNullOrEmpty(_inputType?.N protected static string RemoveUnderscores(string name) => name.Replace("_", string.Empty); - private protected static string GetBackCompatibleName( + private HashSet? _customMemberNames; + private HashSet CustomMemberNames => _customMemberNames ??= new HashSet( + GetCustomMemberNames(), + StringComparer.OrdinalIgnoreCase); + + private IEnumerable GetCustomMemberNames() + { + if (CustomCodeView is null) + { + return []; + } + + return IsExtensible + ? CustomCodeView.Properties.Select(p => p.Name) + : CustomCodeView.Fields.Select(f => f.Name); + } + + private protected string GetBackCompatibleName( string generatedName, IReadOnlyList generatedNames, IReadOnlyList lastContractNames) { + if (lastContractNames.Count == 0) + { + return generatedName; + } + if (lastContractNames.Any(n => n.Equals(generatedName, StringComparison.OrdinalIgnoreCase))) { return generatedName; @@ -90,9 +112,20 @@ private protected static string GetBackCompatibleName( .Take(2) .ToArray(); - return matchingCurrentNames.Length == 1 && matchingLastContractNames.Length == 1 + var backCompatName = matchingCurrentNames.Length == 1 && matchingLastContractNames.Length == 1 ? matchingLastContractNames[0] : generatedName; + + // If restoring the underscore-preserved name would collide with a member that already + // exists in custom code, keep the generated name so the custom member is preserved + // rather than duplicated or removed. + if (!backCompatName.Equals(generatedName, StringComparison.Ordinal) + && CustomMemberNames.Contains(backCompatName)) + { + return generatedName; + } + + return backCompatName; } protected override bool GetIsEnum() => true; diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs index 4fd64c9b4c6..6aa43dc6ac8 100644 --- a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/EnumProviderTests.cs @@ -843,6 +843,33 @@ await MockHelpers.LoadMockGeneratorAsync( Assert.AreEqual("Other", enumType.Properties[1].Name); } + // Verifies that when custom code already implements the underscore-named member (e.g. the + // user manually re-added 'Existing_Value' pointing at the generated 'ExistingValue'), the + // underscore back-compat restoration does NOT rename the generated member. Otherwise the + // generated member would collide with (and effectively remove) the custom implementation. + [Test] + public async Task BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores() + { + await MockHelpers.LoadMockGeneratorAsync( + createCSharpTypeCore: (inputType) => typeof(string), + compilation: async () => await Helpers.GetCompilationFromDirectoryAsync(parameters: "Custom"), + lastContractCompilation: async () => await Helpers.GetCompilationFromDirectoryAsync(parameters: "Last")); + + var input = InputFactory.StringEnum("mockInputEnum", [ + ("ExistingValue", "existing"), + ("Other", "other"), + ], isExtensible: true); + + var enumType = EnumProvider.Create(input); + Assert.IsNotNull(enumType.CustomCodeView); + Assert.IsTrue(enumType.CustomCodeView!.Properties.Any(p => p.Name == "Existing_Value")); + + // The generated member keeps its non-underscore name so the custom 'Existing_Value' + // member (which references the generated 'ExistingValue') is preserved. + var content = new TypeProviderWriter(enumType).Write().Content; + Assert.AreEqual(Helpers.GetExpectedFromFile(), content); + } + // Verifies that back-compat does NOT re-introduce enum values that have been suppressed // via [CodeGenSuppress] or that already exist in user-provided custom code. Without // filtering in ProcessTypeForBackCompatibility, the back-compat code would rebuild the diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs new file mode 100644 index 00000000000..7c7184bd735 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Custom)/MockInputEnum.cs @@ -0,0 +1,9 @@ +#nullable disable + +namespace Sample.Models +{ + public readonly partial struct MockInputEnum + { + public static MockInputEnum Existing_Value { get; } = ExistingValue; + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs new file mode 100644 index 00000000000..5df3fb5b33a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores(Last)/MockInputEnum.cs @@ -0,0 +1,10 @@ +#nullable disable + +namespace Sample.Models +{ + public readonly partial struct MockInputEnum + { + public static MockInputEnum Existing_Value { get; } + public static MockInputEnum Other { get; } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores.cs b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores.cs new file mode 100644 index 00000000000..1a44d0e63a9 --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/EnumProviders/TestData/EnumProviderTests/BackCompat_ExtensibleEnumCustomCodeTakesPrecedenceOverPreservedUnderscores.cs @@ -0,0 +1,46 @@ +// + +#nullable disable + +using System; +using System.ComponentModel; +using Sample; + +namespace Sample.Models +{ + public readonly partial struct MockInputEnum : global::System.IEquatable + { + private readonly string _value; + private const string ExistingValueValue = "existing"; + private const string OtherValue = "other"; + + public MockInputEnum(string value) + { + global::Sample.Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + public static global::Sample.Models.MockInputEnum ExistingValue { get; } = new global::Sample.Models.MockInputEnum(ExistingValueValue); + + public static global::Sample.Models.MockInputEnum Other { get; } = new global::Sample.Models.MockInputEnum(OtherValue); + + public static bool operator ==(global::Sample.Models.MockInputEnum left, global::Sample.Models.MockInputEnum right) => left.Equals(right); + + public static bool operator !=(global::Sample.Models.MockInputEnum left, global::Sample.Models.MockInputEnum right) => !left.Equals(right); + + public static implicit operator global::Sample.Models.MockInputEnum(string value) => new global::Sample.Models.MockInputEnum(value); + + public static implicit operator global::Sample.Models.MockInputEnum?(string value) => (value == null) ? null : new global::Sample.Models.MockInputEnum(value); + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) => ((obj is global::Sample.Models.MockInputEnum other) && this.Equals(other)); + + public bool Equals(global::Sample.Models.MockInputEnum other) => string.Equals(_value, other._value, global::System.StringComparison.InvariantCultureIgnoreCase); + + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() => (_value != null) ? global::System.StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + + public override string ToString() => _value; + } +} From 86449bb56c9e68cd0918ef7c380ced17828e9958 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Tue, 21 Jul 2026 10:21:24 +0800 Subject: [PATCH 036/249] fix(http): restore historical linter rule reference doc url (#11320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem The tspd change that auto-generates one reference page per linter rule (#11221) moved the `@typespec/http` linter rule page from its historical location: - **Before:** `https://typespec.io/docs/libraries/http/rules/op-reference-container-route` - **After:** `https://typespec.io/docs/libraries/http/reference/rules/op-reference-container-route` This is a breaking change to the public documentation URL. The rule's own `url` field, external links, and the diagnostic "see documentation" link all still point at the historical `libraries/http/rules/` location, which now 404s. ## Fix Use the `--rules-dir ../rules` option (added in #11316) in http's `regen-docs` script so the per-rule reference pages are written back to `libraries/http/rules/`, restoring the original URL. - `packages/http/package.json` — add `--rules-dir ../rules` to `regen-docs`. - Regenerated docs: the rule page moves back to `libraries/http/rules/op-reference-container-route.md` (100% rename) and `linter.md` links back to `../rules/...`. - `current-sidebar.ts` — re-enable the http "Rules" sidebar group (`hasLinterRules: true`), which autogenerates from `libraries/http/rules`. `@typespec/http` is the only library in this repo that ships linter rules, so no other library is affected. ## Validation - `regen-docs` is stable (running it twice produces no diff). - The restored page URL `libraries/http/rules/op-reference-container-route` matches the rule's hardcoded `url` again. - `chronus verify` passes. Co-authored-by: tadelesh Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md | 7 +++++++ packages/http/package.json | 2 +- website/src/content/current-sidebar.ts | 2 +- .../content/docs/docs/libraries/http/reference/linter.md | 6 +++--- .../{reference => }/rules/op-reference-container-route.md | 0 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md rename website/src/content/docs/docs/libraries/http/{reference => }/rules/op-reference-container-route.md (100%) diff --git a/.chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md b/.chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md new file mode 100644 index 00000000000..3a77c63e914 --- /dev/null +++ b/.chronus/changes/fix-http-linter-rule-doc-url-2026-7-21.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http" +--- + +Keep the generated linter rule reference pages at their historical `libraries/http/rules/` location so existing rule documentation URLs stay stable. diff --git a/packages/http/package.json b/packages/http/package.json index 812e7695015..368611b2d53 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -66,7 +66,7 @@ "test:ci": "vitest run --coverage --reporter=junit --reporter=default", "lint": "oxlint . --deny-warnings", "lint:fix": "oxlint . --fix", - "regen-docs": "tspd doc . --enable-experimental --typekits --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/http/reference" + "regen-docs": "tspd doc . --enable-experimental --typekits --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/http/reference --rules-dir ../rules" }, "files": [ "lib/**/*.tsp", diff --git a/website/src/content/current-sidebar.ts b/website/src/content/current-sidebar.ts index a086939ec4f..c0119ce3ebd 100644 --- a/website/src/content/current-sidebar.ts +++ b/website/src/content/current-sidebar.ts @@ -124,7 +124,7 @@ const sidebar: SidebarItem[] = [ { label: "📚 Libraries", items: [ - createLibraryReferenceStructure("libraries/http", "Http", false, [ + createLibraryReferenceStructure("libraries/http", "Http", true, [ "libraries/http/cheat-sheet", "libraries/http/authentication", "libraries/http/operations", diff --git a/website/src/content/docs/docs/libraries/http/reference/linter.md b/website/src/content/docs/docs/libraries/http/reference/linter.md index f6e795cd91e..d51c365da51 100644 --- a/website/src/content/docs/docs/libraries/http/reference/linter.md +++ b/website/src/content/docs/docs/libraries/http/reference/linter.md @@ -20,6 +20,6 @@ Available ruleSets: ## Rules -| Name | Description | -| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| [`@typespec/http/op-reference-container-route`](./rules/op-reference-container-route.md) | Check for referenced (`op is`) operations which have a @route on one of their containers. | +| Name | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| [`@typespec/http/op-reference-container-route`](../rules/op-reference-container-route.md) | Check for referenced (`op is`) operations which have a @route on one of their containers. | diff --git a/website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md b/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md similarity index 100% rename from website/src/content/docs/docs/libraries/http/reference/rules/op-reference-container-route.md rename to website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md From d012e83129830c7b71a44999c4f3681dcdd9041c Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 21 Jul 2026 11:54:57 +0800 Subject: [PATCH 037/249] Support XML serialization in http-client-java generator (#11305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds XML serialization support to the `@typespec/http-client-java` generator (azure-core v1 flavor). When any model is serialized/deserialized as XML, the generator now: 1. **Emits two helper classes** into the implementation package — `XmlSerializer` (an `ObjectSerializer` backed by `azure-xml` + reflective `fromXml(XmlReader)`) and `XmlSerializerProviders` (factory). Emission is gated on `isAzureV1()` and any generating model with `ClientModel::isUsedInXml`. 2. **Uses the XML serializer overload** in generated convenience methods — a static `SERIALIZER` field is declared on sync/async convenience clients, and `BinaryData.fromObject(input, SERIALIZER)` / `toObject(X.class, SERIALIZER)` are emitted when the request/response content type is XML. The azure-v2 / clientcore flavor handles `XmlSerializable` natively and is unaffected. Non-XML output is unchanged. ## Changes - **Generator core**: new resource templates `XmlSerializer.java` / `XmlSerializerProviders.java`; XML-aware `SupportedMimeType` handling in `ConvenienceMethodTemplateBase`, `ConvenienceSyncMethodTemplate`, `ConvenienceAsyncMethodTemplate`; static `SERIALIZER` field in `ServiceSyncClientTemplate` / `ServiceAsyncClientTemplate`; constants in `ClientModelUtil`. - **Generator plugin**: `TypeSpecPlugin.writeHelperClasses` emits the two helper files for XML models. - **Test module**: enabled the `payload/xml` spec, regenerated clients, and ported the XML test suite. ## Testing - `payload.xml.XmlTests`: **26 run, 0 failures, 2 skipped** (namespace scenarios). - Verified end-to-end: generator rebuild → emitter pack → `tsp compile` → generated output adopted into `src` matches, tests green. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ...-client-java_dpg-xml-2026-6-20-12-47-29.md | 7 + .../http-client-java.instructions.md | 33 + .../ConvenienceAsyncMethodTemplate.java | 20 +- .../ConvenienceMethodTemplateBase.java | 67 +- .../ConvenienceSyncMethodTemplate.java | 23 +- .../template/ServiceAsyncClientTemplate.java | 14 + .../template/ServiceSyncClientTemplate.java | 16 + .../generator/core/util/ClientModelUtil.java | 3 + .../src/main/resources/XmlSerializer.java | 74 ++ .../resources/XmlSerializerProviders.java | 23 + .../http-client-generator-test/Generate.ps1 | 2 +- .../http-client-generator-test/pom.xml | 5 + .../fluent/LargeHeadersClient.java | 8 +- .../LargeHeadersClientImpl.java | 20 +- .../largeheader/models/LargeHeaders.java | 4 +- .../fluent/LroPagingsClient.java | 4 +- .../fluent/LroesClient.java | 32 +- .../implementation/LroPagingsClientImpl.java | 20 +- .../implementation/LroesClientImpl.java | 74 +- .../operationtemplates/models/LroPagings.java | 4 +- .../operationtemplates/models/Lroes.java | 18 +- .../operationtemplates/models/Order.java | 38 +- .../duration/DurationClientBuilder.java | 20 +- .../encode/duration/LossyAsyncClient.java | 10 +- .../java/encode/duration/LossyClient.java | 10 +- .../implementation/DurationClientImpl.java | 20 +- .../duration/implementation/LossiesImpl.java | 10 +- .../implementation/SpecialCharsImpl.java | 6 +- ...ModelWithArrayOfModelValueAsyncClient.java | 145 +++ .../xml/ModelWithArrayOfModelValueClient.java | 141 +++ .../ModelWithAttributesValueAsyncClient.java | 140 +++ .../xml/ModelWithAttributesValueClient.java | 135 +++ .../ModelWithDatetimeValueAsyncClient.java | 138 +++ .../xml/ModelWithDatetimeValueClient.java | 133 +++ .../ModelWithDictionaryValueAsyncClient.java | 140 +++ .../xml/ModelWithDictionaryValueClient.java | 135 +++ .../ModelWithEmptyArrayValueAsyncClient.java | 147 +++ .../xml/ModelWithEmptyArrayValueClient.java | 142 +++ ...ModelWithEncodedNamesValueAsyncClient.java | 149 +++ .../xml/ModelWithEncodedNamesValueClient.java | 143 +++ .../xml/ModelWithEnumValueAsyncClient.java | 136 +++ .../payload/xml/ModelWithEnumValueClient.java | 131 +++ ...NamespaceOnPropertiesValueAsyncClient.java | 141 +++ ...lWithNamespaceOnPropertiesValueClient.java | 136 +++ .../ModelWithNamespaceValueAsyncClient.java | 138 +++ .../xml/ModelWithNamespaceValueClient.java | 133 +++ .../ModelWithNestedModelValueAsyncClient.java | 142 +++ .../xml/ModelWithNestedModelValueClient.java | 137 +++ ...odelWithOptionalFieldValueAsyncClient.java | 137 +++ .../ModelWithOptionalFieldValueClient.java | 133 +++ ...odelWithRenamedArraysValueAsyncClient.java | 147 +++ .../ModelWithRenamedArraysValueClient.java | 143 +++ ...lWithRenamedAttributeValueAsyncClient.java | 140 +++ .../ModelWithRenamedAttributeValueClient.java | 135 +++ ...odelWithRenamedFieldsValueAsyncClient.java | 145 +++ .../ModelWithRenamedFieldsValueClient.java | 140 +++ ...ithRenamedNestedModelValueAsyncClient.java | 140 +++ ...odelWithRenamedNestedModelValueClient.java | 135 +++ ...elWithRenamedPropertyValueAsyncClient.java | 138 +++ .../ModelWithRenamedPropertyValueClient.java | 133 +++ ...edUnwrappedModelArrayValueAsyncClient.java | 148 +++ ...RenamedUnwrappedModelArrayValueClient.java | 142 +++ ...ppedAndItemModelArrayValueAsyncClient.java | 147 +++ ...edWrappedAndItemModelArrayValueClient.java | 141 +++ ...amedWrappedModelArrayValueAsyncClient.java | 148 +++ ...thRenamedWrappedModelArrayValueClient.java | 141 +++ ...ModelWithSimpleArraysValueAsyncClient.java | 146 +++ .../xml/ModelWithSimpleArraysValueClient.java | 141 +++ .../xml/ModelWithTextValueAsyncClient.java | 138 +++ .../payload/xml/ModelWithTextValueClient.java | 133 +++ ...delWithUnwrappedArrayValueAsyncClient.java | 147 +++ .../ModelWithUnwrappedArrayValueClient.java | 141 +++ ...thUnwrappedModelArrayValueAsyncClient.java | 146 +++ ...delWithUnwrappedModelArrayValueClient.java | 141 +++ ...mitiveCustomItemNamesValueAsyncClient.java | 143 +++ ...edPrimitiveCustomItemNamesValueClient.java | 137 +++ .../xml/SimpleModelValueAsyncClient.java | 138 +++ .../payload/xml/SimpleModelValueClient.java | 133 +++ .../java/payload/xml/XmlClientBuilder.java | 857 ++++++++++++++++++ .../payload/xml/XmlErrorValueAsyncClient.java | 91 ++ .../java/payload/xml/XmlErrorValueClient.java | 87 ++ .../ModelWithArrayOfModelValuesImpl.java | 222 +++++ .../ModelWithAttributesValuesImpl.java | 211 +++++ .../ModelWithDatetimeValuesImpl.java | 207 +++++ .../ModelWithDictionaryValuesImpl.java | 211 +++++ .../ModelWithEmptyArrayValuesImpl.java | 224 +++++ .../ModelWithEncodedNamesValuesImpl.java | 227 +++++ .../ModelWithEnumValuesImpl.java | 203 +++++ ...elWithNamespaceOnPropertiesValuesImpl.java | 212 +++++ .../ModelWithNamespaceValuesImpl.java | 207 +++++ .../ModelWithNestedModelValuesImpl.java | 215 +++++ .../ModelWithOptionalFieldValuesImpl.java | 206 +++++ .../ModelWithRenamedArraysValuesImpl.java | 224 +++++ .../ModelWithRenamedAttributeValuesImpl.java | 211 +++++ .../ModelWithRenamedFieldsValuesImpl.java | 220 +++++ ...ModelWithRenamedNestedModelValuesImpl.java | 211 +++++ .../ModelWithRenamedPropertyValuesImpl.java | 207 +++++ ...hRenamedUnwrappedModelArrayValuesImpl.java | 223 +++++ ...medWrappedAndItemModelArrayValuesImpl.java | 220 +++++ ...ithRenamedWrappedModelArrayValuesImpl.java | 223 +++++ .../ModelWithSimpleArraysValuesImpl.java | 223 +++++ .../ModelWithTextValuesImpl.java | 207 +++++ .../ModelWithUnwrappedArrayValuesImpl.java | 223 +++++ ...odelWithUnwrappedModelArrayValuesImpl.java | 223 +++++ ...pedPrimitiveCustomItemNamesValuesImpl.java | 212 +++++ .../implementation/SimpleModelValuesImpl.java | 207 +++++ .../xml/implementation/XmlClientImpl.java | 484 ++++++++++ .../implementation/XmlErrorValuesImpl.java | 131 +++ .../xml/implementation/XmlSerializer.java | 78 ++ .../XmlSerializerProviders.java | 29 + .../xml/implementation/package-info.java | 11 + .../main/java/payload/xml/models/Author.java | 105 +++ .../main/java/payload/xml/models/Book.java | 105 +++ .../xml/models/ModelWithArrayOfModel.java | 128 +++ .../xml/models/ModelWithAttributes.java | 146 +++ .../payload/xml/models/ModelWithDatetime.java | 143 +++ .../xml/models/ModelWithDictionary.java | 119 +++ .../xml/models/ModelWithEmptyArray.java | 128 +++ .../xml/models/ModelWithEncodedNames.java | 150 +++ .../payload/xml/models/ModelWithEnum.java | 105 +++ .../xml/models/ModelWithNamespace.java | 130 +++ .../ModelWithNamespaceOnProperties.java | 160 ++++ .../xml/models/ModelWithNestedModel.java | 106 +++ .../xml/models/ModelWithOptionalField.java | 142 +++ .../xml/models/ModelWithRenamedArrays.java | 159 ++++ .../xml/models/ModelWithRenamedAttribute.java | 149 +++ .../xml/models/ModelWithRenamedFields.java | 129 +++ .../models/ModelWithRenamedNestedModel.java | 107 +++ .../xml/models/ModelWithRenamedProperty.java | 129 +++ .../ModelWithRenamedUnwrappedModelArray.java | 118 +++ ...elWithRenamedWrappedAndItemModelArray.java | 132 +++ .../ModelWithRenamedWrappedModelArray.java | 131 +++ .../xml/models/ModelWithSimpleArrays.java | 169 ++++ .../payload/xml/models/ModelWithText.java | 114 +++ .../xml/models/ModelWithUnwrappedArray.java | 158 ++++ .../models/ModelWithUnwrappedModelArray.java | 116 +++ ...elWithWrappedPrimitiveCustomItemNames.java | 132 +++ .../java/payload/xml/models/SimpleModel.java | 127 +++ .../main/java/payload/xml/models/Status.java | 63 ++ .../java/payload/xml/models/package-info.java | 11 + .../main/java/payload/xml/package-info.java | 11 + ...etersQueryExpansionExplodeAsyncClient.java | 18 +- ...ParametersQueryExpansionExplodeClient.java | 18 +- ...yParametersQueryExpansionExplodesImpl.java | 18 +- .../ChildResourcesInterfacesClient.java | 64 +- .../fluent/LroNoBodiesClient.java | 28 +- .../TopLevelArmResourceInterfacesClient.java | 78 +- .../ChildResourcesInterfacesClientImpl.java | 90 +- .../implementation/LroNoBodiesClientImpl.java | 38 +- ...pLevelArmResourceInterfacesClientImpl.java | 116 +-- .../models/ChildResource.java | 50 +- .../models/ChildResourcesInterfaces.java | 26 +- .../models/LroNoBodies.java | 8 +- .../models/TopLevelArmResource.java | 80 +- .../models/TopLevelArmResourceInterfaces.java | 34 +- .../META-INF/payload-xml_metadata.json | 1 + ...t-multipleclientssameversion_metadata.json | 2 +- .../src/main/resources/payload-xml.properties | 2 + .../src/test/java/payload/xml/XmlTests.java | 359 ++++++++ .../xml/generated/XmlClientTestBase.java | 350 +++++++ .../http/client/generator/TypeSpecPlugin.java | 10 + 161 files changed, 19235 insertions(+), 508 deletions(-) create mode 100644 .chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md create mode 100644 packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializer.java create mode 100644 packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/package-info.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java diff --git a/.chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md b/.chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md new file mode 100644 index 00000000000..084614f6742 --- /dev/null +++ b/.chronus/changes/http-client-java_dpg-xml-2026-6-20-12-47-29.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/http-client-java" +--- + +Support XML serialization for models: generate XmlSerializer helper classes and use the XML ObjectSerializer overload of toObject/fromObject in convenience methods for XML request/response bodies. \ No newline at end of file diff --git a/.github/instructions/http-client-java.instructions.md b/.github/instructions/http-client-java.instructions.md index 1a99d2ff6a7..5dd01219f75 100644 --- a/.github/instructions/http-client-java.instructions.md +++ b/.github/instructions/http-client-java.instructions.md @@ -56,3 +56,36 @@ Typical task: `add e2e test case for , scenario is `. # Add feature or fix bug - Run `npm run format` and commit the formatted code before finalizing. Do not include any other changes in the commit. +- Add a changelog entry: `pnpm change add @typespec/http-client-java --kind= --message=""` (use `feature` for new features, `fix` for bug fixes). Commit the new md file in the ".chronus" folder of the repository root. + +# Modify the code generator (emitter + generator e2e loop) + +Use this workflow when a change requires modifying how client code is generated (not just adding tests). + +The code generator has two connected parts, linked by a `code-model.yaml`: + +- `emitter/` — TypeScript. Consumes the TypeSpec compiler output and produces `code-model.yaml`. +- `generator/` — Java. Consumes `code-model.yaml` and emits the Java client source. + +After a compile, inspect `tsp-output/**/code-model.yaml` in the test module to see what the emitter passed to the generator. + +## Edit → update emitter → test loop + +1. Make the emitter (TypeScript) and/or generator (Java) changes. +2. Ensure the generator compiles: `mvn clean install --define spotless:skip --define skipTests --no-transfer-progress -T 1C -f ./generator/pom.xml` (from `/packages/http-client-java`). +3. Ensure the emitter builds: `npm run build:emitter`. +4. Format Java with `mvn spotless:apply --no-transfer-progress -T 1C --activate-profiles test -f ./generator/pom.xml` and TypeScript via `npm run format`. +5. Run `pwsh Setup.ps1` in `generator/http-client-generator-test`. This packs the emitter (bundling the freshly built generator jar) and installs it into the test module. Re-run it after every generator/emitter change you want reflected in generation. +6. Regenerate by compiling a spec. Do NOT hardcode the TypeSpec file name — it varies per feature, and sometimes you must author a new `/main.tsp` first. The test module's `tspconfig.yaml` already configures the emitter and its output dir, so a plain compile is enough; output goes to `tsp-output/`: + `npx tsp compile ` + (Optionally add `--option "@typespec/http-client-java.emitter-output-dir=$PWD/tsp-output/"` to isolate output into a subfolder for an easier diff.) +7. Verify the generated code under `tsp-output/**/src` is as expected. When the spec corresponds to sources tracked in `src/main/java`, compare against them and, if correct, copy the generated files into `src` (replacing existing files) but EXCLUDE `module-info.java`. Some specs do not map to `src` — in that case just verify the output, without comparing or copying. +8. When the spec maps to `src` and you copied the generated code in, run the tests (`mvn test`, or a targeted `--define "test=."`). Restart the Spector server if needed (`npm run spector-stop` then `npm run spector-start`). If the spec does not map to `src`, verifying the generated output (step 7) is sufficient. + +## Emitting static helper classes from resource templates + +Some helpers are shipped verbatim as resource templates rather than built up in code: + +- `generator/http-client-generator/src/main/java/.../TypeSpecPlugin.java` — `writeHelperClasses(...)` emits per-client helper classes into the implementation subpackage via `JavaPackage.addJavaFromResources(packageName, resourceName[, fileName])`. +- Resource templates live under `generator/http-client-generator-core/src/main/resources/*.java` and must START with `import` statements — do NOT include a `package` line or the license header. The file factory injects the license header, the `package` statement, and reorders imports. The class name must match the resource/file name. +- Class-name constants live in `generator/http-client-generator-core/src/main/java/.../util/ClientModelUtil.java`. diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java index c2e26fa9886..d570ae7e08e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceAsyncMethodTemplate.java @@ -146,7 +146,7 @@ private String expressionConvertFromBinaryData(IType responseBodyType, IType raw private String expressionMapFromBinaryData(IType responseBodyType, IType rawType, Set mediaTypes, Set typeReferenceStaticClasses) { SupportedMimeType mimeType = SupportedMimeType.getResponseKnownMimeType(mediaTypes); - // TODO (weidxu): support XML etc. + String serializerArgument = xmlSerializerArgument(mimeType); switch (mimeType) { case TEXT: String baseHandling = "protocolMethodData.toString()"; @@ -161,16 +161,17 @@ private String expressionMapFromBinaryData(IType responseBodyType, IType rawType return null; default: - // JSON etc. + // JSON, XML etc. if (responseBodyType instanceof EnumType) { // enum - return String.format("protocolMethodData -> %1$s.from%2$s(protocolMethodData.toObject(%2$s.class))", - responseBodyType, ((EnumType) responseBodyType).getElementType()); + return String.format( + "protocolMethodData -> %1$s.from%2$s(protocolMethodData.toObject(%2$s.class%3$s))", + responseBodyType, ((EnumType) responseBodyType).getElementType(), serializerArgument); } else if (responseBodyType instanceof GenericType) { // generic, e.g. list, map typeReferenceStaticClasses.add((GenericType) responseBodyType); - return String.format("protocolMethodData -> protocolMethodData.toObject(%1$s)", - TemplateUtil.getTypeReferenceCreation(responseBodyType)); + return String.format("protocolMethodData -> protocolMethodData.toObject(%1$s%2$s)", + TemplateUtil.getTypeReferenceCreation(responseBodyType), serializerArgument); } else if (responseBodyType == ClassType.BINARY_DATA) { // BinaryData, no need to do the map in expressionConvertFromBinaryData return null; @@ -178,14 +179,15 @@ private String expressionMapFromBinaryData(IType responseBodyType, IType rawType // byte[] if (rawType == ClassType.BASE_64_URL) { return "protocolMethodData -> protocolMethodData.toObject(" + ClassType.BASE_64_URL.getName() - + ".class).decodedBytes()"; + + ".class" + serializerArgument + ").decodedBytes()"; } else { - return "protocolMethodData -> protocolMethodData.toObject(byte[].class)"; + return "protocolMethodData -> protocolMethodData.toObject(byte[].class" + serializerArgument + + ")"; } } else { // default, treat as class return "protocolMethodData -> protocolMethodData.toObject(" + responseBodyType.asNullable() - + ".class)"; + + ".class" + serializerArgument + ")"; } } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java index 6ec3aa6f12b..4190388e18a 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceMethodTemplateBase.java @@ -62,9 +62,66 @@ abstract class ConvenienceMethodTemplateBase { + // Name of the static ObjectSerializer member used for XML serialization on the convenience client. + static final String XML_SERIALIZER_MEMBER_NAME = "SERIALIZER"; + protected ConvenienceMethodTemplateBase() { } + /** + * Whether the XML {@link com.azure.core.util.serializer.ObjectSerializer} overload should be used for the given + * MIME type. XML serialization via an explicit serializer is only required for the azure-core (v1) flavor. + * + * @param mimeType the MIME type. + * @return whether to use the XML serializer overload of {@code toObject}/{@code fromObject}. + */ + static boolean useXmlObjectSerializer(SupportedMimeType mimeType) { + return mimeType == SupportedMimeType.XML && JavaSettings.getInstance().isAzureV1(); + } + + /** + * The additional argument (e.g. {@code ", SERIALIZER"}) to append to {@code toObject}/{@code fromObject} calls when + * the XML serializer overload should be used, or an empty string otherwise. + * + * @param mimeType the MIME type. + * @return the serializer argument, possibly empty. + */ + static String xmlSerializerArgument(SupportedMimeType mimeType) { + return useXmlObjectSerializer(mimeType) ? ", " + XML_SERIALIZER_MEMBER_NAME : ""; + } + + /** + * Whether any of the convenience methods requires XML serialization (request or response). Used to decide whether + * the convenience client needs a static XML serializer member. Only applicable to the azure-core (v1) flavor. + * + * @param convenienceMethods the convenience methods on the client. + * @return whether a static XML serializer member is required. + */ + public boolean useXmlSerializerMember(Collection convenienceMethods) { + if (!JavaSettings.getInstance().isAzureV1() || convenienceMethods == null) { + return false; + } + for (ConvenienceMethod convenienceMethod : convenienceMethods) { + if (!isMethodIncluded(convenienceMethod)) { + continue; + } + // getResponseKnownMimeType simply parses a MIME string, so it is reused here for the request content type. + String requestContentType = convenienceMethod.getProtocolMethod().getProxyMethod().getRequestContentType(); + if (requestContentType != null + && SupportedMimeType.getResponseKnownMimeType(List.of(requestContentType)) == SupportedMimeType.XML) { + return true; + } + Set responseContentTypes + = convenienceMethod.getProtocolMethod().getProxyMethod().getResponseContentTypes(); + if (responseContentTypes != null + && !responseContentTypes.isEmpty() + && SupportedMimeType.getResponseKnownMimeType(responseContentTypes) == SupportedMimeType.XML) { + return true; + } + } + return false; + } + public void write(ConvenienceMethod convenienceMethodObj, JavaClass classBlock, Set typeReferenceStaticClasses) { if (!isMethodIncluded(convenienceMethodObj)) { @@ -569,17 +626,19 @@ private static String expressionConvertToBinaryData(String name, IType type, Str return name; default: - // JSON etc. + // JSON, XML etc. + String serializerArgument = xmlSerializerArgument(mimeType); if (type == ClassType.BINARY_DATA) { return name; } else { if (type == ClassType.BASE_64_URL) { - return "BinaryData.fromObject(" + ClassType.BASE_64_URL.getName() + ".encode(" + name + "))"; + return "BinaryData.fromObject(" + ClassType.BASE_64_URL.getName() + ".encode(" + name + ")" + + serializerArgument + ")"; } else if (type instanceof EnumType) { return "BinaryData.fromObject(" + name + " == null ? null : " + name + "." - + ((EnumType) type).getToMethodName() + "())"; + + ((EnumType) type).getToMethodName() + "()" + serializerArgument + ")"; } else { - return "BinaryData.fromObject(" + name + ")"; + return "BinaryData.fromObject(" + name + serializerArgument + ")"; } } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java index a164dbb9ed4..31077ede545 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ConvenienceSyncMethodTemplate.java @@ -205,7 +205,7 @@ private boolean isResponseBase(IType type) { private String expressionConvertFromBinaryData(IType responseBodyType, IType rawType, String invocationExpression, Set mediaTypes, Set typeReferenceStaticClasses) { SupportedMimeType mimeType = SupportedMimeType.getResponseKnownMimeType(mediaTypes); - // TODO (weidxu): support XML etc. + String serializerArgument = xmlSerializerArgument(mimeType); switch (mimeType) { case TEXT: String basicText = invocationExpression + ".toString()"; @@ -219,32 +219,33 @@ private String expressionConvertFromBinaryData(IType responseBodyType, IType raw return invocationExpression; default: - // JSON etc. + // JSON, XML etc. if (responseBodyType instanceof EnumType) { // enum IType elementType = ((EnumType) responseBodyType).getElementType(); - return String.format("%1$s.from%2$s(%3$s.toObject(%2$s.class))", responseBodyType, elementType, - invocationExpression); + return String.format("%1$s.from%2$s(%3$s.toObject(%2$s.class%4$s))", responseBodyType, elementType, + invocationExpression, serializerArgument); } else if (responseBodyType instanceof GenericType) { // generic, e.g. List, Map typeReferenceStaticClasses.add((GenericType) responseBodyType); - return String.format("%2$s.toObject(%1$s)", TemplateUtil.getTypeReferenceCreation(responseBodyType), - invocationExpression); + return String.format("%2$s.toObject(%1$s%3$s)", + TemplateUtil.getTypeReferenceCreation(responseBodyType), invocationExpression, + serializerArgument); } else if (responseBodyType == ClassType.BINARY_DATA) { // BinaryData return invocationExpression; } else if (responseBodyType == ArrayType.BYTE_ARRAY) { // byte[] if (rawType == ClassType.BASE_64_URL) { - return invocationExpression + ".toObject(" + ClassType.BASE_64_URL.getName() - + ".class).decodedBytes()"; + return invocationExpression + ".toObject(" + ClassType.BASE_64_URL.getName() + ".class" + + serializerArgument + ").decodedBytes()"; } else { - return invocationExpression + ".toObject(byte[].class)"; + return invocationExpression + ".toObject(byte[].class" + serializerArgument + ")"; } } else { // default, treat as class - return String.format("%2$s.toObject(%1$s.class)", responseBodyType.asNullable(), - invocationExpression); + return String.format("%2$s.toObject(%1$s.class%3$s)", responseBodyType.asNullable(), + invocationExpression, serializerArgument); } } } 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 8d1faf6a3a9..73b969778e3 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 @@ -80,6 +80,14 @@ public final void write(AsyncSyncClient asyncClient, JavaFile javaFile) { Templates.getConvenienceAsyncMethodTemplate().addImports(imports, asyncClient.getConvenienceMethods()); + final boolean useXmlSerializer + = Templates.getConvenienceAsyncMethodTemplate().useXmlSerializerMember(asyncClient.getConvenienceMethods()); + if (useXmlSerializer) { + imports.add("com.azure.core.util.serializer.ObjectSerializer"); + imports.add(settings.getPackage(settings.getImplementationSubpackage()) + "." + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); + } + javaFile.declareImport(imports); javaFile.javadocComment(comment -> comment.description(String .format("Initializes a new instance of the asynchronous %1$s type.", serviceClient.getInterfaceName()))); @@ -90,6 +98,12 @@ public final void write(AsyncSyncClient asyncClient, JavaFile javaFile) { } javaFile.publicFinalClass(asyncClassName, classBlock -> { // Add service client member variable + if (useXmlSerializer) { + addGeneratedAnnotation(classBlock); + classBlock.privateStaticFinalVariable( + "ObjectSerializer " + ConvenienceMethodTemplateBase.XML_SERIALIZER_MEMBER_NAME + " = " + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME + ".createInstance()"); + } addGeneratedAnnotation(classBlock); if (wrapServiceClient) { classBlock.privateFinalMemberVariable(serviceClient.getClassName(), "serviceClient"); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java index 8e58d6a261a..4ed313de35e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceSyncClientTemplate.java @@ -73,6 +73,12 @@ public final void write(AsyncSyncClient syncClient, JavaFile javaFile) { Templates.getConvenienceSyncMethodTemplate().addImports(imports, syncClient.getConvenienceMethods()); + if (useXmlSerializerMember(syncClient)) { + imports.add("com.azure.core.util.serializer.ObjectSerializer"); + imports.add(settings.getPackage(settings.getImplementationSubpackage()) + "." + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); + } + if (!JavaSettings.getInstance().isAzureV1()) { ClassType.INSTRUMENTATION.addImportsTo(imports, false); ClassType.SDK_INSTRUMENTATION_OPTIONS.addImportsTo(imports, false); @@ -107,6 +113,12 @@ protected void writeClass(AsyncSyncClient syncClient, JavaClass classBlock, Java final boolean wrapServiceClient = methodGroupClient == null; // Add service client member + if (useXmlSerializerMember(syncClient)) { + addGeneratedAnnotation(classBlock); + classBlock.privateStaticFinalVariable( + "ObjectSerializer " + ConvenienceMethodTemplateBase.XML_SERIALIZER_MEMBER_NAME + " = " + + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME + ".createInstance()"); + } addGeneratedAnnotation(classBlock); if (wrapServiceClient) { classBlock.privateFinalMemberVariable(serviceClient.getClassName(), "serviceClient"); @@ -206,6 +218,10 @@ protected void addGeneratedAnnotation(JavaContext classBlock) { classBlock.annotation(Annotation.GENERATED.getName()); } + private static boolean useXmlSerializerMember(AsyncSyncClient syncClient) { + return Templates.getConvenienceSyncMethodTemplate().useXmlSerializerMember(syncClient.getConvenienceMethods()); + } + private void writeConvenienceMethods(List convenienceMethods, JavaClass classBlock) { Set typeReferenceStaticClasses = new LinkedHashSet<>(); 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 80cd040e55b..8489f847137 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 @@ -57,6 +57,9 @@ public class ClientModelUtil { public static final String MULTI_PART_FORM_DATA_HELPER_CLASS_NAME = "MultipartFormDataHelper"; public static final String GENERIC_MULTI_PART_FORM_DATA_HELPER_CLASS_NAME = "GenericMultipartFormDataHelper"; + public static final String XML_SERIALIZER_CLASS_NAME = "XmlSerializer"; + public static final String XML_SERIALIZER_PROVIDERS_CLASS_NAME = "XmlSerializerProviders"; + private static final Pattern SPLIT_FLATTEN_PROPERTY_PATTERN = Pattern.compile("((?, Method> FROM_XML_CACHE = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("unchecked") + public T deserialize(InputStream stream, TypeReference typeReference) { + Class clazz = (Class) typeReference.getJavaClass(); + Method fromXml = FROM_XML_CACHE.computeIfAbsent(clazz, c -> { + try { + return c.getDeclaredMethod("fromXml", XmlReader.class); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + "Type " + c.getName() + " does not have a static fromXml(XmlReader) method.", e); + } + }); + try (XmlReader xmlReader = XmlReader.fromStream(stream)) { + return (T) fromXml.invoke(null, xmlReader); + } catch (XMLStreamException | IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause() == null ? e : e.getCause()); + } + } + + @Override + public Mono deserializeAsync(InputStream stream, TypeReference typeReference) { + return Mono.fromCallable(() -> deserialize(stream, typeReference)); + } + + @Override + public void serialize(OutputStream stream, Object value) { + if (!(value instanceof XmlSerializable)) { + throw new IllegalArgumentException( + "Value must implement XmlSerializable to be serialized as XML, but was: " + + (value == null ? "null" : value.getClass().getName())); + } + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + xmlWriter.writeStartDocument(); + xmlWriter.writeXml((XmlSerializable) value); + xmlWriter.flush(); + } catch (XMLStreamException e) { + throw new UncheckedIOException(new IOException(e)); + } + } + + @Override + public Mono serializeAsync(OutputStream stream, Object value) { + return Mono.fromRunnable(() -> serialize(stream, value)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java b/packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java new file mode 100644 index 00000000000..4fedd5fcffa --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/resources/XmlSerializerProviders.java @@ -0,0 +1,23 @@ +import com.azure.core.util.serializer.ObjectSerializer; + +// DO NOT modify this helper class + +/** + * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using + * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. + */ +public final class XmlSerializerProviders { + + /** + * Creates an instance of an XML {@link ObjectSerializer}. + * + * @return A new instance of an XML {@link ObjectSerializer}. + */ + public static ObjectSerializer createInstance() { + return new XmlSerializer(); + } + + private XmlSerializerProviders() { + // no-op + } +} 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 a2fe1389a67..fcfd434dd35 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 @@ -19,7 +19,7 @@ Write-Host "Parallelization: $Parallelization" $generateScript = { $tspFile = $_ - if ((($tspFile -match "payload[\\/]pageable[\\/]main\.tsp") -and (-not ($tspFile -match "azure[\\/]payload[\\/]pageable[\\/]main\.tsp"))) -or ($tspFile -match "payload[\\/]xml[\\/]main\.tsp")) { + if ((($tspFile -match "payload[\\/]pageable[\\/]main\.tsp") -and (-not ($tspFile -match "azure[\\/]payload[\\/]pageable[\\/]main\.tsp")))) { Write-Host " SKIPPED $tspFile diff --git a/packages/http-client-java/generator/http-client-generator-test/pom.xml b/packages/http-client-java/generator/http-client-generator-test/pom.xml index 7f514ce2cd3..a67b1f61bc1 100644 --- a/packages/http-client-java/generator/http-client-generator-test/pom.xml +++ b/packages/http-client-java/generator/http-client-generator-test/pom.xml @@ -35,6 +35,11 @@ azure-xml 1.2.1 + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + 2.18.7 + com.azure azure-core-test diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java index 0643f9b4f58..e550a85514c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/fluent/LargeHeadersClient.java @@ -17,7 +17,7 @@ public interface LargeHeadersClient { /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +31,7 @@ SyncPoller, CancelResultInner> beginTwo6k(String r /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -46,7 +46,7 @@ SyncPoller, CancelResultInner> beginTwo6k(String r /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -59,7 +59,7 @@ SyncPoller, CancelResultInner> beginTwo6k(String r /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java index 64190f72e4c..424b24424af 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/implementation/LargeHeadersClientImpl.java @@ -47,7 +47,7 @@ public final class LargeHeadersClientImpl implements LargeHeadersClient { /** * Initializes an instance of LargeHeadersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LargeHeadersClientImpl(LargeHeaderClientImpl client) { @@ -86,7 +86,7 @@ Response two6kSync(@HostParam("endpoint") String endpoint, /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -105,7 +105,7 @@ private Mono>> two6kWithResponseAsync(String resourceG /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +122,7 @@ private Response two6kWithResponse(String resourceGroupName, String /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -140,7 +140,7 @@ private Response two6kWithResponse(String resourceGroupName, String /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,7 +158,7 @@ private PollerFlux, CancelResultInner> beginTwo6kA /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -176,7 +176,7 @@ public SyncPoller, CancelResultInner> beginTwo6k(S /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. @@ -195,7 +195,7 @@ public SyncPoller, CancelResultInner> beginTwo6k(S /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -211,7 +211,7 @@ private Mono two6kAsync(String resourceGroupName, String larg /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -226,7 +226,7 @@ public CancelResultInner two6k(String resourceGroupName, String largeHeaderName) /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java index b07c442552f..9cb0b0a212e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/largeheader/models/LargeHeaders.java @@ -12,7 +12,7 @@ public interface LargeHeaders { /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +24,7 @@ public interface LargeHeaders { /** * The two6k operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param largeHeaderName The name of the LargeHeader. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java index 0c3baa5636a..f3940053347 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroPagingsClient.java @@ -16,7 +16,7 @@ public interface LroPagingsClient { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +29,7 @@ public interface LroPagingsClient { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. 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 index 039f5a4ce6d..11a2184a407 100644 --- 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 @@ -20,7 +20,7 @@ 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. @@ -36,7 +36,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * 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. @@ -53,7 +53,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * 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. @@ -67,7 +67,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * 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. @@ -82,7 +82,7 @@ SyncPoller, OrderInner> beginCreateOrReplace(String resou /** * The export operation. - * + * * @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. @@ -97,7 +97,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The export operation. - * + * * @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. @@ -113,7 +113,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The export operation. - * + * * @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. @@ -127,7 +127,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The export operation. - * + * * @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. @@ -142,7 +142,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -155,7 +155,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -169,7 +169,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -181,7 +181,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * 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. @@ -194,7 +194,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -206,7 +206,7 @@ SyncPoller, ExportResultInner> beginExport(String /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -220,7 +220,7 @@ SyncPoller>, List> beginEx /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -232,7 +232,7 @@ SyncPoller>, List> beginEx /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java index 7e2f603bb65..f9f8bf7316d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroPagingsClientImpl.java @@ -50,7 +50,7 @@ public final class LroPagingsClientImpl implements LroPagingsClient { /** * Initializes an instance of LroPagingsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroPagingsClientImpl(OperationTemplatesClientImpl client) { @@ -103,7 +103,7 @@ Response postPagingLroNextSync( /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +137,7 @@ private Mono> postPagingLroSinglePageAsync(String re /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,7 +153,7 @@ private PagedFlux postPagingLroAsync(String resourceGroupName, Str /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -176,7 +176,7 @@ private PagedResponse postPagingLroSinglePage(String resourceGroup /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. @@ -201,7 +201,7 @@ private PagedResponse postPagingLroSinglePage(String resourceGroup /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -217,7 +217,7 @@ public PagedIterable postPagingLro(String resourceGroupName, Strin /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. @@ -234,7 +234,7 @@ public PagedIterable postPagingLro(String resourceGroupName, Strin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -254,7 +254,7 @@ private Mono> postPagingLroNextSinglePageAsync(Strin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -272,7 +272,7 @@ private PagedResponse postPagingLroNextSinglePage(String nextLink) /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 52d40164eaa..ac00784d002 100644 --- 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 @@ -54,7 +54,7 @@ public final class LroesClientImpl implements LroesClient { /** * Initializes an instance of LroesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroesClientImpl(OperationTemplatesClientImpl client) { @@ -142,7 +142,7 @@ Response exportArraySync(@HostParam("endpoint") String endpoint, /** * 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. @@ -165,7 +165,7 @@ private Mono>> createOrReplaceWithResponseAsync(String /** * 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. @@ -186,7 +186,7 @@ private Response createOrReplaceWithResponse(String resourceGroupNam /** * 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. @@ -208,7 +208,7 @@ private Response createOrReplaceWithResponse(String resourceGroupNam /** * 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. @@ -229,7 +229,7 @@ private PollerFlux, OrderInner> beginCreateOrReplaceAsync /** * 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. @@ -249,7 +249,7 @@ public SyncPoller, OrderInner> beginCreateOrReplace(Strin /** * 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. @@ -269,7 +269,7 @@ public SyncPoller, OrderInner> beginCreateOrReplace(Strin /** * 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. @@ -287,7 +287,7 @@ private Mono createOrReplaceAsync(String resourceGroupName, String o /** * 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. @@ -303,7 +303,7 @@ public OrderInner createOrReplace(String resourceGroupName, String orderName, Or /** * 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. @@ -321,7 +321,7 @@ public OrderInner createOrReplace(String resourceGroupName, String orderName, Or /** * The export operation. - * + * * @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. @@ -343,7 +343,7 @@ private Mono>> exportWithResponseAsync(String resource /** * The export operation. - * + * * @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. @@ -362,7 +362,7 @@ private Response exportWithResponse(String resourceGroupName, String /** * The export operation. - * + * * @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. @@ -383,7 +383,7 @@ private Response exportWithResponse(String resourceGroupName, String /** * The export operation. - * + * * @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. @@ -402,7 +402,7 @@ private PollerFlux, ExportResultInner> beginExport /** * The export operation. - * + * * @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. @@ -421,7 +421,7 @@ public SyncPoller, ExportResultInner> beginExport( /** * The export operation. - * + * * @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. @@ -441,7 +441,7 @@ public SyncPoller, ExportResultInner> beginExport( /** * The export operation. - * + * * @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. @@ -458,7 +458,7 @@ private Mono exportAsync(String resourceGroupName, String ord /** * The export operation. - * + * * @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. @@ -474,7 +474,7 @@ public ExportResultInner export(String resourceGroupName, String orderName, Expo /** * The export operation. - * + * * @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. @@ -491,7 +491,7 @@ public ExportResultInner export(String resourceGroupName, String orderName, Expo /** * 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. @@ -509,7 +509,7 @@ private Mono>> deleteWithResponseAsync(String resource /** * 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. @@ -525,7 +525,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * 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. @@ -542,7 +542,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * 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. @@ -559,7 +559,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * 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. @@ -575,7 +575,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -592,7 +592,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * 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. @@ -607,7 +607,7 @@ private Mono deleteAsync(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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -621,7 +621,7 @@ public 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. @@ -636,7 +636,7 @@ public void delete(String resourceGroupName, String orderName, Context context) /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -655,7 +655,7 @@ private Mono>> exportArrayWithResponseAsync(ExportRequ /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -672,7 +672,7 @@ private Response exportArrayWithResponse(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -690,7 +690,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -709,7 +709,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -728,7 +728,7 @@ private Response exportArrayWithResponse(ExportRequest body, Context /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -748,7 +748,7 @@ public SyncPoller>, List> /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -762,7 +762,7 @@ private Mono> exportArrayAsync(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -776,7 +776,7 @@ public List exportArray(ExportRequest body) { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java index 1aee18a2904..bb4bbd2c4d3 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/LroPagings.java @@ -13,7 +13,7 @@ public interface LroPagings { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -25,7 +25,7 @@ public interface LroPagings { /** * The postPagingLro operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param productName The name of the Product. * @param context The context to associate with this operation. 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 index b7806be61da..047b2f96cc5 100644 --- 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 @@ -13,7 +13,7 @@ public interface Lroes { /** * The export operation. - * + * * @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. @@ -26,7 +26,7 @@ public interface Lroes { /** * The export operation. - * + * * @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. @@ -40,7 +40,7 @@ public interface Lroes { /** * 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. @@ -51,7 +51,7 @@ public interface Lroes { /** * 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. @@ -63,7 +63,7 @@ public interface Lroes { /** * The exportArray operation. - * + * * @param body The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -74,7 +74,7 @@ public interface Lroes { /** * The exportArray operation. - * + * * @param body The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -86,7 +86,7 @@ public interface Lroes { /** * 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. @@ -96,7 +96,7 @@ public interface Lroes { /** * 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. @@ -107,7 +107,7 @@ public interface Lroes { /** * Begins definition for a new Order resource. - * + * * @param name resource name. * @return the first stage of the new Order definition. */ 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 index 26cc9f8300a..0a4befe0aba 100644 --- 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 @@ -16,70 +16,70 @@ 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(); @@ -107,7 +107,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -115,7 +115,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -128,7 +128,7 @@ interface WithLocation { interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -142,14 +142,14 @@ interface WithResourceGroup { 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. */ @@ -162,7 +162,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithPro interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -175,7 +175,7 @@ interface WithTags { 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. */ @@ -185,7 +185,7 @@ interface WithProperties { /** * The export operation. - * + * * @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. @@ -196,7 +196,7 @@ interface WithProperties { /** * The export operation. - * + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java index f1903a68876..1e296aab372 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/DurationClientBuilder.java @@ -206,7 +206,7 @@ public DurationClientBuilder endpoint(String endpoint) { /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the DurationClientBuilder. */ @@ -218,7 +218,7 @@ public DurationClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of DurationClientImpl with the provided parameters. - * + * * @return an instance of DurationClientImpl. */ @Generated @@ -274,7 +274,7 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of QueryAsyncClient class. - * + * * @return an instance of QueryAsyncClient. */ @Generated @@ -284,7 +284,7 @@ public QueryAsyncClient buildQueryAsyncClient() { /** * Builds an instance of PropertyAsyncClient class. - * + * * @return an instance of PropertyAsyncClient. */ @Generated @@ -294,7 +294,7 @@ public PropertyAsyncClient buildPropertyAsyncClient() { /** * Builds an instance of HeaderAsyncClient class. - * + * * @return an instance of HeaderAsyncClient. */ @Generated @@ -304,7 +304,7 @@ public HeaderAsyncClient buildHeaderAsyncClient() { /** * Builds an instance of LossyAsyncClient class. - * + * * @return an instance of LossyAsyncClient. */ @Generated @@ -314,7 +314,7 @@ public LossyAsyncClient buildLossyAsyncClient() { /** * Builds an instance of QueryClient class. - * + * * @return an instance of QueryClient. */ @Generated @@ -324,7 +324,7 @@ public QueryClient buildQueryClient() { /** * Builds an instance of PropertyClient class. - * + * * @return an instance of PropertyClient. */ @Generated @@ -334,7 +334,7 @@ public PropertyClient buildPropertyClient() { /** * Builds an instance of HeaderClient class. - * + * * @return an instance of HeaderClient. */ @Generated @@ -344,7 +344,7 @@ public HeaderClient buildHeaderClient() { /** * Builds an instance of LossyClient class. - * + * * @return an instance of LossyClient. */ @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java index 38e7713d7a0..68d1b615916 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyAsyncClient.java @@ -29,7 +29,7 @@ public final class LossyAsyncClient { /** * Initializes an instance of LossyAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -39,7 +39,7 @@ public final class LossyAsyncClient { /** * The intSeconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -56,7 +56,7 @@ public Mono> intSecondsWithResponse(Duration input, RequestOption /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -73,7 +73,7 @@ public Mono> intMillisecondsWithResponse(Duration input, RequestO /** * The intSeconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -93,7 +93,7 @@ public Mono intSeconds(Duration input) { /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java index 0fc3ebb1f9a..05752a1a19a 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/LossyClient.java @@ -27,7 +27,7 @@ public final class LossyClient { /** * Initializes an instance of LossyClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -37,7 +37,7 @@ public final class LossyClient { /** * The intSeconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -54,7 +54,7 @@ public Response intSecondsWithResponse(Duration input, RequestOptions requ /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -71,7 +71,7 @@ public Response intMillisecondsWithResponse(Duration input, RequestOptions /** * The intSeconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -90,7 +90,7 @@ public void intSeconds(Duration input) { /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java index 1910f0a3fce..13503c06a55 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/DurationClientImpl.java @@ -22,7 +22,7 @@ public final class DurationClientImpl { /** * Gets Service host. - * + * * @return the endpoint value. */ public String getEndpoint() { @@ -36,7 +36,7 @@ public String getEndpoint() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -50,7 +50,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -64,7 +64,7 @@ public SerializerAdapter getSerializerAdapter() { /** * Gets the QueriesImpl object to access its operations. - * + * * @return the QueriesImpl object. */ public QueriesImpl getQueries() { @@ -78,7 +78,7 @@ public QueriesImpl getQueries() { /** * Gets the PropertiesImpl object to access its operations. - * + * * @return the PropertiesImpl object. */ public PropertiesImpl getProperties() { @@ -92,7 +92,7 @@ public PropertiesImpl getProperties() { /** * Gets the HeadersImpl object to access its operations. - * + * * @return the HeadersImpl object. */ public HeadersImpl getHeaders() { @@ -106,7 +106,7 @@ public HeadersImpl getHeaders() { /** * Gets the LossiesImpl object to access its operations. - * + * * @return the LossiesImpl object. */ public LossiesImpl getLossies() { @@ -115,7 +115,7 @@ public LossiesImpl getLossies() { /** * Initializes an instance of DurationClient client. - * + * * @param endpoint Service host. */ public DurationClientImpl(String endpoint) { @@ -125,7 +125,7 @@ public DurationClientImpl(String endpoint) { /** * Initializes an instance of DurationClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service host. */ @@ -135,7 +135,7 @@ public DurationClientImpl(HttpPipeline httpPipeline, String endpoint) { /** * Initializes an instance of DurationClient 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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java index 0d1b87ee919..9b0d270ecb2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/encode/duration/implementation/LossiesImpl.java @@ -41,7 +41,7 @@ public final class LossiesImpl { /** * Initializes an instance of LossiesImpl. - * + * * @param client the instance of the service client containing this operation class. */ LossiesImpl(DurationClientImpl client) { @@ -95,7 +95,7 @@ Response intMillisecondsSync(@HostParam("endpoint") String endpoint, @Quer /** * The intSeconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -113,7 +113,7 @@ public Mono> intSecondsWithResponseAsync(Duration input, RequestO /** * The intSeconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -130,7 +130,7 @@ public Response intSecondsWithResponse(Duration input, RequestOptions requ /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -148,7 +148,7 @@ public Mono> intMillisecondsWithResponseAsync(Duration input, Req /** * The intMilliseconds operation. - * + * * @param input The input parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java index 47f54069466..f0d9fcf5c5d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/parameters/query/implementation/SpecialCharsImpl.java @@ -40,7 +40,7 @@ public final class SpecialCharsImpl { /** * Initializes an instance of SpecialCharsImpl. - * + * * @param client the instance of the service client containing this operation class. */ SpecialCharsImpl(QueryClientImpl client) { @@ -77,7 +77,7 @@ Response dollarSignSync(@HostParam("endpoint") String endpoint, @QueryPara /** * The dollarSign operation. - * + * * @param filter The filter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -94,7 +94,7 @@ public Mono> dollarSignWithResponseAsync(String filter, RequestOp /** * The dollarSign operation. - * + * * @param filter The filter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java new file mode 100644 index 00000000000..81c19204a4e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithArrayOfModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithArrayOfModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithArrayOfModelValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithArrayOfModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithArrayOfModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithArrayOfModelValueAsyncClient(ModelWithArrayOfModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.1 — Contains an array of models along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.1 — Contains an array of models on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithArrayOfModel.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithArrayOfModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java new file mode 100644 index 00000000000..0ea9f55070e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithArrayOfModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithArrayOfModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithArrayOfModelValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithArrayOfModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithArrayOfModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithArrayOfModelValueClient(ModelWithArrayOfModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.1 — Contains an array of models along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.1 — Contains an array of models. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithArrayOfModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithArrayOfModel.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithArrayOfModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java new file mode 100644 index 00000000000..e2ba4a411e0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithAttributesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithAttributes; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithAttributesValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithAttributesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithAttributesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithAttributesValueAsyncClient(ModelWithAttributesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (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 §5.1 — Contains fields that are XML attributes along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §5.1 — Contains fields that are XML attributes on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithAttributes.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithAttributes input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java new file mode 100644 index 00000000000..d471399405a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithAttributesValueClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithAttributesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithAttributes; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithAttributesValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithAttributesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithAttributesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithAttributesValueClient(ModelWithAttributesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (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 §5.1 — Contains fields that are XML attributes along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §5.1 — Contains fields that are XML attributes. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithAttributes get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithAttributes.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithAttributes input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java new file mode 100644 index 00000000000..18cc35250d0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithDatetimeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithDatetime; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithDatetimeValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithDatetimeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDatetimeValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDatetimeValueAsyncClient(ModelWithDatetimeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (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 contains datetime properties with different encodings along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains datetime properties with different encodings on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDatetime.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithDatetime input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java new file mode 100644 index 00000000000..2d87e4dacb9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDatetimeValueClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithDatetimeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithDatetime; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithDatetimeValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithDatetimeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDatetimeValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDatetimeValueClient(ModelWithDatetimeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (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 contains datetime properties with different encodings along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains datetime properties with different encodings. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithDatetime get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithDatetime.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithDatetime input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java new file mode 100644 index 00000000000..195d04bd7d0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithDictionaryValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithDictionary; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithDictionaryValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithDictionaryValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDictionaryValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDictionaryValueAsyncClient(ModelWithDictionaryValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: 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 contains a dictionary of key value pairs along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains a dictionary of key value pairs on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithDictionary.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithDictionary input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java new file mode 100644 index 00000000000..d480bdb1d18 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithDictionaryValueClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithDictionaryValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithDictionary; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithDictionaryValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithDictionaryValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithDictionaryValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithDictionaryValueClient(ModelWithDictionaryValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: 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 contains a dictionary of key value pairs along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains a dictionary of key value pairs. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithDictionary get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithDictionary.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithDictionary input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java new file mode 100644 index 00000000000..17ec0f852f9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithEmptyArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithEmptyArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithEmptyArrayValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithEmptyArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEmptyArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEmptyArrayValueAsyncClient(ModelWithEmptyArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains an array of models that's supposed to be sent/received as an empty XML element on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEmptyArray.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithEmptyArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java new file mode 100644 index 00000000000..347ef35cc6c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithEmptyArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithEmptyArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithEmptyArrayValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithEmptyArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEmptyArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEmptyArrayValueClient(ModelWithEmptyArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains an array of models that's supposed to be sent/received as an empty XML element. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithEmptyArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEmptyArray.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithEmptyArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java new file mode 100644 index 00000000000..cddbd682bc4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithEncodedNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithEncodedNames; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithEncodedNamesValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithEncodedNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEncodedNamesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEncodedNamesValueAsyncClient(ModelWithEncodedNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 uses encodedName instead of Xml.Name which is functionally equivalent on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEncodedNames.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithEncodedNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java new file mode 100644 index 00000000000..24bcb3d6adb --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithEncodedNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithEncodedNames; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithEncodedNamesValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithEncodedNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEncodedNamesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEncodedNamesValueClient(ModelWithEncodedNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 uses encodedName instead of Xml.Name which is functionally equivalent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithEncodedNames get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEncodedNames.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithEncodedNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java new file mode 100644 index 00000000000..6f7b59ebc2d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithEnumValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithEnum; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithEnumValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithEnumValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEnumValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEnumValueAsyncClient(ModelWithEnumValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (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 contains a single property with an enum value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains a single property with an enum value on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithEnum.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithEnum input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java new file mode 100644 index 00000000000..fba645a3581 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithEnumValueClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithEnumValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithEnum; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithEnumValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithEnumValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithEnumValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithEnumValueClient(ModelWithEnumValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (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 contains a single property with an enum value along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains a single property with an enum value. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithEnum get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithEnum.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithEnum input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java new file mode 100644 index 00000000000..224f322ada6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithNamespaceOnPropertiesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithNamespaceOnProperties; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithNamespaceOnPropertiesValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithNamespaceOnPropertiesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceOnPropertiesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceOnPropertiesValueAsyncClient(ModelWithNamespaceOnPropertiesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespaceOnProperties.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithNamespaceOnProperties input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java new file mode 100644 index 00000000000..5ec708f8491 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithNamespaceOnPropertiesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithNamespaceOnProperties; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithNamespaceOnPropertiesValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithNamespaceOnPropertiesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceOnPropertiesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceOnPropertiesValueClient(ModelWithNamespaceOnPropertiesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithNamespaceOnProperties get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespaceOnProperties.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithNamespaceOnProperties input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java new file mode 100644 index 00000000000..539f07ce235 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithNamespaceValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithNamespace; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithNamespaceValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithNamespaceValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceValueAsyncClient(ModelWithNamespaceValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: 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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §6.1, §7.1 — Contains fields with XML namespace on the model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNamespace.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithNamespace input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java new file mode 100644 index 00000000000..24913a0382b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNamespaceValueClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithNamespaceValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithNamespace; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithNamespaceValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithNamespaceValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNamespaceValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNamespaceValueClient(ModelWithNamespaceValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: 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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §6.1, §7.1 — Contains fields with XML namespace on the model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithNamespace get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNamespace.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithNamespace input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java new file mode 100644 index 00000000000..cabf1c167d5 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithNestedModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithNestedModelValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNestedModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNestedModelValueAsyncClient(ModelWithNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (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 §2.1 — Contains a property that references another model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §2.1 — Contains a property that references another model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithNestedModel.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.java new file mode 100644 index 00000000000..cb3c68d8e97 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithNestedModelValueClient.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.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithNestedModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithNestedModelValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithNestedModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithNestedModelValueClient(ModelWithNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (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 §2.1 — Contains a property that references another model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §2.1 — Contains a property that references another model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithNestedModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithNestedModel.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java new file mode 100644 index 00000000000..895cc738a15 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.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.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithOptionalFieldValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithOptionalField; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithOptionalFieldValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithOptionalFieldValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithOptionalFieldValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithOptionalFieldValueAsyncClient(ModelWithOptionalFieldValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (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 contains an optional field along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 contains an optional field on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithOptionalField.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithOptionalField input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java new file mode 100644 index 00000000000..399cd80a8f1 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithOptionalFieldValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithOptionalField; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithOptionalFieldValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithOptionalFieldValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithOptionalFieldValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithOptionalFieldValueClient(ModelWithOptionalFieldValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (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 contains an optional field along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 contains an optional field. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithOptionalField get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithOptionalField.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithOptionalField input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java new file mode 100644 index 00000000000..a369272fe63 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedArrays; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedArraysValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedArraysValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedArraysValueAsyncClient(ModelWithRenamedArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedArrays.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java new file mode 100644 index 00000000000..816375d2b45 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedArrays; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedArraysValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedArraysValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedArraysValueClient(ModelWithRenamedArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedArrays get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedArrays.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java new file mode 100644 index 00000000000..148ca7cdc9d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedAttributeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedAttribute; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedAttributeValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedAttributeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedAttributeValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedAttributeValueAsyncClient(ModelWithRenamedAttributeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §5.2 — Contains a renamed XML attribute along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §5.2 — Contains a renamed XML attribute on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedAttribute.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedAttribute input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java new file mode 100644 index 00000000000..31ac02f7584 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedAttributeValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedAttribute; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedAttributeValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedAttributeValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedAttributeValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedAttributeValueClient(ModelWithRenamedAttributeValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §5.2 — Contains a renamed XML attribute along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §5.2 — Contains a renamed XML attribute. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedAttribute get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedAttribute.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedAttribute input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java new file mode 100644 index 00000000000..a62463ba044 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedFieldsValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedFields; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedFieldsValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedFieldsValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedFieldsValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedFieldsValueAsyncClient(ModelWithRenamedFieldsValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §1.3, §2.3 — Contains fields of the same type that have different XML representation on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedFields.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedFields input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java new file mode 100644 index 00000000000..5111e8e5759 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedFieldsValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedFields; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedFieldsValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedFieldsValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedFieldsValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedFieldsValueClient(ModelWithRenamedFieldsValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §1.3, §2.3 — Contains fields of the same type that have different XML representation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedFields get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedFields.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedFields input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java new file mode 100644 index 00000000000..b9d8a681d6d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedNestedModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedNestedModelValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedNestedModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedNestedModelValueAsyncClient(ModelWithRenamedNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         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 §2.2 — Contains a property whose type has along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §2.2 — Contains a property whose type has on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedNestedModel.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java new file mode 100644 index 00000000000..7a0e81c321f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedNestedModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedNestedModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedNestedModelValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedNestedModelValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedNestedModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedNestedModelValueClient(ModelWithRenamedNestedModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         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 §2.2 — Contains a property whose type has along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §2.2 — Contains a property whose type has. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedNestedModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedNestedModel.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedNestedModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java new file mode 100644 index 00000000000..944e79cebe1 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedPropertyValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedProperty; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedPropertyValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedPropertyValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedPropertyValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedPropertyValueAsyncClient(ModelWithRenamedPropertyValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: 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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §1.2 — Contains a scalar property with a custom XML name on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedProperty.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedProperty input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java new file mode 100644 index 00000000000..86377cddb30 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedPropertyValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedProperty; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedPropertyValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedPropertyValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedPropertyValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedPropertyValueClient(ModelWithRenamedPropertyValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: 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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §1.2 — Contains a scalar property with a custom XML name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedProperty get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedProperty.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedProperty input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..a67671537a7 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedUnwrappedModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedUnwrappedModelArrayValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedUnwrappedModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedUnwrappedModelArrayValueAsyncClient(ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.4 — Contains an unwrapped array of models with a custom item name on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedUnwrappedModelArray.class, + SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java new file mode 100644 index 00000000000..e6002cb5e46 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedUnwrappedModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedUnwrappedModelArrayValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedUnwrappedModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedUnwrappedModelArrayValueClient(ModelWithRenamedUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.4 — Contains an unwrapped array of models with a custom item name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedUnwrappedModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue() + .toObject(ModelWithRenamedUnwrappedModelArray.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..e7782e87f9e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedWrappedAndItemModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient( + ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedAndItemModelArray.class, + SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedWrappedAndItemModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java new file mode 100644 index 00000000000..6afada2ae3d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedWrappedAndItemModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedWrappedAndItemModelArrayValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedAndItemModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedAndItemModelArrayValueClient( + ModelWithRenamedWrappedAndItemModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedWrappedAndItemModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue() + .toObject(ModelWithRenamedWrappedAndItemModelArray.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedWrappedAndItemModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..383c6f1e94a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedWrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedWrappedModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithRenamedWrappedModelArrayValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedWrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedModelArrayValueAsyncClient(ModelWithRenamedWrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.3 — Contains a wrapped array of models with a custom wrapper name on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map( + protocolMethodData -> protocolMethodData.toObject(ModelWithRenamedWrappedModelArray.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithRenamedWrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java new file mode 100644 index 00000000000..5044de3bc79 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithRenamedWrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithRenamedWrappedModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithRenamedWrappedModelArrayValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithRenamedWrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithRenamedWrappedModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithRenamedWrappedModelArrayValueClient(ModelWithRenamedWrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.3 — Contains a wrapped array of models with a custom wrapper name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithRenamedWrappedModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithRenamedWrappedModelArray.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithRenamedWrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java new file mode 100644 index 00000000000..dae44cabd0a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithSimpleArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithSimpleArrays; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithSimpleArraysValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithSimpleArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithSimpleArraysValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithSimpleArraysValueAsyncClient(ModelWithSimpleArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.1 — Contains fields of arrays of primitive types along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.1 — Contains fields of arrays of primitive types on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithSimpleArrays.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithSimpleArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java new file mode 100644 index 00000000000..9bcebe26a83 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithSimpleArraysValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithSimpleArrays; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithSimpleArraysValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithSimpleArraysValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithSimpleArraysValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithSimpleArraysValueClient(ModelWithSimpleArraysValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.1 — Contains fields of arrays of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.1 — Contains fields of arrays of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithSimpleArrays get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithSimpleArrays.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithSimpleArrays input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.java new file mode 100644 index 00000000000..8598be080ab --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithTextValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithText; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithTextValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithTextValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithTextValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithTextValueAsyncClient(ModelWithTextValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: 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 §8.1 — Contains an attribute and text along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §8.1 — Contains an attribute and text on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithText.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithText input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java new file mode 100644 index 00000000000..e375ebf9c12 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithTextValueClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithTextValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithText; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithTextValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithTextValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithTextValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithTextValueClient(ModelWithTextValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: 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 §8.1 — Contains an attribute and text along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §8.1 — Contains an attribute and text. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithText get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithText.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithText input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java new file mode 100644 index 00000000000..6bab0a31b58 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithUnwrappedArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithUnwrappedArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithUnwrappedArrayValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithUnwrappedArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedArrayValueAsyncClient(ModelWithUnwrappedArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedArray.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithUnwrappedArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java new file mode 100644 index 00000000000..80ee58a2c52 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithUnwrappedArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithUnwrappedArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithUnwrappedArrayValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithUnwrappedArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedArrayValueClient(ModelWithUnwrappedArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithUnwrappedArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedArray.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithUnwrappedArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java new file mode 100644 index 00000000000..fcf1648ed9e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithUnwrappedModelArray; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithUnwrappedModelArrayValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedModelArrayValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedModelArrayValueAsyncClient(ModelWithUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.2 — Contains an unwrapped array of models along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §4.2 — Contains an unwrapped array of models on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithUnwrappedModelArray.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java new file mode 100644 index 00000000000..e03eec89b3f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithUnwrappedModelArrayValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithUnwrappedModelArray; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithUnwrappedModelArrayValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithUnwrappedModelArrayValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithUnwrappedModelArrayValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithUnwrappedModelArrayValueClient(ModelWithUnwrappedModelArrayValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.2 — Contains an unwrapped array of models along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §4.2 — Contains an unwrapped array of models. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithUnwrappedModelArray get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(ModelWithUnwrappedModelArray.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithUnwrappedModelArray input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java new file mode 100644 index 00000000000..5c128642f06 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithWrappedPrimitiveCustomItemNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient( + ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelWithWrappedPrimitiveCustomItemNames.class, + SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(ModelWithWrappedPrimitiveCustomItemNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java new file mode 100644 index 00000000000..b0dbd590854 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.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.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.ModelWithWrappedPrimitiveCustomItemNamesValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class ModelWithWrappedPrimitiveCustomItemNamesValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient; + + /** + * Initializes an instance of ModelWithWrappedPrimitiveCustomItemNamesValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelWithWrappedPrimitiveCustomItemNamesValueClient( + ModelWithWrappedPrimitiveCustomItemNamesValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelWithWrappedPrimitiveCustomItemNames get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue() + .toObject(ModelWithWrappedPrimitiveCustomItemNames.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(ModelWithWrappedPrimitiveCustomItemNames input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.java new file mode 100644 index 00000000000..9decc6bca75 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.SimpleModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.SimpleModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class SimpleModelValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final SimpleModelValuesImpl serviceClient; + + /** + * Initializes an instance of SimpleModelValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + SimpleModelValueAsyncClient(SimpleModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponseAsync(input, requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class, SERIALIZER)); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono put(SimpleModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + return putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).flatMap(FluxUtil::toMono); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java new file mode 100644 index 00000000000..0bf8ac990b0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/SimpleModelValueClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.SimpleModelValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.SimpleModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class SimpleModelValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final SimpleModelValuesImpl serviceClient; + + /** + * Initializes an instance of SimpleModelValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + SimpleModelValueClient(SimpleModelValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + return this.serviceClient.putWithResponse(input, requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public SimpleModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class, SERIALIZER); + } + + /** + * The put operation. + * + * @param input The input parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void put(SimpleModel input) { + // Generated convenience method for putWithResponse + RequestOptions requestOptions = new RequestOptions(); + putWithResponse(BinaryData.fromObject(input, SERIALIZER), requestOptions).getValue(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java new file mode 100644 index 00000000000..d948db09542 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlClientBuilder.java @@ -0,0 +1,857 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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; +import payload.xml.implementation.XmlClientImpl; + +/** + * A builder for creating a new instance of the XmlClient type. + */ +@ServiceClientBuilder( + serviceClients = { + SimpleModelValueClient.class, + ModelWithRenamedPropertyValueClient.class, + ModelWithRenamedFieldsValueClient.class, + ModelWithNestedModelValueClient.class, + ModelWithRenamedNestedModelValueClient.class, + ModelWithSimpleArraysValueClient.class, + ModelWithUnwrappedArrayValueClient.class, + ModelWithRenamedArraysValueClient.class, + ModelWithWrappedPrimitiveCustomItemNamesValueClient.class, + ModelWithArrayOfModelValueClient.class, + ModelWithUnwrappedModelArrayValueClient.class, + ModelWithRenamedWrappedModelArrayValueClient.class, + ModelWithRenamedUnwrappedModelArrayValueClient.class, + ModelWithRenamedWrappedAndItemModelArrayValueClient.class, + ModelWithAttributesValueClient.class, + ModelWithRenamedAttributeValueClient.class, + ModelWithNamespaceValueClient.class, + ModelWithNamespaceOnPropertiesValueClient.class, + ModelWithTextValueClient.class, + ModelWithOptionalFieldValueClient.class, + ModelWithEmptyArrayValueClient.class, + ModelWithDictionaryValueClient.class, + ModelWithEncodedNamesValueClient.class, + ModelWithEnumValueClient.class, + ModelWithDatetimeValueClient.class, + XmlErrorValueClient.class, + SimpleModelValueAsyncClient.class, + ModelWithRenamedPropertyValueAsyncClient.class, + ModelWithRenamedFieldsValueAsyncClient.class, + ModelWithNestedModelValueAsyncClient.class, + ModelWithRenamedNestedModelValueAsyncClient.class, + ModelWithSimpleArraysValueAsyncClient.class, + ModelWithUnwrappedArrayValueAsyncClient.class, + ModelWithRenamedArraysValueAsyncClient.class, + ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.class, + ModelWithArrayOfModelValueAsyncClient.class, + ModelWithUnwrappedModelArrayValueAsyncClient.class, + ModelWithRenamedWrappedModelArrayValueAsyncClient.class, + ModelWithRenamedUnwrappedModelArrayValueAsyncClient.class, + ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.class, + ModelWithAttributesValueAsyncClient.class, + ModelWithRenamedAttributeValueAsyncClient.class, + ModelWithNamespaceValueAsyncClient.class, + ModelWithNamespaceOnPropertiesValueAsyncClient.class, + ModelWithTextValueAsyncClient.class, + ModelWithOptionalFieldValueAsyncClient.class, + ModelWithEmptyArrayValueAsyncClient.class, + ModelWithDictionaryValueAsyncClient.class, + ModelWithEncodedNamesValueAsyncClient.class, + ModelWithEnumValueAsyncClient.class, + ModelWithDatetimeValueAsyncClient.class, + XmlErrorValueAsyncClient.class }) +public final class XmlClientBuilder + 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("payload-xml.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the XmlClientBuilder. + */ + @Generated + public XmlClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 XmlClientBuilder 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 XmlClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 XmlClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public XmlClientBuilder 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 XmlClientBuilder. + */ + @Generated + public XmlClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of XmlClientImpl with the provided parameters. + * + * @return an instance of XmlClientImpl. + */ + @Generated + private XmlClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + XmlClientImpl client + = new XmlClientImpl(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 SimpleModelValueAsyncClient class. + * + * @return an instance of SimpleModelValueAsyncClient. + */ + @Generated + public SimpleModelValueAsyncClient buildSimpleModelValueAsyncClient() { + return new SimpleModelValueAsyncClient(buildInnerClient().getSimpleModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedPropertyValueAsyncClient class. + * + * @return an instance of ModelWithRenamedPropertyValueAsyncClient. + */ + @Generated + public ModelWithRenamedPropertyValueAsyncClient buildModelWithRenamedPropertyValueAsyncClient() { + return new ModelWithRenamedPropertyValueAsyncClient(buildInnerClient().getModelWithRenamedPropertyValues()); + } + + /** + * Builds an instance of ModelWithRenamedFieldsValueAsyncClient class. + * + * @return an instance of ModelWithRenamedFieldsValueAsyncClient. + */ + @Generated + public ModelWithRenamedFieldsValueAsyncClient buildModelWithRenamedFieldsValueAsyncClient() { + return new ModelWithRenamedFieldsValueAsyncClient(buildInnerClient().getModelWithRenamedFieldsValues()); + } + + /** + * Builds an instance of ModelWithNestedModelValueAsyncClient class. + * + * @return an instance of ModelWithNestedModelValueAsyncClient. + */ + @Generated + public ModelWithNestedModelValueAsyncClient buildModelWithNestedModelValueAsyncClient() { + return new ModelWithNestedModelValueAsyncClient(buildInnerClient().getModelWithNestedModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedNestedModelValueAsyncClient class. + * + * @return an instance of ModelWithRenamedNestedModelValueAsyncClient. + */ + @Generated + public ModelWithRenamedNestedModelValueAsyncClient buildModelWithRenamedNestedModelValueAsyncClient() { + return new ModelWithRenamedNestedModelValueAsyncClient( + buildInnerClient().getModelWithRenamedNestedModelValues()); + } + + /** + * Builds an instance of ModelWithSimpleArraysValueAsyncClient class. + * + * @return an instance of ModelWithSimpleArraysValueAsyncClient. + */ + @Generated + public ModelWithSimpleArraysValueAsyncClient buildModelWithSimpleArraysValueAsyncClient() { + return new ModelWithSimpleArraysValueAsyncClient(buildInnerClient().getModelWithSimpleArraysValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedArrayValueAsyncClient class. + * + * @return an instance of ModelWithUnwrappedArrayValueAsyncClient. + */ + @Generated + public ModelWithUnwrappedArrayValueAsyncClient buildModelWithUnwrappedArrayValueAsyncClient() { + return new ModelWithUnwrappedArrayValueAsyncClient(buildInnerClient().getModelWithUnwrappedArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedArraysValueAsyncClient class. + * + * @return an instance of ModelWithRenamedArraysValueAsyncClient. + */ + @Generated + public ModelWithRenamedArraysValueAsyncClient buildModelWithRenamedArraysValueAsyncClient() { + return new ModelWithRenamedArraysValueAsyncClient(buildInnerClient().getModelWithRenamedArraysValues()); + } + + /** + * Builds an instance of ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient class. + * + * @return an instance of ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient. + */ + @Generated + public ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient + buildModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient() { + return new ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient( + buildInnerClient().getModelWithWrappedPrimitiveCustomItemNamesValues()); + } + + /** + * Builds an instance of ModelWithArrayOfModelValueAsyncClient class. + * + * @return an instance of ModelWithArrayOfModelValueAsyncClient. + */ + @Generated + public ModelWithArrayOfModelValueAsyncClient buildModelWithArrayOfModelValueAsyncClient() { + return new ModelWithArrayOfModelValueAsyncClient(buildInnerClient().getModelWithArrayOfModelValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithUnwrappedModelArrayValueAsyncClient. + */ + @Generated + public ModelWithUnwrappedModelArrayValueAsyncClient buildModelWithUnwrappedModelArrayValueAsyncClient() { + return new ModelWithUnwrappedModelArrayValueAsyncClient( + buildInnerClient().getModelWithUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithRenamedWrappedModelArrayValueAsyncClient. + */ + @Generated + public ModelWithRenamedWrappedModelArrayValueAsyncClient buildModelWithRenamedWrappedModelArrayValueAsyncClient() { + return new ModelWithRenamedWrappedModelArrayValueAsyncClient( + buildInnerClient().getModelWithRenamedWrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedUnwrappedModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithRenamedUnwrappedModelArrayValueAsyncClient. + */ + @Generated + public ModelWithRenamedUnwrappedModelArrayValueAsyncClient + buildModelWithRenamedUnwrappedModelArrayValueAsyncClient() { + return new ModelWithRenamedUnwrappedModelArrayValueAsyncClient( + buildInnerClient().getModelWithRenamedUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient class. + * + * @return an instance of ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient. + */ + @Generated + public ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient + buildModelWithRenamedWrappedAndItemModelArrayValueAsyncClient() { + return new ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient( + buildInnerClient().getModelWithRenamedWrappedAndItemModelArrayValues()); + } + + /** + * Builds an instance of ModelWithAttributesValueAsyncClient class. + * + * @return an instance of ModelWithAttributesValueAsyncClient. + */ + @Generated + public ModelWithAttributesValueAsyncClient buildModelWithAttributesValueAsyncClient() { + return new ModelWithAttributesValueAsyncClient(buildInnerClient().getModelWithAttributesValues()); + } + + /** + * Builds an instance of ModelWithRenamedAttributeValueAsyncClient class. + * + * @return an instance of ModelWithRenamedAttributeValueAsyncClient. + */ + @Generated + public ModelWithRenamedAttributeValueAsyncClient buildModelWithRenamedAttributeValueAsyncClient() { + return new ModelWithRenamedAttributeValueAsyncClient(buildInnerClient().getModelWithRenamedAttributeValues()); + } + + /** + * Builds an instance of ModelWithNamespaceValueAsyncClient class. + * + * @return an instance of ModelWithNamespaceValueAsyncClient. + */ + @Generated + public ModelWithNamespaceValueAsyncClient buildModelWithNamespaceValueAsyncClient() { + return new ModelWithNamespaceValueAsyncClient(buildInnerClient().getModelWithNamespaceValues()); + } + + /** + * Builds an instance of ModelWithNamespaceOnPropertiesValueAsyncClient class. + * + * @return an instance of ModelWithNamespaceOnPropertiesValueAsyncClient. + */ + @Generated + public ModelWithNamespaceOnPropertiesValueAsyncClient buildModelWithNamespaceOnPropertiesValueAsyncClient() { + return new ModelWithNamespaceOnPropertiesValueAsyncClient( + buildInnerClient().getModelWithNamespaceOnPropertiesValues()); + } + + /** + * Builds an instance of ModelWithTextValueAsyncClient class. + * + * @return an instance of ModelWithTextValueAsyncClient. + */ + @Generated + public ModelWithTextValueAsyncClient buildModelWithTextValueAsyncClient() { + return new ModelWithTextValueAsyncClient(buildInnerClient().getModelWithTextValues()); + } + + /** + * Builds an instance of ModelWithOptionalFieldValueAsyncClient class. + * + * @return an instance of ModelWithOptionalFieldValueAsyncClient. + */ + @Generated + public ModelWithOptionalFieldValueAsyncClient buildModelWithOptionalFieldValueAsyncClient() { + return new ModelWithOptionalFieldValueAsyncClient(buildInnerClient().getModelWithOptionalFieldValues()); + } + + /** + * Builds an instance of ModelWithEmptyArrayValueAsyncClient class. + * + * @return an instance of ModelWithEmptyArrayValueAsyncClient. + */ + @Generated + public ModelWithEmptyArrayValueAsyncClient buildModelWithEmptyArrayValueAsyncClient() { + return new ModelWithEmptyArrayValueAsyncClient(buildInnerClient().getModelWithEmptyArrayValues()); + } + + /** + * Builds an instance of ModelWithDictionaryValueAsyncClient class. + * + * @return an instance of ModelWithDictionaryValueAsyncClient. + */ + @Generated + public ModelWithDictionaryValueAsyncClient buildModelWithDictionaryValueAsyncClient() { + return new ModelWithDictionaryValueAsyncClient(buildInnerClient().getModelWithDictionaryValues()); + } + + /** + * Builds an instance of ModelWithEncodedNamesValueAsyncClient class. + * + * @return an instance of ModelWithEncodedNamesValueAsyncClient. + */ + @Generated + public ModelWithEncodedNamesValueAsyncClient buildModelWithEncodedNamesValueAsyncClient() { + return new ModelWithEncodedNamesValueAsyncClient(buildInnerClient().getModelWithEncodedNamesValues()); + } + + /** + * Builds an instance of ModelWithEnumValueAsyncClient class. + * + * @return an instance of ModelWithEnumValueAsyncClient. + */ + @Generated + public ModelWithEnumValueAsyncClient buildModelWithEnumValueAsyncClient() { + return new ModelWithEnumValueAsyncClient(buildInnerClient().getModelWithEnumValues()); + } + + /** + * Builds an instance of ModelWithDatetimeValueAsyncClient class. + * + * @return an instance of ModelWithDatetimeValueAsyncClient. + */ + @Generated + public ModelWithDatetimeValueAsyncClient buildModelWithDatetimeValueAsyncClient() { + return new ModelWithDatetimeValueAsyncClient(buildInnerClient().getModelWithDatetimeValues()); + } + + /** + * Builds an instance of XmlErrorValueAsyncClient class. + * + * @return an instance of XmlErrorValueAsyncClient. + */ + @Generated + public XmlErrorValueAsyncClient buildXmlErrorValueAsyncClient() { + return new XmlErrorValueAsyncClient(buildInnerClient().getXmlErrorValues()); + } + + /** + * Builds an instance of SimpleModelValueClient class. + * + * @return an instance of SimpleModelValueClient. + */ + @Generated + public SimpleModelValueClient buildSimpleModelValueClient() { + return new SimpleModelValueClient(buildInnerClient().getSimpleModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedPropertyValueClient class. + * + * @return an instance of ModelWithRenamedPropertyValueClient. + */ + @Generated + public ModelWithRenamedPropertyValueClient buildModelWithRenamedPropertyValueClient() { + return new ModelWithRenamedPropertyValueClient(buildInnerClient().getModelWithRenamedPropertyValues()); + } + + /** + * Builds an instance of ModelWithRenamedFieldsValueClient class. + * + * @return an instance of ModelWithRenamedFieldsValueClient. + */ + @Generated + public ModelWithRenamedFieldsValueClient buildModelWithRenamedFieldsValueClient() { + return new ModelWithRenamedFieldsValueClient(buildInnerClient().getModelWithRenamedFieldsValues()); + } + + /** + * Builds an instance of ModelWithNestedModelValueClient class. + * + * @return an instance of ModelWithNestedModelValueClient. + */ + @Generated + public ModelWithNestedModelValueClient buildModelWithNestedModelValueClient() { + return new ModelWithNestedModelValueClient(buildInnerClient().getModelWithNestedModelValues()); + } + + /** + * Builds an instance of ModelWithRenamedNestedModelValueClient class. + * + * @return an instance of ModelWithRenamedNestedModelValueClient. + */ + @Generated + public ModelWithRenamedNestedModelValueClient buildModelWithRenamedNestedModelValueClient() { + return new ModelWithRenamedNestedModelValueClient(buildInnerClient().getModelWithRenamedNestedModelValues()); + } + + /** + * Builds an instance of ModelWithSimpleArraysValueClient class. + * + * @return an instance of ModelWithSimpleArraysValueClient. + */ + @Generated + public ModelWithSimpleArraysValueClient buildModelWithSimpleArraysValueClient() { + return new ModelWithSimpleArraysValueClient(buildInnerClient().getModelWithSimpleArraysValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedArrayValueClient class. + * + * @return an instance of ModelWithUnwrappedArrayValueClient. + */ + @Generated + public ModelWithUnwrappedArrayValueClient buildModelWithUnwrappedArrayValueClient() { + return new ModelWithUnwrappedArrayValueClient(buildInnerClient().getModelWithUnwrappedArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedArraysValueClient class. + * + * @return an instance of ModelWithRenamedArraysValueClient. + */ + @Generated + public ModelWithRenamedArraysValueClient buildModelWithRenamedArraysValueClient() { + return new ModelWithRenamedArraysValueClient(buildInnerClient().getModelWithRenamedArraysValues()); + } + + /** + * Builds an instance of ModelWithWrappedPrimitiveCustomItemNamesValueClient class. + * + * @return an instance of ModelWithWrappedPrimitiveCustomItemNamesValueClient. + */ + @Generated + public ModelWithWrappedPrimitiveCustomItemNamesValueClient + buildModelWithWrappedPrimitiveCustomItemNamesValueClient() { + return new ModelWithWrappedPrimitiveCustomItemNamesValueClient( + buildInnerClient().getModelWithWrappedPrimitiveCustomItemNamesValues()); + } + + /** + * Builds an instance of ModelWithArrayOfModelValueClient class. + * + * @return an instance of ModelWithArrayOfModelValueClient. + */ + @Generated + public ModelWithArrayOfModelValueClient buildModelWithArrayOfModelValueClient() { + return new ModelWithArrayOfModelValueClient(buildInnerClient().getModelWithArrayOfModelValues()); + } + + /** + * Builds an instance of ModelWithUnwrappedModelArrayValueClient class. + * + * @return an instance of ModelWithUnwrappedModelArrayValueClient. + */ + @Generated + public ModelWithUnwrappedModelArrayValueClient buildModelWithUnwrappedModelArrayValueClient() { + return new ModelWithUnwrappedModelArrayValueClient(buildInnerClient().getModelWithUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedModelArrayValueClient class. + * + * @return an instance of ModelWithRenamedWrappedModelArrayValueClient. + */ + @Generated + public ModelWithRenamedWrappedModelArrayValueClient buildModelWithRenamedWrappedModelArrayValueClient() { + return new ModelWithRenamedWrappedModelArrayValueClient( + buildInnerClient().getModelWithRenamedWrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedUnwrappedModelArrayValueClient class. + * + * @return an instance of ModelWithRenamedUnwrappedModelArrayValueClient. + */ + @Generated + public ModelWithRenamedUnwrappedModelArrayValueClient buildModelWithRenamedUnwrappedModelArrayValueClient() { + return new ModelWithRenamedUnwrappedModelArrayValueClient( + buildInnerClient().getModelWithRenamedUnwrappedModelArrayValues()); + } + + /** + * Builds an instance of ModelWithRenamedWrappedAndItemModelArrayValueClient class. + * + * @return an instance of ModelWithRenamedWrappedAndItemModelArrayValueClient. + */ + @Generated + public ModelWithRenamedWrappedAndItemModelArrayValueClient + buildModelWithRenamedWrappedAndItemModelArrayValueClient() { + return new ModelWithRenamedWrappedAndItemModelArrayValueClient( + buildInnerClient().getModelWithRenamedWrappedAndItemModelArrayValues()); + } + + /** + * Builds an instance of ModelWithAttributesValueClient class. + * + * @return an instance of ModelWithAttributesValueClient. + */ + @Generated + public ModelWithAttributesValueClient buildModelWithAttributesValueClient() { + return new ModelWithAttributesValueClient(buildInnerClient().getModelWithAttributesValues()); + } + + /** + * Builds an instance of ModelWithRenamedAttributeValueClient class. + * + * @return an instance of ModelWithRenamedAttributeValueClient. + */ + @Generated + public ModelWithRenamedAttributeValueClient buildModelWithRenamedAttributeValueClient() { + return new ModelWithRenamedAttributeValueClient(buildInnerClient().getModelWithRenamedAttributeValues()); + } + + /** + * Builds an instance of ModelWithNamespaceValueClient class. + * + * @return an instance of ModelWithNamespaceValueClient. + */ + @Generated + public ModelWithNamespaceValueClient buildModelWithNamespaceValueClient() { + return new ModelWithNamespaceValueClient(buildInnerClient().getModelWithNamespaceValues()); + } + + /** + * Builds an instance of ModelWithNamespaceOnPropertiesValueClient class. + * + * @return an instance of ModelWithNamespaceOnPropertiesValueClient. + */ + @Generated + public ModelWithNamespaceOnPropertiesValueClient buildModelWithNamespaceOnPropertiesValueClient() { + return new ModelWithNamespaceOnPropertiesValueClient( + buildInnerClient().getModelWithNamespaceOnPropertiesValues()); + } + + /** + * Builds an instance of ModelWithTextValueClient class. + * + * @return an instance of ModelWithTextValueClient. + */ + @Generated + public ModelWithTextValueClient buildModelWithTextValueClient() { + return new ModelWithTextValueClient(buildInnerClient().getModelWithTextValues()); + } + + /** + * Builds an instance of ModelWithOptionalFieldValueClient class. + * + * @return an instance of ModelWithOptionalFieldValueClient. + */ + @Generated + public ModelWithOptionalFieldValueClient buildModelWithOptionalFieldValueClient() { + return new ModelWithOptionalFieldValueClient(buildInnerClient().getModelWithOptionalFieldValues()); + } + + /** + * Builds an instance of ModelWithEmptyArrayValueClient class. + * + * @return an instance of ModelWithEmptyArrayValueClient. + */ + @Generated + public ModelWithEmptyArrayValueClient buildModelWithEmptyArrayValueClient() { + return new ModelWithEmptyArrayValueClient(buildInnerClient().getModelWithEmptyArrayValues()); + } + + /** + * Builds an instance of ModelWithDictionaryValueClient class. + * + * @return an instance of ModelWithDictionaryValueClient. + */ + @Generated + public ModelWithDictionaryValueClient buildModelWithDictionaryValueClient() { + return new ModelWithDictionaryValueClient(buildInnerClient().getModelWithDictionaryValues()); + } + + /** + * Builds an instance of ModelWithEncodedNamesValueClient class. + * + * @return an instance of ModelWithEncodedNamesValueClient. + */ + @Generated + public ModelWithEncodedNamesValueClient buildModelWithEncodedNamesValueClient() { + return new ModelWithEncodedNamesValueClient(buildInnerClient().getModelWithEncodedNamesValues()); + } + + /** + * Builds an instance of ModelWithEnumValueClient class. + * + * @return an instance of ModelWithEnumValueClient. + */ + @Generated + public ModelWithEnumValueClient buildModelWithEnumValueClient() { + return new ModelWithEnumValueClient(buildInnerClient().getModelWithEnumValues()); + } + + /** + * Builds an instance of ModelWithDatetimeValueClient class. + * + * @return an instance of ModelWithDatetimeValueClient. + */ + @Generated + public ModelWithDatetimeValueClient buildModelWithDatetimeValueClient() { + return new ModelWithDatetimeValueClient(buildInnerClient().getModelWithDatetimeValues()); + } + + /** + * Builds an instance of XmlErrorValueClient class. + * + * @return an instance of XmlErrorValueClient. + */ + @Generated + public XmlErrorValueClient buildXmlErrorValueClient() { + return new XmlErrorValueClient(buildInnerClient().getXmlErrorValues()); + } + + private static final ClientLogger LOGGER = new ClientLogger(XmlClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.java new file mode 100644 index 00000000000..49ac7ed4ee6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueAsyncClient.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 payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.XmlErrorValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.SimpleModel; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class, isAsync = true) +public final class XmlErrorValueAsyncClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final XmlErrorValuesImpl serviceClient; + + /** + * Initializes an instance of XmlErrorValueAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + XmlErrorValueAsyncClient(XmlErrorValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponseAsync(requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SimpleModel.class, SERIALIZER)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java new file mode 100644 index 00000000000..426c157daaa --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/XmlErrorValueClient.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml; + +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.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.ObjectSerializer; +import payload.xml.implementation.XmlErrorValuesImpl; +import payload.xml.implementation.XmlSerializerProviders; +import payload.xml.models.SimpleModel; + +/** + * Initializes a new instance of the synchronous XmlClient type. + */ +@ServiceClient(builder = XmlClientBuilder.class) +public final class XmlErrorValueClient { + @Generated + private static final ObjectSerializer SERIALIZER = XmlSerializerProviders.createInstance(); + + @Generated + private final XmlErrorValuesImpl serviceClient; + + /** + * Initializes an instance of XmlErrorValueClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + XmlErrorValueClient(XmlErrorValuesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getWithResponse(requestOptions); + } + + /** + * The get 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 §1.1 — Contains fields of primitive types. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public SimpleModel get() { + // Generated convenience method for getWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getWithResponse(requestOptions).getValue().toObject(SimpleModel.class, SERIALIZER); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java new file mode 100644 index 00000000000..25fb8840bca --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithArrayOfModelValues. + */ +public final class ModelWithArrayOfModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithArrayOfModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithArrayOfModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithArrayOfModelValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithArrayOfModelValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithArrayOfModelValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithArrayOfModelValues") + public interface ModelWithArrayOfModelValuesService { + @Get("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithArrayOfModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.1 — Contains an array of models along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.1 — Contains an array of models along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java new file mode 100644 index 00000000000..9179deb03db --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithAttributesValues. + */ +public final class ModelWithAttributesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithAttributesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithAttributesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithAttributesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithAttributesValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithAttributesValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithAttributesValues") + public interface ModelWithAttributesValuesService { + @Get("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithAttributes") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (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 §5.1 — Contains fields that are XML attributes along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (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 §5.1 — Contains fields that are XML attributes along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id1: int (Required)
+     *     id2: String (Required)
+     *     enabled: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java new file mode 100644 index 00000000000..efcb2723116 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithDatetimeValues. + */ +public final class ModelWithDatetimeValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithDatetimeValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithDatetimeValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithDatetimeValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithDatetimeValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithDatetimeValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithDatetimeValues") + public interface ModelWithDatetimeValuesService { + @Get("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDatetime") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (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 contains datetime properties with different encodings along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (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 contains datetime properties with different encodings along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     rfc3339: OffsetDateTime (Required)
+     *     rfc7231: DateTimeRfc1123 (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java new file mode 100644 index 00000000000..9badecf1983 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithDictionaryValues. + */ +public final class ModelWithDictionaryValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithDictionaryValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithDictionaryValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithDictionaryValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithDictionaryValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithDictionaryValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithDictionaryValues") + public interface ModelWithDictionaryValuesService { + @Get("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithDictionary") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: 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 contains a dictionary of key value pairs along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: 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 contains a dictionary of key value pairs along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java new file mode 100644 index 00000000000..b718e492aba --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithEmptyArrayValues. + */ +public final class ModelWithEmptyArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithEmptyArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithEmptyArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithEmptyArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithEmptyArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithEmptyArrayValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithEmptyArrayValues") + public interface ModelWithEmptyArrayValuesService { + @Get("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEmptyArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 contains an array of models that's supposed to be sent/received as an empty XML element along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java new file mode 100644 index 00000000000..7632f29359c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithEncodedNamesValues. + */ +public final class ModelWithEncodedNamesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithEncodedNamesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithEncodedNamesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithEncodedNamesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithEncodedNamesValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithEncodedNamesValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithEncodedNamesValues") + public interface ModelWithEncodedNamesValuesService { + @Get("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEncodedNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         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 uses encodedName instead of Xml.Name which is functionally equivalent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SimpleModelData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     PossibleColors (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java new file mode 100644 index 00000000000..519cadc6cbc --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithEnumValues. + */ +public final class ModelWithEnumValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithEnumValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithEnumValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithEnumValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithEnumValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithEnumValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithEnumValues") + public interface ModelWithEnumValuesService { + @Get("/payload/xml/modelWithEnum") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithEnum") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEnum") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithEnum") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (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 contains a single property with an enum value along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (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 contains a single property with an enum value along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(pending/success/error) (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java new file mode 100644 index 00000000000..b4071042553 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithNamespaceOnPropertiesValues. + */ +public final class ModelWithNamespaceOnPropertiesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithNamespaceOnPropertiesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithNamespaceOnPropertiesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithNamespaceOnPropertiesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithNamespaceOnPropertiesValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithNamespaceOnPropertiesValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithNamespaceOnPropertiesValues") + public interface ModelWithNamespaceOnPropertiesValuesService { + @Get("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespaceOnProperties") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §6.2, §7.2 — Contains fields with different XML namespaces on individual properties along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java new file mode 100644 index 00000000000..883a9aa16a4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithNamespaceValues. + */ +public final class ModelWithNamespaceValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithNamespaceValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithNamespaceValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithNamespaceValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithNamespaceValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithNamespaceValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithNamespaceValues") + public interface ModelWithNamespaceValuesService { + @Get("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNamespace") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: 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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: 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 §6.1, §7.1 — Contains fields with XML namespace on the model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: int (Required)
+     *     title: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java new file mode 100644 index 00000000000..e268ba5a383 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithNestedModelValues. + */ +public final class ModelWithNestedModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithNestedModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithNestedModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithNestedModelValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithNestedModelValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithNestedModelValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithNestedModelValues") + public interface ModelWithNestedModelValuesService { + @Get("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (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 §2.1 — Contains a property that references another model along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (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 §2.1 — Contains a property that references another model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     nested (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java new file mode 100644 index 00000000000..c92669917ba --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithOptionalFieldValues. + */ +public final class ModelWithOptionalFieldValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithOptionalFieldValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithOptionalFieldValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithOptionalFieldValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithOptionalFieldValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithOptionalFieldValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithOptionalFieldValues") + public interface ModelWithOptionalFieldValuesService { + @Get("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithOptionalField") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (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 contains an optional field along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (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 contains an optional field along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     item: String (Required)
+     *     value: Integer (Optional)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java new file mode 100644 index 00000000000..d385e242bfd --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedArraysValues. + */ +public final class ModelWithRenamedArraysValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedArraysValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedArraysValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedArraysValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedArraysValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedArraysValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedArraysValues") + public interface ModelWithRenamedArraysValuesService { + @Get("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (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 §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Colors (Required): [
+     *         String (Required)
+     *     ]
+     *     Counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java new file mode 100644 index 00000000000..584f5ede3a8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedAttributeValues. + */ +public final class ModelWithRenamedAttributeValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedAttributeValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedAttributeValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedAttributeValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedAttributeValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedAttributeValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedAttributeValues") + public interface ModelWithRenamedAttributeValuesService { + @Get("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedAttribute") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §5.2 — Contains a renamed XML attribute along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: 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 §5.2 — Contains a renamed XML attribute along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     xml-id: int (Required)
+     *     title: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java new file mode 100644 index 00000000000..0e03e2846e8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedFieldsValues. + */ +public final class ModelWithRenamedFieldsValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedFieldsValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedFieldsValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedFieldsValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedFieldsValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedFieldsValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedFieldsValues") + public interface ModelWithRenamedFieldsValuesService { + @Get("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedFields") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @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 §1.3, §2.3 — Contains fields of the same type that have different XML representation along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     InputData (Required): {
+     *         name: String (Required)
+     *         age: int (Required)
+     *     }
+     *     OutputData (Required): (recursive schema, see OutputData above)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java new file mode 100644 index 00000000000..d9f80b9e44d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedNestedModelValues. + */ +public final class ModelWithRenamedNestedModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedNestedModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedNestedModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedNestedModelValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedNestedModelValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedNestedModelValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedNestedModelValues") + public interface ModelWithRenamedNestedModelValuesService { + @Get("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedNestedModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         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 §2.2 — Contains a property whose type has along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         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 §2.2 — Contains a property whose type has along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     author (Required): {
+     *         name: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java new file mode 100644 index 00000000000..96d7a28d586 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedPropertyValues. + */ +public final class ModelWithRenamedPropertyValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedPropertyValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedPropertyValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedPropertyValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedPropertyValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedPropertyValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedPropertyValues") + public interface ModelWithRenamedPropertyValuesService { + @Get("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedProperty") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: 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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: 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 §1.2 — Contains a scalar property with a custom XML name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     renamedTitle: String (Required)
+     *     author: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java new file mode 100644 index 00000000000..c04789a86ae --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedUnwrappedModelArrayValues. + */ +public final class ModelWithRenamedUnwrappedModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedUnwrappedModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedUnwrappedModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedUnwrappedModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedUnwrappedModelArrayValuesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedUnwrappedModelArrayValues to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedUnwrappedModelArrayValues") + public interface ModelWithRenamedUnwrappedModelArrayValuesService { + @Get("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.4 — Contains an unwrapped array of models with a custom item name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ModelItem (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java new file mode 100644 index 00000000000..a7c9f36b2d9 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 + * ModelWithRenamedWrappedAndItemModelArrayValues. + */ +public final class ModelWithRenamedWrappedAndItemModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedWrappedAndItemModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedWrappedAndItemModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedWrappedAndItemModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedWrappedAndItemModelArrayValuesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedWrappedAndItemModelArrayValues to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedWrappedAndItemModelArrayValues") + public interface ModelWithRenamedWrappedAndItemModelArrayValuesService { + @Get("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedAndItemModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: 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 §4.5 — Contains a wrapped array of models with custom wrapper and item names along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllBooks (Required): [
+     *          (Required){
+     *             title: String (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java new file mode 100644 index 00000000000..4cc47a6fb03 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithRenamedWrappedModelArrayValues. + */ +public final class ModelWithRenamedWrappedModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithRenamedWrappedModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithRenamedWrappedModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithRenamedWrappedModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithRenamedWrappedModelArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithRenamedWrappedModelArrayValues to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithRenamedWrappedModelArrayValues") + public interface ModelWithRenamedWrappedModelArrayValuesService { + @Get("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithRenamedWrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.3 — Contains a wrapped array of models with a custom wrapper name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     AllItems (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java new file mode 100644 index 00000000000..b9ebe06e11e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithSimpleArraysValues. + */ +public final class ModelWithSimpleArraysValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithSimpleArraysValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithSimpleArraysValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithSimpleArraysValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithSimpleArraysValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithSimpleArraysValues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithSimpleArraysValues") + public interface ModelWithSimpleArraysValuesService { + @Get("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithSimpleArrays") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.1 — Contains fields of arrays of primitive types along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.1 — Contains fields of arrays of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java new file mode 100644 index 00000000000..95af58d7dab --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithTextValues. + */ +public final class ModelWithTextValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithTextValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithTextValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithTextValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithTextValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithTextValues to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithTextValues") + public interface ModelWithTextValuesService { + @Get("/payload/xml/modelWithText") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithText") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithText") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithText") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: 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 §8.1 — Contains an attribute and text along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: 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 §8.1 — Contains an attribute and text along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     language: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java new file mode 100644 index 00000000000..b4b5a36f89d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithUnwrappedArrayValues. + */ +public final class ModelWithUnwrappedArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithUnwrappedArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithUnwrappedArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithUnwrappedArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithUnwrappedArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithUnwrappedArrayValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithUnwrappedArrayValues") + public interface ModelWithUnwrappedArrayValuesService { + @Get("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (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 §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     colors (Required): [
+     *         String (Required)
+     *     ]
+     *     counts (Required): [
+     *         int (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java new file mode 100644 index 00000000000..6916e345448 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 ModelWithUnwrappedModelArrayValues. + */ +public final class ModelWithUnwrappedModelArrayValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithUnwrappedModelArrayValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithUnwrappedModelArrayValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithUnwrappedModelArrayValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithUnwrappedModelArrayValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithUnwrappedModelArrayValues to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithUnwrappedModelArrayValues") + public interface ModelWithUnwrappedModelArrayValuesService { + @Get("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithUnwrappedModelArray") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.2 — Contains an unwrapped array of models along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (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 §4.2 — Contains an unwrapped array of models along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     items (Required): [
+     *          (Required){
+     *             name: String (Required)
+     *             age: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java new file mode 100644 index 00000000000..6e75b937e9d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 + * ModelWithWrappedPrimitiveCustomItemNamesValues. + */ +public final class ModelWithWrappedPrimitiveCustomItemNamesValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelWithWrappedPrimitiveCustomItemNamesValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of ModelWithWrappedPrimitiveCustomItemNamesValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelWithWrappedPrimitiveCustomItemNamesValuesImpl(XmlClientImpl client) { + this.service = RestProxy.create(ModelWithWrappedPrimitiveCustomItemNamesValuesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientModelWithWrappedPrimitiveCustomItemNamesValues to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientModelWithWrappedPrimitiveCustomItemNamesValues") + public interface ModelWithWrappedPrimitiveCustomItemNamesValuesService { + @Get("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/modelWithWrappedPrimitiveCustomItemNames") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         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 §3.5 — Contains a wrapped primitive array with custom wrapper and item names along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     ItemsTags (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java new file mode 100644 index 00000000000..c7118dac973 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.annotation.BodyParam; +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.Put; +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 SimpleModelValues. + */ +public final class SimpleModelValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final SimpleModelValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of SimpleModelValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SimpleModelValuesImpl(XmlClientImpl client) { + this.service + = RestProxy.create(SimpleModelValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientSimpleModelValues to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientSimpleModelValues") + public interface SimpleModelValuesService { + @Get("/payload/xml/simpleModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/simpleModel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/simpleModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> put(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @BodyParam("application/xml") BinaryData input, + RequestOptions requestOptions, Context context); + + @Put("/payload/xml/simpleModel") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response putSync(@HostParam("endpoint") String endpoint, @HeaderParam("content-type") String contentType, + @BodyParam("application/xml") BinaryData input, RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putWithResponseAsync(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return FluxUtil.withContext( + context -> service.put(this.client.getEndpoint(), contentType, input, requestOptions, context)); + } + + /** + * The put operation. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (Required)
+     * }
+     * }
+     * 
+ * + * @param input The input parameter. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(BinaryData input, RequestOptions requestOptions) { + final String contentType = "application/xml"; + return service.putSync(this.client.getEndpoint(), contentType, input, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java new file mode 100644 index 00000000000..8cb3afa3c6b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlClientImpl.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +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.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; + +/** + * Initializes a new instance of the XmlClient type. + */ +public final class XmlClientImpl { + /** + * 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; + } + + /** + * The SimpleModelValuesImpl object to access its operations. + */ + private final SimpleModelValuesImpl simpleModelValues; + + /** + * Gets the SimpleModelValuesImpl object to access its operations. + * + * @return the SimpleModelValuesImpl object. + */ + public SimpleModelValuesImpl getSimpleModelValues() { + return this.simpleModelValues; + } + + /** + * The ModelWithRenamedPropertyValuesImpl object to access its operations. + */ + private final ModelWithRenamedPropertyValuesImpl modelWithRenamedPropertyValues; + + /** + * Gets the ModelWithRenamedPropertyValuesImpl object to access its operations. + * + * @return the ModelWithRenamedPropertyValuesImpl object. + */ + public ModelWithRenamedPropertyValuesImpl getModelWithRenamedPropertyValues() { + return this.modelWithRenamedPropertyValues; + } + + /** + * The ModelWithRenamedFieldsValuesImpl object to access its operations. + */ + private final ModelWithRenamedFieldsValuesImpl modelWithRenamedFieldsValues; + + /** + * Gets the ModelWithRenamedFieldsValuesImpl object to access its operations. + * + * @return the ModelWithRenamedFieldsValuesImpl object. + */ + public ModelWithRenamedFieldsValuesImpl getModelWithRenamedFieldsValues() { + return this.modelWithRenamedFieldsValues; + } + + /** + * The ModelWithNestedModelValuesImpl object to access its operations. + */ + private final ModelWithNestedModelValuesImpl modelWithNestedModelValues; + + /** + * Gets the ModelWithNestedModelValuesImpl object to access its operations. + * + * @return the ModelWithNestedModelValuesImpl object. + */ + public ModelWithNestedModelValuesImpl getModelWithNestedModelValues() { + return this.modelWithNestedModelValues; + } + + /** + * The ModelWithRenamedNestedModelValuesImpl object to access its operations. + */ + private final ModelWithRenamedNestedModelValuesImpl modelWithRenamedNestedModelValues; + + /** + * Gets the ModelWithRenamedNestedModelValuesImpl object to access its operations. + * + * @return the ModelWithRenamedNestedModelValuesImpl object. + */ + public ModelWithRenamedNestedModelValuesImpl getModelWithRenamedNestedModelValues() { + return this.modelWithRenamedNestedModelValues; + } + + /** + * The ModelWithSimpleArraysValuesImpl object to access its operations. + */ + private final ModelWithSimpleArraysValuesImpl modelWithSimpleArraysValues; + + /** + * Gets the ModelWithSimpleArraysValuesImpl object to access its operations. + * + * @return the ModelWithSimpleArraysValuesImpl object. + */ + public ModelWithSimpleArraysValuesImpl getModelWithSimpleArraysValues() { + return this.modelWithSimpleArraysValues; + } + + /** + * The ModelWithUnwrappedArrayValuesImpl object to access its operations. + */ + private final ModelWithUnwrappedArrayValuesImpl modelWithUnwrappedArrayValues; + + /** + * Gets the ModelWithUnwrappedArrayValuesImpl object to access its operations. + * + * @return the ModelWithUnwrappedArrayValuesImpl object. + */ + public ModelWithUnwrappedArrayValuesImpl getModelWithUnwrappedArrayValues() { + return this.modelWithUnwrappedArrayValues; + } + + /** + * The ModelWithRenamedArraysValuesImpl object to access its operations. + */ + private final ModelWithRenamedArraysValuesImpl modelWithRenamedArraysValues; + + /** + * Gets the ModelWithRenamedArraysValuesImpl object to access its operations. + * + * @return the ModelWithRenamedArraysValuesImpl object. + */ + public ModelWithRenamedArraysValuesImpl getModelWithRenamedArraysValues() { + return this.modelWithRenamedArraysValues; + } + + /** + * The ModelWithWrappedPrimitiveCustomItemNamesValuesImpl object to access its operations. + */ + private final ModelWithWrappedPrimitiveCustomItemNamesValuesImpl modelWithWrappedPrimitiveCustomItemNamesValues; + + /** + * Gets the ModelWithWrappedPrimitiveCustomItemNamesValuesImpl object to access its operations. + * + * @return the ModelWithWrappedPrimitiveCustomItemNamesValuesImpl object. + */ + public ModelWithWrappedPrimitiveCustomItemNamesValuesImpl getModelWithWrappedPrimitiveCustomItemNamesValues() { + return this.modelWithWrappedPrimitiveCustomItemNamesValues; + } + + /** + * The ModelWithArrayOfModelValuesImpl object to access its operations. + */ + private final ModelWithArrayOfModelValuesImpl modelWithArrayOfModelValues; + + /** + * Gets the ModelWithArrayOfModelValuesImpl object to access its operations. + * + * @return the ModelWithArrayOfModelValuesImpl object. + */ + public ModelWithArrayOfModelValuesImpl getModelWithArrayOfModelValues() { + return this.modelWithArrayOfModelValues; + } + + /** + * The ModelWithUnwrappedModelArrayValuesImpl object to access its operations. + */ + private final ModelWithUnwrappedModelArrayValuesImpl modelWithUnwrappedModelArrayValues; + + /** + * Gets the ModelWithUnwrappedModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithUnwrappedModelArrayValuesImpl object. + */ + public ModelWithUnwrappedModelArrayValuesImpl getModelWithUnwrappedModelArrayValues() { + return this.modelWithUnwrappedModelArrayValues; + } + + /** + * The ModelWithRenamedWrappedModelArrayValuesImpl object to access its operations. + */ + private final ModelWithRenamedWrappedModelArrayValuesImpl modelWithRenamedWrappedModelArrayValues; + + /** + * Gets the ModelWithRenamedWrappedModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithRenamedWrappedModelArrayValuesImpl object. + */ + public ModelWithRenamedWrappedModelArrayValuesImpl getModelWithRenamedWrappedModelArrayValues() { + return this.modelWithRenamedWrappedModelArrayValues; + } + + /** + * The ModelWithRenamedUnwrappedModelArrayValuesImpl object to access its operations. + */ + private final ModelWithRenamedUnwrappedModelArrayValuesImpl modelWithRenamedUnwrappedModelArrayValues; + + /** + * Gets the ModelWithRenamedUnwrappedModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithRenamedUnwrappedModelArrayValuesImpl object. + */ + public ModelWithRenamedUnwrappedModelArrayValuesImpl getModelWithRenamedUnwrappedModelArrayValues() { + return this.modelWithRenamedUnwrappedModelArrayValues; + } + + /** + * The ModelWithRenamedWrappedAndItemModelArrayValuesImpl object to access its operations. + */ + private final ModelWithRenamedWrappedAndItemModelArrayValuesImpl modelWithRenamedWrappedAndItemModelArrayValues; + + /** + * Gets the ModelWithRenamedWrappedAndItemModelArrayValuesImpl object to access its operations. + * + * @return the ModelWithRenamedWrappedAndItemModelArrayValuesImpl object. + */ + public ModelWithRenamedWrappedAndItemModelArrayValuesImpl getModelWithRenamedWrappedAndItemModelArrayValues() { + return this.modelWithRenamedWrappedAndItemModelArrayValues; + } + + /** + * The ModelWithAttributesValuesImpl object to access its operations. + */ + private final ModelWithAttributesValuesImpl modelWithAttributesValues; + + /** + * Gets the ModelWithAttributesValuesImpl object to access its operations. + * + * @return the ModelWithAttributesValuesImpl object. + */ + public ModelWithAttributesValuesImpl getModelWithAttributesValues() { + return this.modelWithAttributesValues; + } + + /** + * The ModelWithRenamedAttributeValuesImpl object to access its operations. + */ + private final ModelWithRenamedAttributeValuesImpl modelWithRenamedAttributeValues; + + /** + * Gets the ModelWithRenamedAttributeValuesImpl object to access its operations. + * + * @return the ModelWithRenamedAttributeValuesImpl object. + */ + public ModelWithRenamedAttributeValuesImpl getModelWithRenamedAttributeValues() { + return this.modelWithRenamedAttributeValues; + } + + /** + * The ModelWithNamespaceValuesImpl object to access its operations. + */ + private final ModelWithNamespaceValuesImpl modelWithNamespaceValues; + + /** + * Gets the ModelWithNamespaceValuesImpl object to access its operations. + * + * @return the ModelWithNamespaceValuesImpl object. + */ + public ModelWithNamespaceValuesImpl getModelWithNamespaceValues() { + return this.modelWithNamespaceValues; + } + + /** + * The ModelWithNamespaceOnPropertiesValuesImpl object to access its operations. + */ + private final ModelWithNamespaceOnPropertiesValuesImpl modelWithNamespaceOnPropertiesValues; + + /** + * Gets the ModelWithNamespaceOnPropertiesValuesImpl object to access its operations. + * + * @return the ModelWithNamespaceOnPropertiesValuesImpl object. + */ + public ModelWithNamespaceOnPropertiesValuesImpl getModelWithNamespaceOnPropertiesValues() { + return this.modelWithNamespaceOnPropertiesValues; + } + + /** + * The ModelWithTextValuesImpl object to access its operations. + */ + private final ModelWithTextValuesImpl modelWithTextValues; + + /** + * Gets the ModelWithTextValuesImpl object to access its operations. + * + * @return the ModelWithTextValuesImpl object. + */ + public ModelWithTextValuesImpl getModelWithTextValues() { + return this.modelWithTextValues; + } + + /** + * The ModelWithOptionalFieldValuesImpl object to access its operations. + */ + private final ModelWithOptionalFieldValuesImpl modelWithOptionalFieldValues; + + /** + * Gets the ModelWithOptionalFieldValuesImpl object to access its operations. + * + * @return the ModelWithOptionalFieldValuesImpl object. + */ + public ModelWithOptionalFieldValuesImpl getModelWithOptionalFieldValues() { + return this.modelWithOptionalFieldValues; + } + + /** + * The ModelWithEmptyArrayValuesImpl object to access its operations. + */ + private final ModelWithEmptyArrayValuesImpl modelWithEmptyArrayValues; + + /** + * Gets the ModelWithEmptyArrayValuesImpl object to access its operations. + * + * @return the ModelWithEmptyArrayValuesImpl object. + */ + public ModelWithEmptyArrayValuesImpl getModelWithEmptyArrayValues() { + return this.modelWithEmptyArrayValues; + } + + /** + * The ModelWithDictionaryValuesImpl object to access its operations. + */ + private final ModelWithDictionaryValuesImpl modelWithDictionaryValues; + + /** + * Gets the ModelWithDictionaryValuesImpl object to access its operations. + * + * @return the ModelWithDictionaryValuesImpl object. + */ + public ModelWithDictionaryValuesImpl getModelWithDictionaryValues() { + return this.modelWithDictionaryValues; + } + + /** + * The ModelWithEncodedNamesValuesImpl object to access its operations. + */ + private final ModelWithEncodedNamesValuesImpl modelWithEncodedNamesValues; + + /** + * Gets the ModelWithEncodedNamesValuesImpl object to access its operations. + * + * @return the ModelWithEncodedNamesValuesImpl object. + */ + public ModelWithEncodedNamesValuesImpl getModelWithEncodedNamesValues() { + return this.modelWithEncodedNamesValues; + } + + /** + * The ModelWithEnumValuesImpl object to access its operations. + */ + private final ModelWithEnumValuesImpl modelWithEnumValues; + + /** + * Gets the ModelWithEnumValuesImpl object to access its operations. + * + * @return the ModelWithEnumValuesImpl object. + */ + public ModelWithEnumValuesImpl getModelWithEnumValues() { + return this.modelWithEnumValues; + } + + /** + * The ModelWithDatetimeValuesImpl object to access its operations. + */ + private final ModelWithDatetimeValuesImpl modelWithDatetimeValues; + + /** + * Gets the ModelWithDatetimeValuesImpl object to access its operations. + * + * @return the ModelWithDatetimeValuesImpl object. + */ + public ModelWithDatetimeValuesImpl getModelWithDatetimeValues() { + return this.modelWithDatetimeValues; + } + + /** + * The XmlErrorValuesImpl object to access its operations. + */ + private final XmlErrorValuesImpl xmlErrorValues; + + /** + * Gets the XmlErrorValuesImpl object to access its operations. + * + * @return the XmlErrorValuesImpl object. + */ + public XmlErrorValuesImpl getXmlErrorValues() { + return this.xmlErrorValues; + } + + /** + * Initializes an instance of XmlClient client. + * + * @param endpoint Service host. + */ + public XmlClientImpl(String endpoint) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of XmlClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + */ + public XmlClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of XmlClient 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 XmlClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.simpleModelValues = new SimpleModelValuesImpl(this); + this.modelWithRenamedPropertyValues = new ModelWithRenamedPropertyValuesImpl(this); + this.modelWithRenamedFieldsValues = new ModelWithRenamedFieldsValuesImpl(this); + this.modelWithNestedModelValues = new ModelWithNestedModelValuesImpl(this); + this.modelWithRenamedNestedModelValues = new ModelWithRenamedNestedModelValuesImpl(this); + this.modelWithSimpleArraysValues = new ModelWithSimpleArraysValuesImpl(this); + this.modelWithUnwrappedArrayValues = new ModelWithUnwrappedArrayValuesImpl(this); + this.modelWithRenamedArraysValues = new ModelWithRenamedArraysValuesImpl(this); + this.modelWithWrappedPrimitiveCustomItemNamesValues + = new ModelWithWrappedPrimitiveCustomItemNamesValuesImpl(this); + this.modelWithArrayOfModelValues = new ModelWithArrayOfModelValuesImpl(this); + this.modelWithUnwrappedModelArrayValues = new ModelWithUnwrappedModelArrayValuesImpl(this); + this.modelWithRenamedWrappedModelArrayValues = new ModelWithRenamedWrappedModelArrayValuesImpl(this); + this.modelWithRenamedUnwrappedModelArrayValues = new ModelWithRenamedUnwrappedModelArrayValuesImpl(this); + this.modelWithRenamedWrappedAndItemModelArrayValues + = new ModelWithRenamedWrappedAndItemModelArrayValuesImpl(this); + this.modelWithAttributesValues = new ModelWithAttributesValuesImpl(this); + this.modelWithRenamedAttributeValues = new ModelWithRenamedAttributeValuesImpl(this); + this.modelWithNamespaceValues = new ModelWithNamespaceValuesImpl(this); + this.modelWithNamespaceOnPropertiesValues = new ModelWithNamespaceOnPropertiesValuesImpl(this); + this.modelWithTextValues = new ModelWithTextValuesImpl(this); + this.modelWithOptionalFieldValues = new ModelWithOptionalFieldValuesImpl(this); + this.modelWithEmptyArrayValues = new ModelWithEmptyArrayValuesImpl(this); + this.modelWithDictionaryValues = new ModelWithDictionaryValuesImpl(this); + this.modelWithEncodedNamesValues = new ModelWithEncodedNamesValuesImpl(this); + this.modelWithEnumValues = new ModelWithEnumValuesImpl(this); + this.modelWithDatetimeValues = new ModelWithDatetimeValuesImpl(this); + this.xmlErrorValues = new XmlErrorValuesImpl(this); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java new file mode 100644 index 00000000000..7afe99f802f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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 XmlErrorValues. + */ +public final class XmlErrorValuesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final XmlErrorValuesService service; + + /** + * The service client containing this operation class. + */ + private final XmlClientImpl client; + + /** + * Initializes an instance of XmlErrorValuesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + XmlErrorValuesImpl(XmlClientImpl client) { + this.service + = RestProxy.create(XmlErrorValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for XmlClientXmlErrorValues to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "XmlClientXmlErrorValues") + public interface XmlErrorValuesService { + @Get("/payload/xml/error") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> get(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/xml/error") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The get operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     age: int (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 §1.1 — Contains fields of primitive types along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(RequestOptions requestOptions) { + final String accept = "application/xml"; + return service.getSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java new file mode 100644 index 00000000000..95475498fb6 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializer.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UncheckedIOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.concurrent.ConcurrentHashMap; +import javax.xml.stream.XMLStreamException; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +/** + * An {@link ObjectSerializer} implementation that serializes and deserializes {@link XmlSerializable} types using + * {@code azure-xml}. Deserialization relies on the generated static {@code fromXml(XmlReader)} factory method on the + * target type. + */ +public final class XmlSerializer implements ObjectSerializer { + + private static final ConcurrentHashMap, Method> FROM_XML_CACHE = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings("unchecked") + public T deserialize(InputStream stream, TypeReference typeReference) { + Class clazz = (Class) typeReference.getJavaClass(); + Method fromXml = FROM_XML_CACHE.computeIfAbsent(clazz, c -> { + try { + return c.getDeclaredMethod("fromXml", XmlReader.class); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + "Type " + c.getName() + " does not have a static fromXml(XmlReader) method.", e); + } + }); + try (XmlReader xmlReader = XmlReader.fromStream(stream)) { + return (T) fromXml.invoke(null, xmlReader); + } catch (XMLStreamException | IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause() == null ? e : e.getCause()); + } + } + + @Override + public Mono deserializeAsync(InputStream stream, TypeReference typeReference) { + return Mono.fromCallable(() -> deserialize(stream, typeReference)); + } + + @Override + public void serialize(OutputStream stream, Object value) { + if (!(value instanceof XmlSerializable)) { + throw new IllegalArgumentException("Value must implement XmlSerializable to be serialized as XML, but was: " + + (value == null ? "null" : value.getClass().getName())); + } + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + xmlWriter.writeStartDocument(); + xmlWriter.writeXml((XmlSerializable) value); + xmlWriter.flush(); + } catch (XMLStreamException e) { + throw new UncheckedIOException(new IOException(e)); + } + } + + @Override + public Mono serializeAsync(OutputStream stream, Object value) { + return Mono.fromRunnable(() -> serialize(stream, value)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java new file mode 100644 index 00000000000..555862b3797 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/XmlSerializerProviders.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; + +// DO NOT modify this helper class + +/** + * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using + * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. + */ +public final class XmlSerializerProviders { + + /** + * Creates an instance of an XML {@link ObjectSerializer}. + * + * @return A new instance of an XML {@link ObjectSerializer}. + */ + public static ObjectSerializer createInstance() { + return new XmlSerializer(); + } + + private XmlSerializerProviders() { + // no-op + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/implementation/package-info.java new file mode 100644 index 00000000000..01798e3cbc8 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/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 Xml. + * Sends and receives bodies in XML format. + * + */ +package payload.xml.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.java new file mode 100644 index 00000000000..10501b0d4a4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Author.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.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Author model with a custom XML name. + */ +@Immutable +public final class Author implements XmlSerializable { + /* + * The name property. + */ + @Generated + private final String name; + + /** + * Creates an instance of Author class. + * + * @param name the name value to set. + */ + @Generated + public Author(String name) { + this.name = name; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "XmlAuthor" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("name", this.name); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of Author from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of Author if the XmlReader was pointing to an instance of it, or null if it was pointing to + * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Author. + */ + @Generated + public static Author fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of Author from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of Author if the XmlReader was pointing to an instance of it, or null if it was pointing to + * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Author. + */ + @Generated + public static Author fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "XmlAuthor" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String name = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("name".equals(elementName.getLocalPart())) { + name = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new Author(name); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.java new file mode 100644 index 00000000000..67db0bf1c81 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Book.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.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Book model with a custom XML name. + */ +@Immutable +public final class Book implements XmlSerializable { + /* + * The title property. + */ + @Generated + private final String title; + + /** + * Creates an instance of Book class. + * + * @param title the title value to set. + */ + @Generated + public Book(String title) { + this.title = title; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "XmlBook" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("title", this.title); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of Book from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of Book if the XmlReader was pointing to an instance of it, or null if it was pointing to XML + * null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Book. + */ + @Generated + public static Book fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of Book from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of Book if the XmlReader was pointing to an instance of it, or null if it was pointing to XML + * null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the Book. + */ + @Generated + public static Book fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "XmlBook" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String title = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("title".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new Book(title); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java new file mode 100644 index 00000000000..b704fe56ec2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithArrayOfModel.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.1 — Contains an array of models. + */ +@Immutable +public final class ModelWithArrayOfModel implements XmlSerializable { + /* + * The items property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithArrayOfModel class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithArrayOfModel(List items) { + this.items = items; + } + + /** + * Get the items property: The items property. + * + * @return the items value. + */ + @Generated + public List getItems() { + if (this.items == null) { + return Collections.emptyList(); + } + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithArrayOfModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + xmlWriter.writeStartElement("items"); + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "SimpleModel"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithArrayOfModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithArrayOfModel if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithArrayOfModel. + */ + @Generated + public static ModelWithArrayOfModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithArrayOfModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithArrayOfModel if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithArrayOfModel. + */ + @Generated + public static ModelWithArrayOfModel fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithArrayOfModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("items".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("SimpleModel".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "SimpleModel")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithArrayOfModel(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java new file mode 100644 index 00000000000..9c138a93a50 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithAttributes.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §5.1 — Contains fields that are XML attributes. + */ +@Immutable +public final class ModelWithAttributes implements XmlSerializable { + /* + * The id1 property. + */ + @Generated + private final int id1; + + /* + * The id2 property. + */ + @Generated + private final String id2; + + /* + * The enabled property. + */ + @Generated + private final boolean enabled; + + /** + * Creates an instance of ModelWithAttributes class. + * + * @param id1 the id1 value to set. + * @param id2 the id2 value to set. + * @param enabled the enabled value to set. + */ + @Generated + public ModelWithAttributes(int id1, String id2, boolean enabled) { + this.id1 = id1; + this.id2 = id2; + this.enabled = enabled; + } + + /** + * Get the id1 property: The id1 property. + * + * @return the id1 value. + */ + @Generated + public int getId1() { + return this.id1; + } + + /** + * Get the id2 property: The id2 property. + * + * @return the id2 value. + */ + @Generated + public String getId2() { + return this.id2; + } + + /** + * Get the enabled property: The enabled property. + * + * @return the enabled value. + */ + @Generated + public boolean isEnabled() { + return this.enabled; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithAttributes" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeIntAttribute("id1", this.id1); + xmlWriter.writeStringAttribute("id2", this.id2); + xmlWriter.writeBooleanElement("enabled", this.enabled); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithAttributes from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithAttributes if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithAttributes. + */ + @Generated + public static ModelWithAttributes fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithAttributes from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithAttributes if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithAttributes. + */ + @Generated + public static ModelWithAttributes fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithAttributes" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + boolean enabled = false; + int id1 = reader.getIntAttribute(null, "id1"); + String id2 = reader.getStringAttribute(null, "id2"); + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("enabled".equals(elementName.getLocalPart())) { + enabled = reader.getBooleanElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithAttributes(id1, id2, enabled); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java new file mode 100644 index 00000000000..9d668e28050 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDatetime.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Objects; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains datetime properties with different encodings. + */ +@Immutable +public final class ModelWithDatetime implements XmlSerializable { + /* + * DateTime value with rfc3339 encoding. + */ + @Generated + private final OffsetDateTime rfc3339; + + /* + * DateTime value with rfc7231 encoding. + */ + @Generated + private final DateTimeRfc1123 rfc7231; + + /** + * Creates an instance of ModelWithDatetime class. + * + * @param rfc3339 the rfc3339 value to set. + * @param rfc7231 the rfc7231 value to set. + */ + @Generated + public ModelWithDatetime(OffsetDateTime rfc3339, OffsetDateTime rfc7231) { + this.rfc3339 = rfc3339; + if (rfc7231 == null) { + this.rfc7231 = null; + } else { + this.rfc7231 = new DateTimeRfc1123(rfc7231); + } + } + + /** + * Get the rfc3339 property: DateTime value with rfc3339 encoding. + * + * @return the rfc3339 value. + */ + @Generated + public OffsetDateTime getRfc3339() { + return this.rfc3339; + } + + /** + * Get the rfc7231 property: DateTime value with rfc7231 encoding. + * + * @return the rfc7231 value. + */ + @Generated + public OffsetDateTime getRfc7231() { + if (this.rfc7231 == null) { + return null; + } + return this.rfc7231.getDateTime(); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDatetime" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("rfc3339", + this.rfc3339 == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.rfc3339)); + xmlWriter.writeStringElement("rfc7231", Objects.toString(this.rfc7231, null)); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithDatetime from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithDatetime if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDatetime. + */ + @Generated + public static ModelWithDatetime fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithDatetime from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithDatetime if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDatetime. + */ + @Generated + public static ModelWithDatetime fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDatetime" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + OffsetDateTime rfc3339 = null; + OffsetDateTime rfc7231 = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("rfc3339".equals(elementName.getLocalPart())) { + rfc3339 = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); + } else if ("rfc7231".equals(elementName.getLocalPart())) { + DateTimeRfc1123 rfc7231Holder = reader.getNullableElement(DateTimeRfc1123::new); + if (rfc7231Holder != null) { + rfc7231 = rfc7231Holder.getDateTime(); + } + } else { + reader.skipElement(); + } + } + return new ModelWithDatetime(rfc3339, rfc7231); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java new file mode 100644 index 00000000000..10a30294918 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithDictionary.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.LinkedHashMap; +import java.util.Map; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains a dictionary of key value pairs. + */ +@Immutable +public final class ModelWithDictionary implements XmlSerializable { + /* + * The metadata property. + */ + @Generated + private final Map metadata; + + /** + * Creates an instance of ModelWithDictionary class. + * + * @param metadata the metadata value to set. + */ + @Generated + public ModelWithDictionary(Map metadata) { + this.metadata = metadata; + } + + /** + * Get the metadata property: The metadata property. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDictionary" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.metadata != null) { + xmlWriter.writeStartElement("metadata"); + for (Map.Entry entry : this.metadata.entrySet()) { + xmlWriter.writeStringElement(entry.getKey(), entry.getValue()); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithDictionary from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithDictionary if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDictionary. + */ + @Generated + public static ModelWithDictionary fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithDictionary from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithDictionary if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithDictionary. + */ + @Generated + public static ModelWithDictionary fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithDictionary" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + Map metadata = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("metadata".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + if (metadata == null) { + metadata = new LinkedHashMap<>(); + } + metadata.put(reader.getElementName().getLocalPart(), reader.getStringElement()); + } + } else { + reader.skipElement(); + } + } + return new ModelWithDictionary(metadata); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java new file mode 100644 index 00000000000..6bcda4230e3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEmptyArray.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains an array of models that's supposed to be sent/received as an empty XML element. + */ +@Immutable +public final class ModelWithEmptyArray implements XmlSerializable { + /* + * The items property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithEmptyArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithEmptyArray(List items) { + this.items = items; + } + + /** + * Get the items property: The items property. + * + * @return the items value. + */ + @Generated + public List getItems() { + if (this.items == null) { + return Collections.emptyList(); + } + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEmptyArray" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + xmlWriter.writeStartElement("items"); + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "SimpleModel"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithEmptyArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithEmptyArray if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEmptyArray. + */ + @Generated + public static ModelWithEmptyArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithEmptyArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithEmptyArray if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEmptyArray. + */ + @Generated + public static ModelWithEmptyArray fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEmptyArray" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("items".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("SimpleModel".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "SimpleModel")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithEmptyArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java new file mode 100644 index 00000000000..f291aec6929 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEncodedNames.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Uses encodedName instead of Xml.Name which is functionally equivalent. + */ +@Immutable +public final class ModelWithEncodedNames implements XmlSerializable { + /* + * The SimpleModelData property. + */ + @Generated + private final SimpleModel modelData; + + /* + * The PossibleColors property. + */ + @Generated + private final List colors; + + /** + * Creates an instance of ModelWithEncodedNames class. + * + * @param modelData the modelData value to set. + * @param colors the colors value to set. + */ + @Generated + public ModelWithEncodedNames(SimpleModel modelData, List colors) { + this.modelData = modelData; + this.colors = colors; + } + + /** + * Get the modelData property: The SimpleModelData property. + * + * @return the modelData value. + */ + @Generated + public SimpleModel getModelData() { + return this.modelData; + } + + /** + * Get the colors property: The PossibleColors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + if (this.colors == null) { + return Collections.emptyList(); + } + return this.colors; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEncodedNamesSrc" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.modelData, "SimpleModelData"); + if (this.colors != null) { + xmlWriter.writeStartElement("PossibleColors"); + for (String element : this.colors) { + xmlWriter.writeStringElement("string", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithEncodedNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithEncodedNames if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEncodedNames. + */ + @Generated + public static ModelWithEncodedNames fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithEncodedNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithEncodedNames if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEncodedNames. + */ + @Generated + public static ModelWithEncodedNames fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEncodedNamesSrc" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + SimpleModel modelData = null; + List colors = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("SimpleModelData".equals(elementName.getLocalPart())) { + modelData = SimpleModel.fromXml(reader, "SimpleModelData"); + } else if ("PossibleColors".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("string".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithEncodedNames(modelData, colors); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.java new file mode 100644 index 00000000000..552919e682d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithEnum.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.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains a single property with an enum value. + */ +@Immutable +public final class ModelWithEnum implements XmlSerializable { + /* + * The status property. + */ + @Generated + private final Status status; + + /** + * Creates an instance of ModelWithEnum class. + * + * @param status the status value to set. + */ + @Generated + public ModelWithEnum(Status status) { + this.status = status; + } + + /** + * Get the status property: The status property. + * + * @return the status value. + */ + @Generated + public Status getStatus() { + return this.status; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEnum" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("status", this.status == null ? null : this.status.toString()); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithEnum from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithEnum if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEnum. + */ + @Generated + public static ModelWithEnum fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithEnum from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithEnum if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithEnum. + */ + @Generated + public static ModelWithEnum fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithEnum" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + Status status = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("status".equals(elementName.getLocalPart())) { + status = Status.fromString(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + return new ModelWithEnum(status); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java new file mode 100644 index 00000000000..94ce00a218f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespace.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §6.1, §7.1 — Contains fields with XML namespace on the model. + */ +@Immutable +public final class ModelWithNamespace implements XmlSerializable { + private static final String EXAMPLE_COM__SCHEMA = "http://example.com/schema"; + + /* + * The id property. + */ + @Generated + private final int id; + + /* + * The title property. + */ + @Generated + private final String title; + + /** + * Creates an instance of ModelWithNamespace class. + * + * @param id the id value to set. + * @param title the title value to set. + */ + @Generated + public ModelWithNamespace(int id, String title) { + this.id = id; + this.title = title; + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + @Generated + public int getId() { + return this.id; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespace" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeNamespace(EXAMPLE_COM__SCHEMA); + xmlWriter.writeIntElement("id", this.id); + xmlWriter.writeStringElement("title", this.title); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithNamespace from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithNamespace if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespace. + */ + @Generated + public static ModelWithNamespace fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithNamespace from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithNamespace if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespace. + */ + @Generated + public static ModelWithNamespace fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespace" : rootElementName; + return xmlReader.readObject(EXAMPLE_COM__SCHEMA, finalRootElementName, reader -> { + int id = 0; + String title = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("id".equals(elementName.getLocalPart())) { + id = reader.getIntElement(); + } else if ("title".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithNamespace(id, title); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java new file mode 100644 index 00000000000..8703b51c53b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §6.2, §7.2 — Contains fields with different XML namespaces on individual properties. + */ +@Immutable +public final class ModelWithNamespaceOnProperties implements XmlSerializable { + private static final String EXAMPLE_COM__SCHEMA = "http://example.com/schema"; + + private static final String EXAMPLE_COM__NS2 = "http://example.com/ns2"; + + /* + * The id property. + */ + @Generated + private final int id; + + /* + * The title property. + */ + @Generated + private final String title; + + /* + * The author property. + */ + @Generated + private final String author; + + /** + * Creates an instance of ModelWithNamespaceOnProperties class. + * + * @param id the id value to set. + * @param title the title value to set. + * @param author the author value to set. + */ + @Generated + public ModelWithNamespaceOnProperties(int id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + @Generated + public int getId() { + return this.id; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public String getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespaceOnProperties" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeNamespace(EXAMPLE_COM__SCHEMA); + xmlWriter.writeNamespace("smp", EXAMPLE_COM__SCHEMA); + xmlWriter.writeNamespace("ns2", EXAMPLE_COM__NS2); + xmlWriter.writeIntElement("id", this.id); + xmlWriter.writeStringElement(EXAMPLE_COM__SCHEMA, "title", this.title); + xmlWriter.writeStringElement(EXAMPLE_COM__NS2, "author", this.author); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithNamespaceOnProperties from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithNamespaceOnProperties if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespaceOnProperties. + */ + @Generated + public static ModelWithNamespaceOnProperties fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithNamespaceOnProperties from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithNamespaceOnProperties if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNamespaceOnProperties. + */ + @Generated + public static ModelWithNamespaceOnProperties fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNamespaceOnProperties" : rootElementName; + return xmlReader.readObject(EXAMPLE_COM__SCHEMA, finalRootElementName, reader -> { + int id = 0; + String title = null; + String author = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("id".equals(elementName.getLocalPart())) { + id = reader.getIntElement(); + } else if ("title".equals(elementName.getLocalPart()) + && EXAMPLE_COM__SCHEMA.equals(elementName.getNamespaceURI())) { + title = reader.getStringElement(); + } else if ("author".equals(elementName.getLocalPart()) + && EXAMPLE_COM__NS2.equals(elementName.getNamespaceURI())) { + author = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithNamespaceOnProperties(id, title, author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java new file mode 100644 index 00000000000..9bed9ec2d2d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithNestedModel.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §2.1 — Contains a property that references another model. + */ +@Immutable +public final class ModelWithNestedModel implements XmlSerializable { + /* + * The nested property. + */ + @Generated + private final SimpleModel nested; + + /** + * Creates an instance of ModelWithNestedModel class. + * + * @param nested the nested value to set. + */ + @Generated + public ModelWithNestedModel(SimpleModel nested) { + this.nested = nested; + } + + /** + * Get the nested property: The nested property. + * + * @return the nested value. + */ + @Generated + public SimpleModel getNested() { + return this.nested; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNestedModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.nested, "nested"); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithNestedModel if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNestedModel. + */ + @Generated + public static ModelWithNestedModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithNestedModel if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithNestedModel. + */ + @Generated + public static ModelWithNestedModel fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithNestedModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + SimpleModel nested = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("nested".equals(elementName.getLocalPart())) { + nested = SimpleModel.fromXml(reader, "nested"); + } else { + reader.skipElement(); + } + } + return new ModelWithNestedModel(nested); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java new file mode 100644 index 00000000000..ee2a303a98d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithOptionalField.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * Contains an optional field. + */ +@Fluent +public final class ModelWithOptionalField implements XmlSerializable { + /* + * The item property. + */ + @Generated + private final String item; + + /* + * The value property. + */ + @Generated + private Integer value; + + /** + * Creates an instance of ModelWithOptionalField class. + * + * @param item the item value to set. + */ + @Generated + public ModelWithOptionalField(String item) { + this.item = item; + } + + /** + * Get the item property: The item property. + * + * @return the item value. + */ + @Generated + public String getItem() { + return this.item; + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + @Generated + public Integer getValue() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ModelWithOptionalField object itself. + */ + @Generated + public ModelWithOptionalField setValue(Integer value) { + this.value = value; + return this; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithOptionalField" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("item", this.item); + xmlWriter.writeNumberElement("value", this.value); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithOptionalField from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithOptionalField if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithOptionalField. + */ + @Generated + public static ModelWithOptionalField fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithOptionalField from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithOptionalField if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithOptionalField. + */ + @Generated + public static ModelWithOptionalField fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithOptionalField" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String item = null; + Integer value = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("item".equals(elementName.getLocalPart())) { + item = reader.getStringElement(); + } else if ("value".equals(elementName.getLocalPart())) { + value = reader.getNullableElement(Integer::parseInt); + } else { + reader.skipElement(); + } + } + ModelWithOptionalField deserializedModelWithOptionalField = new ModelWithOptionalField(item); + deserializedModelWithOptionalField.value = value; + + return deserializedModelWithOptionalField; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java new file mode 100644 index 00000000000..9763df0711c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedArrays.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.3, §3.4 — Contains fields of wrapped and unwrapped arrays of primitive types that have different XML + * representations. + */ +@Immutable +public final class ModelWithRenamedArrays implements XmlSerializable { + /* + * The Colors property. + */ + @Generated + private final List colors; + + /* + * The Counts property. + */ + @Generated + private final List counts; + + /** + * Creates an instance of ModelWithRenamedArrays class. + * + * @param colors the colors value to set. + * @param counts the counts value to set. + */ + @Generated + public ModelWithRenamedArrays(List colors, List counts) { + this.colors = colors; + this.counts = counts; + } + + /** + * Get the colors property: The Colors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + return this.colors; + } + + /** + * Get the counts property: The Counts property. + * + * @return the counts value. + */ + @Generated + public List getCounts() { + if (this.counts == null) { + return Collections.emptyList(); + } + return this.counts; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedArrays" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.colors != null) { + for (String element : this.colors) { + xmlWriter.writeStringElement("Colors", element); + } + } + if (this.counts != null) { + xmlWriter.writeStartElement("Counts"); + for (int element : this.counts) { + xmlWriter.writeIntElement("int32", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedArrays. + */ + @Generated + public static ModelWithRenamedArrays fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedArrays. + */ + @Generated + public static ModelWithRenamedArrays fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedArrays" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List colors = null; + List counts = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("Colors".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else if ("Counts".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("int32".equals(elementName.getLocalPart())) { + if (counts == null) { + counts = new ArrayList<>(); + } + counts.add(reader.getIntElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedArrays(colors, counts); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java new file mode 100644 index 00000000000..8dc41c76ef0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedAttribute.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §5.2 — Contains a renamed XML attribute. + */ +@Immutable +public final class ModelWithRenamedAttribute implements XmlSerializable { + /* + * The xml-id property. + */ + @Generated + private final int id; + + /* + * The title property. + */ + @Generated + private final String title; + + /* + * The author property. + */ + @Generated + private final String author; + + /** + * Creates an instance of ModelWithRenamedAttribute class. + * + * @param id the id value to set. + * @param title the title value to set. + * @param author the author value to set. + */ + @Generated + public ModelWithRenamedAttribute(int id, String title, String author) { + this.id = id; + this.title = title; + this.author = author; + } + + /** + * Get the id property: The xml-id property. + * + * @return the id value. + */ + @Generated + public int getId() { + return this.id; + } + + /** + * Get the title property: The title property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public String getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedAttribute" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeIntAttribute("xml-id", this.id); + xmlWriter.writeStringElement("title", this.title); + xmlWriter.writeStringElement("author", this.author); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedAttribute from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedAttribute if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedAttribute. + */ + @Generated + public static ModelWithRenamedAttribute fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedAttribute from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedAttribute if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedAttribute. + */ + @Generated + public static ModelWithRenamedAttribute fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedAttribute" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String title = null; + String author = null; + int id = reader.getIntAttribute(null, "xml-id"); + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("title".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else if ("author".equals(elementName.getLocalPart())) { + author = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedAttribute(id, title, author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java new file mode 100644 index 00000000000..af2ea3211ce --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedFields.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §1.3, §2.3 — Contains fields of the same type that have different XML representation. + */ +@Immutable +public final class ModelWithRenamedFields implements XmlSerializable { + /* + * The InputData property. + */ + @Generated + private final SimpleModel inputData; + + /* + * The OutputData property. + */ + @Generated + private final SimpleModel outputData; + + /** + * Creates an instance of ModelWithRenamedFields class. + * + * @param inputData the inputData value to set. + * @param outputData the outputData value to set. + */ + @Generated + public ModelWithRenamedFields(SimpleModel inputData, SimpleModel outputData) { + this.inputData = inputData; + this.outputData = outputData; + } + + /** + * Get the inputData property: The InputData property. + * + * @return the inputData value. + */ + @Generated + public SimpleModel getInputData() { + return this.inputData; + } + + /** + * Get the outputData property: The OutputData property. + * + * @return the outputData value. + */ + @Generated + public SimpleModel getOutputData() { + return this.outputData; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedFieldsSrc" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.inputData, "InputData"); + xmlWriter.writeXml(this.outputData, "OutputData"); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedFields from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedFields if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedFields. + */ + @Generated + public static ModelWithRenamedFields fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedFields from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedFields if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedFields. + */ + @Generated + public static ModelWithRenamedFields fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedFieldsSrc" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + SimpleModel inputData = null; + SimpleModel outputData = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("InputData".equals(elementName.getLocalPart())) { + inputData = SimpleModel.fromXml(reader, "InputData"); + } else if ("OutputData".equals(elementName.getLocalPart())) { + outputData = SimpleModel.fromXml(reader, "OutputData"); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedFields(inputData, outputData); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java new file mode 100644 index 00000000000..a0547db93c3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedNestedModel.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.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §2.2 — Contains a property whose type has. + */ +@Immutable +public final class ModelWithRenamedNestedModel implements XmlSerializable { + /* + * The author property. + */ + @Generated + private final Author author; + + /** + * Creates an instance of ModelWithRenamedNestedModel class. + * + * @param author the author value to set. + */ + @Generated + public ModelWithRenamedNestedModel(Author author) { + this.author = author; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public Author getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedNestedModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeXml(this.author, "author"); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedNestedModel if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedNestedModel. + */ + @Generated + public static ModelWithRenamedNestedModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedNestedModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedNestedModel if the XmlReader was pointing to an instance of it, or null if + * it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedNestedModel. + */ + @Generated + public static ModelWithRenamedNestedModel fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedNestedModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + Author author = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("author".equals(elementName.getLocalPart())) { + author = Author.fromXml(reader, "author"); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedNestedModel(author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java new file mode 100644 index 00000000000..1f2b4fe0751 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedProperty.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §1.2 — Contains a scalar property with a custom XML name. + */ +@Immutable +public final class ModelWithRenamedProperty implements XmlSerializable { + /* + * The renamedTitle property. + */ + @Generated + private final String title; + + /* + * The author property. + */ + @Generated + private final String author; + + /** + * Creates an instance of ModelWithRenamedProperty class. + * + * @param title the title value to set. + * @param author the author value to set. + */ + @Generated + public ModelWithRenamedProperty(String title, String author) { + this.title = title; + this.author = author; + } + + /** + * Get the title property: The renamedTitle property. + * + * @return the title value. + */ + @Generated + public String getTitle() { + return this.title; + } + + /** + * Get the author property: The author property. + * + * @return the author value. + */ + @Generated + public String getAuthor() { + return this.author; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedProperty" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("renamedTitle", this.title); + xmlWriter.writeStringElement("author", this.author); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedProperty from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedProperty if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedProperty. + */ + @Generated + public static ModelWithRenamedProperty fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedProperty from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedProperty if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedProperty. + */ + @Generated + public static ModelWithRenamedProperty fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithRenamedProperty" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String title = null; + String author = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("renamedTitle".equals(elementName.getLocalPart())) { + title = reader.getStringElement(); + } else if ("author".equals(elementName.getLocalPart())) { + author = reader.getStringElement(); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedProperty(title, author); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java new file mode 100644 index 00000000000..9d8e72c78cf --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.4 — Contains an unwrapped array of models with a custom item name. + */ +@Immutable +public final class ModelWithRenamedUnwrappedModelArray implements XmlSerializable { + /* + * The ModelItem property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithRenamedUnwrappedModelArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithRenamedUnwrappedModelArray(List items) { + this.items = items; + } + + /** + * Get the items property: The ModelItem property. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedUnwrappedModelArray" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "ModelItem"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedUnwrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedUnwrappedModelArray. + */ + @Generated + public static ModelWithRenamedUnwrappedModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedUnwrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedUnwrappedModelArray. + */ + @Generated + public static ModelWithRenamedUnwrappedModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedUnwrappedModelArray" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("ModelItem".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "ModelItem")); + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedUnwrappedModelArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java new file mode 100644 index 00000000000..a312125463c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.5 — Contains a wrapped array of models with custom wrapper and item names. + */ +@Immutable +public final class ModelWithRenamedWrappedAndItemModelArray + implements XmlSerializable { + /* + * The AllBooks property. + */ + @Generated + private final List books; + + /** + * Creates an instance of ModelWithRenamedWrappedAndItemModelArray class. + * + * @param books the books value to set. + */ + @Generated + public ModelWithRenamedWrappedAndItemModelArray(List books) { + this.books = books; + } + + /** + * Get the books property: The AllBooks property. + * + * @return the books value. + */ + @Generated + public List getBooks() { + if (this.books == null) { + return Collections.emptyList(); + } + return this.books; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedAndItemModelArray" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.books != null) { + xmlWriter.writeStartElement("AllBooks"); + for (Book element : this.books) { + xmlWriter.writeXml(element, "XmlBook"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedWrappedAndItemModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedWrappedAndItemModelArray if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedAndItemModelArray. + */ + @Generated + public static ModelWithRenamedWrappedAndItemModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedWrappedAndItemModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedWrappedAndItemModelArray if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedAndItemModelArray. + */ + @Generated + public static ModelWithRenamedWrappedAndItemModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedAndItemModelArray" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List books = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("AllBooks".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("XmlBook".equals(elementName.getLocalPart())) { + if (books == null) { + books = new ArrayList<>(); + } + books.add(Book.fromXml(reader, "XmlBook")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedWrappedAndItemModelArray(books); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java new file mode 100644 index 00000000000..911f9c9f6c4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.3 — Contains a wrapped array of models with a custom wrapper name. + */ +@Immutable +public final class ModelWithRenamedWrappedModelArray implements XmlSerializable { + /* + * The AllItems property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithRenamedWrappedModelArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithRenamedWrappedModelArray(List items) { + this.items = items; + } + + /** + * Get the items property: The AllItems property. + * + * @return the items value. + */ + @Generated + public List getItems() { + if (this.items == null) { + return Collections.emptyList(); + } + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedModelArray" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + xmlWriter.writeStartElement("AllItems"); + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "SimpleModel"); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithRenamedWrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithRenamedWrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedModelArray. + */ + @Generated + public static ModelWithRenamedWrappedModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithRenamedWrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithRenamedWrappedModelArray if the XmlReader was pointing to an instance of it, or + * null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithRenamedWrappedModelArray. + */ + @Generated + public static ModelWithRenamedWrappedModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithRenamedWrappedModelArray" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("AllItems".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("SimpleModel".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "SimpleModel")); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithRenamedWrappedModelArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java new file mode 100644 index 00000000000..c9af743ddee --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithSimpleArrays.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.1 — Contains fields of arrays of primitive types. + */ +@Immutable +public final class ModelWithSimpleArrays implements XmlSerializable { + /* + * The colors property. + */ + @Generated + private final List colors; + + /* + * The counts property. + */ + @Generated + private final List counts; + + /** + * Creates an instance of ModelWithSimpleArrays class. + * + * @param colors the colors value to set. + * @param counts the counts value to set. + */ + @Generated + public ModelWithSimpleArrays(List colors, List counts) { + this.colors = colors; + this.counts = counts; + } + + /** + * Get the colors property: The colors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + if (this.colors == null) { + return Collections.emptyList(); + } + return this.colors; + } + + /** + * Get the counts property: The counts property. + * + * @return the counts value. + */ + @Generated + public List getCounts() { + if (this.counts == null) { + return Collections.emptyList(); + } + return this.counts; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithSimpleArrays" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.colors != null) { + xmlWriter.writeStartElement("colors"); + for (String element : this.colors) { + xmlWriter.writeStringElement("string", element); + } + xmlWriter.writeEndElement(); + } + if (this.counts != null) { + xmlWriter.writeStartElement("counts"); + for (int element : this.counts) { + xmlWriter.writeIntElement("int32", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithSimpleArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithSimpleArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithSimpleArrays. + */ + @Generated + public static ModelWithSimpleArrays fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithSimpleArrays from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithSimpleArrays if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithSimpleArrays. + */ + @Generated + public static ModelWithSimpleArrays fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithSimpleArrays" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List colors = null; + List counts = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("colors".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("string".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + } else if ("counts".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("int32".equals(elementName.getLocalPart())) { + if (counts == null) { + counts = new ArrayList<>(); + } + counts.add(reader.getIntElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithSimpleArrays(colors, counts); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java new file mode 100644 index 00000000000..1872225f83d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithText.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import javax.xml.stream.XMLStreamException; + +/** + * §8.1 — Contains an attribute and text. + */ +@Immutable +public final class ModelWithText implements XmlSerializable { + /* + * The language property. + */ + @Generated + private final String language; + + /* + * The content property. + */ + @Generated + private final String content; + + /** + * Creates an instance of ModelWithText class. + * + * @param language the language value to set. + * @param content the content value to set. + */ + @Generated + public ModelWithText(String language, String content) { + this.language = language; + this.content = content; + } + + /** + * Get the language property: The language property. + * + * @return the language value. + */ + @Generated + public String getLanguage() { + return this.language; + } + + /** + * Get the content property: The content property. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ModelWithText" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringAttribute("language", this.language); + xmlWriter.writeString(this.content); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithText from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithText if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithText. + */ + @Generated + public static ModelWithText fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithText from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithText if the XmlReader was pointing to an instance of it, or null if it was + * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithText. + */ + @Generated + public static ModelWithText fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithText" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String language = reader.getStringAttribute(null, "language"); + String content = reader.getStringElement(); + return new ModelWithText(language, content); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java new file mode 100644 index 00000000000..be68b0b5076 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedArray.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.2 — Contains fields of wrapped and unwrapped arrays of primitive types. + */ +@Immutable +public final class ModelWithUnwrappedArray implements XmlSerializable { + /* + * The colors property. + */ + @Generated + private final List colors; + + /* + * The counts property. + */ + @Generated + private final List counts; + + /** + * Creates an instance of ModelWithUnwrappedArray class. + * + * @param colors the colors value to set. + * @param counts the counts value to set. + */ + @Generated + public ModelWithUnwrappedArray(List colors, List counts) { + this.colors = colors; + this.counts = counts; + } + + /** + * Get the colors property: The colors property. + * + * @return the colors value. + */ + @Generated + public List getColors() { + return this.colors; + } + + /** + * Get the counts property: The counts property. + * + * @return the counts value. + */ + @Generated + public List getCounts() { + if (this.counts == null) { + return Collections.emptyList(); + } + return this.counts; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedArray" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.colors != null) { + for (String element : this.colors) { + xmlWriter.writeStringElement("colors", element); + } + } + if (this.counts != null) { + xmlWriter.writeStartElement("counts"); + for (int element : this.counts) { + xmlWriter.writeIntElement("int32", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithUnwrappedArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithUnwrappedArray if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedArray. + */ + @Generated + public static ModelWithUnwrappedArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithUnwrappedArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithUnwrappedArray if the XmlReader was pointing to an instance of it, or null if it + * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedArray. + */ + @Generated + public static ModelWithUnwrappedArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedArray" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List colors = null; + List counts = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("colors".equals(elementName.getLocalPart())) { + if (colors == null) { + colors = new ArrayList<>(); + } + colors.add(reader.getStringElement()); + } else if ("counts".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("int32".equals(elementName.getLocalPart())) { + if (counts == null) { + counts = new ArrayList<>(); + } + counts.add(reader.getIntElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithUnwrappedArray(colors, counts); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java new file mode 100644 index 00000000000..98f549f4216 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §4.2 — Contains an unwrapped array of models. + */ +@Immutable +public final class ModelWithUnwrappedModelArray implements XmlSerializable { + /* + * The items property. + */ + @Generated + private final List items; + + /** + * Creates an instance of ModelWithUnwrappedModelArray class. + * + * @param items the items value to set. + */ + @Generated + public ModelWithUnwrappedModelArray(List items) { + this.items = items; + } + + /** + * Get the items property: The items property. + * + * @return the items value. + */ + @Generated + public List getItems() { + return this.items; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedModelArray" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.items != null) { + for (SimpleModel element : this.items) { + xmlWriter.writeXml(element, "items"); + } + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithUnwrappedModelArray if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedModelArray. + */ + @Generated + public static ModelWithUnwrappedModelArray fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithUnwrappedModelArray from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithUnwrappedModelArray if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithUnwrappedModelArray. + */ + @Generated + public static ModelWithUnwrappedModelArray fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "ModelWithUnwrappedModelArray" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List items = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("items".equals(elementName.getLocalPart())) { + if (items == null) { + items = new ArrayList<>(); + } + items.add(SimpleModel.fromXml(reader, "items")); + } else { + reader.skipElement(); + } + } + return new ModelWithUnwrappedModelArray(items); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java new file mode 100644 index 00000000000..2891d72589f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §3.5 — Contains a wrapped primitive array with custom wrapper and item names. + */ +@Immutable +public final class ModelWithWrappedPrimitiveCustomItemNames + implements XmlSerializable { + /* + * The ItemsTags property. + */ + @Generated + private final List tags; + + /** + * Creates an instance of ModelWithWrappedPrimitiveCustomItemNames class. + * + * @param tags the tags value to set. + */ + @Generated + public ModelWithWrappedPrimitiveCustomItemNames(List tags) { + this.tags = tags; + } + + /** + * Get the tags property: The ItemsTags property. + * + * @return the tags value. + */ + @Generated + public List getTags() { + if (this.tags == null) { + return Collections.emptyList(); + } + return this.tags; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithWrappedPrimitiveCustomItemNames" + : rootElementName; + xmlWriter.writeStartElement(rootElementName); + if (this.tags != null) { + xmlWriter.writeStartElement("ItemsTags"); + for (String element : this.tags) { + xmlWriter.writeStringElement("ItemName", element); + } + xmlWriter.writeEndElement(); + } + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of ModelWithWrappedPrimitiveCustomItemNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ModelWithWrappedPrimitiveCustomItemNames if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithWrappedPrimitiveCustomItemNames. + */ + @Generated + public static ModelWithWrappedPrimitiveCustomItemNames fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of ModelWithWrappedPrimitiveCustomItemNames from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ModelWithWrappedPrimitiveCustomItemNames if the XmlReader was pointing to an instance of + * it, or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ModelWithWrappedPrimitiveCustomItemNames. + */ + @Generated + public static ModelWithWrappedPrimitiveCustomItemNames fromXml(XmlReader xmlReader, String rootElementName) + throws XMLStreamException { + String finalRootElementName = rootElementName == null || rootElementName.isEmpty() + ? "ModelWithWrappedPrimitiveCustomItemNames" + : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + List tags = null; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("ItemsTags".equals(elementName.getLocalPart())) { + while (reader.nextElement() != XmlToken.END_ELEMENT) { + elementName = reader.getElementName(); + if ("ItemName".equals(elementName.getLocalPart())) { + if (tags == null) { + tags = new ArrayList<>(); + } + tags.add(reader.getStringElement()); + } else { + reader.skipElement(); + } + } + } else { + reader.skipElement(); + } + } + return new ModelWithWrappedPrimitiveCustomItemNames(tags); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java new file mode 100644 index 00000000000..28c6c4db80c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/SimpleModel.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlToken; +import com.azure.xml.XmlWriter; +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +/** + * §1.1 — Contains fields of primitive types. + */ +@Immutable +public final class SimpleModel implements XmlSerializable { + /* + * The name property. + */ + @Generated + private final String name; + + /* + * The age property. + */ + @Generated + private final int age; + + /** + * Creates an instance of SimpleModel class. + * + * @param name the name value to set. + * @param age the age value to set. + */ + @Generated + public SimpleModel(String name, int age) { + this.name = name; + this.age = age; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the age property: The age property. + * + * @return the age value. + */ + @Generated + public int getAge() { + return this.age; + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { + return toXml(xmlWriter, null); + } + + @Generated + @Override + public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SimpleModel" : rootElementName; + xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("name", this.name); + xmlWriter.writeIntElement("age", this.age); + return xmlWriter.writeEndElement(); + } + + /** + * Reads an instance of SimpleModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of SimpleModel if the XmlReader was pointing to an instance of it, or null if it was pointing + * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the SimpleModel. + */ + @Generated + public static SimpleModel fromXml(XmlReader xmlReader) throws XMLStreamException { + return fromXml(xmlReader, null); + } + + /** + * Reads an instance of SimpleModel from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of SimpleModel if the XmlReader was pointing to an instance of it, or null if it was pointing + * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the SimpleModel. + */ + @Generated + public static SimpleModel fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "SimpleModel" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { + String name = null; + int age = 0; + while (reader.nextElement() != XmlToken.END_ELEMENT) { + QName elementName = reader.getElementName(); + + if ("name".equals(elementName.getLocalPart())) { + name = reader.getStringElement(); + } else if ("age".equals(elementName.getLocalPart())) { + age = reader.getIntElement(); + } else { + reader.skipElement(); + } + } + return new SimpleModel(name, age); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java new file mode 100644 index 00000000000..58df1c63742 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/Status.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status values for the model with enum. + */ +public final class Status extends ExpandableStringEnum { + /** + * Pending status. + */ + @Generated + public static final Status PENDING = fromString("pending"); + + /** + * Success status. + */ + @Generated + public static final Status SUCCESS = fromString("success"); + + /** + * Error status. + */ + @Generated + public static final Status ERROR = fromString("error"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @Generated + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + @Generated + public static Collection values() { + return values(Status.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/models/package-info.java new file mode 100644 index 00000000000..84cbf169271 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/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 Xml. + * Sends and receives bodies in XML format. + * + */ +package payload.xml.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/package-info.java new file mode 100644 index 00000000000..97e6da50516 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/xml/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 Xml. + * Sends and receives bodies in XML format. + * + */ +package payload.xml; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java index 0db178e9812..50e1b4e254d 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeAsyncClient.java @@ -31,7 +31,7 @@ public final class QueryParametersQueryExpansionExplodeAsyncClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -41,7 +41,7 @@ public final class QueryParametersQueryExpansionExplodeAsyncClient { /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -58,7 +58,7 @@ public Mono> primitiveWithResponse(String param, RequestOptions r /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -75,7 +75,7 @@ public Mono> arrayWithResponse(List param, RequestOptions /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -92,7 +92,7 @@ public Mono> recordWithResponse(Map param, Reque /** * The model operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -109,7 +109,7 @@ public Mono> modelWithResponse(ExpandParameters param, RequestOpt /** * The primitive operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -129,7 +129,7 @@ public Mono primitive(String param) { /** * The array operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -149,7 +149,7 @@ public Mono array(List param) { /** * The record operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -169,7 +169,7 @@ public Mono record(Map param) { /** * The model operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java index 93fc57f51f5..44bdd1b9569 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/QueryParametersQueryExpansionExplodeClient.java @@ -29,7 +29,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * Initializes an instance of QueryParametersQueryExpansionExplodeClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -39,7 +39,7 @@ public final class QueryParametersQueryExpansionExplodeClient { /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -56,7 +56,7 @@ public Response primitiveWithResponse(String param, RequestOptions request /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -73,7 +73,7 @@ public Response arrayWithResponse(List param, RequestOptions reque /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -90,7 +90,7 @@ public Response recordWithResponse(Map param, RequestOpti /** * The model operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -107,7 +107,7 @@ public Response modelWithResponse(ExpandParameters param, RequestOptions r /** * The primitive operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -126,7 +126,7 @@ public void primitive(String param) { /** * The array operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -145,7 +145,7 @@ public void array(List param) { /** * The record operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -164,7 +164,7 @@ public void record(Map param) { /** * The model operation. - * + * * @param param The param parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java index 40267284f41..36c8031da86 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/routes/implementation/QueryParametersQueryExpansionExplodesImpl.java @@ -45,7 +45,7 @@ public final class QueryParametersQueryExpansionExplodesImpl { /** * Initializes an instance of QueryParametersQueryExpansionExplodesImpl. - * + * * @param client the instance of the service client containing this operation class. */ QueryParametersQueryExpansionExplodesImpl(RoutesClientImpl client) { @@ -138,7 +138,7 @@ Response modelSync(@HostParam("endpoint") String endpoint, @QueryParam("pa /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -155,7 +155,7 @@ public Mono> primitiveWithResponseAsync(String param, RequestOpti /** * The primitive operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -171,7 +171,7 @@ public Response primitiveWithResponse(String param, RequestOptions request /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -190,7 +190,7 @@ public Mono> arrayWithResponseAsync(List param, RequestOp /** * The array operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -208,7 +208,7 @@ public Response arrayWithResponse(List param, RequestOptions reque /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -225,7 +225,7 @@ public Mono> recordWithResponseAsync(Map param, /** * The record operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -241,7 +241,7 @@ public Response recordWithResponse(Map param, RequestOpti /** * The model operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -258,7 +258,7 @@ public Mono> modelWithResponseAsync(ExpandParameters param, Reque /** * The model operation. - * + * * @param param The param parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java index 42d47c981f5..def6bf62f56 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/ChildResourcesInterfacesClient.java @@ -25,7 +25,7 @@ public interface ChildResourcesInterfacesClient { /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -40,7 +40,7 @@ Mono> getWithResponseAsync(String resourceGroupName /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -55,7 +55,7 @@ Mono getAsync(String resourceGroupName, String topLevelArmRe /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -71,7 +71,7 @@ Response getWithResponse(String resourceGroupName, String to /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -85,7 +85,7 @@ Response getWithResponse(String resourceGroupName, String to /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -102,7 +102,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -118,7 +118,7 @@ PollerFlux, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -134,7 +134,7 @@ SyncPoller, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -151,7 +151,7 @@ SyncPoller, ChildResourceInner> beginCreateOrUpda /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -167,7 +167,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String to /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -183,7 +183,7 @@ ChildResourceInner createOrUpdate(String resourceGroupName, String topLevelArmRe /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -200,7 +200,7 @@ ChildResourceInner createOrUpdate(String resourceGroupName, String topLevelArmRe /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -217,7 +217,7 @@ Mono> updateWithResponseAsync(String resourceGroupN /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -233,7 +233,7 @@ Mono updateAsync(String resourceGroupName, String topLevelAr /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -250,7 +250,7 @@ Response updateWithResponse(String resourceGroupName, String /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -266,7 +266,7 @@ ChildResourceInner update(String resourceGroupName, String topLevelArmResourceNa /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -281,7 +281,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -296,7 +296,7 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -311,7 +311,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -327,7 +327,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -341,7 +341,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -354,7 +354,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -368,7 +368,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -382,7 +382,7 @@ PagedFlux listByTopLevelArmResourceAsync(String resourceGrou /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -396,7 +396,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroup /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -411,7 +411,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroup /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -426,7 +426,7 @@ Mono>> actionWithoutBodyWithResponseAsync(String resou /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -441,7 +441,7 @@ PollerFlux, Void> beginActionWithoutBodyAsync(String resourceGr /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -456,7 +456,7 @@ SyncPoller, Void> beginActionWithoutBody(String resourceGroupNa /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -472,7 +472,7 @@ SyncPoller, Void> beginActionWithoutBody(String resourceGroupNa /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -487,7 +487,7 @@ Mono actionWithoutBodyAsync(String resourceGroupName, String topLevelArmRe /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -500,7 +500,7 @@ Mono actionWithoutBodyAsync(String resourceGroupName, String topLevelArmRe /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java index ec7042e626e..035d05577de 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/LroNoBodiesClient.java @@ -23,7 +23,7 @@ public interface LroNoBodiesClient { /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -38,7 +38,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -53,7 +53,7 @@ PollerFlux, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -68,7 +68,7 @@ SyncPoller, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -84,7 +84,7 @@ SyncPoller, ResourceLroNoBody> beginCreateOrUpdate /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -99,7 +99,7 @@ Mono createOrUpdateAsync(String resourceGroupName, String res /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -114,7 +114,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -130,7 +130,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -143,7 +143,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,7 +157,7 @@ PollerFlux, ActionFinalResult> beginActionAsync(St /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -171,7 +171,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -186,7 +186,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -199,7 +199,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -212,7 +212,7 @@ SyncPoller, ActionFinalResult> beginAction(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java index afc61cdc14e..74d68c86378 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/TopLevelArmResourceInterfacesClient.java @@ -27,7 +27,7 @@ public interface TopLevelArmResourceInterfacesClient { /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ Mono> getByResourceGroupWithResponseAsync(Str /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -54,7 +54,7 @@ Mono> getByResourceGroupWithResponseAsync(Str /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -69,7 +69,7 @@ Response getByResourceGroupWithResponse(String resourc /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -82,7 +82,7 @@ Response getByResourceGroupWithResponse(String resourc /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -98,7 +98,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -114,7 +114,7 @@ PollerFlux, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -130,7 +130,7 @@ SyncPoller, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -147,7 +147,7 @@ SyncPoller, TopLevelArmResourceInner> begin /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -163,7 +163,7 @@ Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -178,7 +178,7 @@ TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String topLeve /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -194,7 +194,7 @@ TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String topLeve /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -210,7 +210,7 @@ Mono> updateWithResponseAsync(String resource /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -226,7 +226,7 @@ Mono updateAsync(String resourceGroupName, String topL /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -243,7 +243,7 @@ Response updateWithResponse(String resourceGroupName, /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -258,7 +258,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -271,7 +271,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -284,7 +284,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -297,7 +297,7 @@ TopLevelArmResourceInner update(String resourceGroupName, String topLevelArmReso /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -312,7 +312,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -325,7 +325,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,7 +337,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -350,7 +350,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -362,7 +362,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -374,7 +374,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -387,7 +387,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedFlux}. @@ -397,7 +397,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -407,7 +407,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * List TopLevelArmResource resources by subscription 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. @@ -419,7 +419,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -432,7 +432,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -446,7 +446,7 @@ PollerFlux, ResultInner> beginActionAsync(String resourc /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -460,7 +460,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -475,7 +475,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -488,7 +488,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -501,7 +501,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -515,7 +515,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -528,7 +528,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -541,7 +541,7 @@ SyncPoller, ResultInner> beginAction(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -556,7 +556,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java index 2d0813ac890..2a1b8023152 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/ChildResourcesInterfacesClientImpl.java @@ -58,7 +58,7 @@ public final class ChildResourcesInterfacesClientImpl implements ChildResourcesI /** * Initializes an instance of ChildResourcesInterfacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ChildResourcesInterfacesClientImpl(ArmClientImpl client) { @@ -219,7 +219,7 @@ Response listByTopLevelArmResourceNextSync( /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -241,7 +241,7 @@ public Mono> getWithResponseAsync(String resourceGr /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -259,7 +259,7 @@ public Mono getAsync(String resourceGroupName, String topLev /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -279,7 +279,7 @@ public Response getWithResponse(String resourceGroupName, St /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -295,7 +295,7 @@ public ChildResourceInner get(String resourceGroupName, String topLevelArmResour /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -320,7 +320,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -342,7 +342,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -365,7 +365,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -387,7 +387,7 @@ public PollerFlux, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -408,7 +408,7 @@ public SyncPoller, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -430,7 +430,7 @@ public SyncPoller, ChildResourceInner> beginCreat /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -449,7 +449,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, St /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -468,7 +468,7 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev /** * Create a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -488,7 +488,7 @@ public ChildResourceInner createOrUpdate(String resourceGroupName, String topLev /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -513,7 +513,7 @@ public Mono> updateWithResponseAsync(String resourc /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -532,7 +532,7 @@ public Mono updateAsync(String resourceGroupName, String top /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -555,7 +555,7 @@ public Response updateWithResponse(String resourceGroupName, /** * Update a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -574,7 +574,7 @@ public ChildResourceInner update(String resourceGroupName, String topLevelArmRes /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -593,7 +593,7 @@ public Mono>> deleteWithResponseAsync(String resourceG /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -612,7 +612,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -631,7 +631,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -651,7 +651,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -670,7 +670,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -690,7 +690,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -707,7 +707,7 @@ public Mono deleteAsync(String resourceGroupName, String topLevelArmResour /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -722,7 +722,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -739,7 +739,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Str /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -763,7 +763,7 @@ private Mono> listByTopLevelArmResourceSingleP /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -781,7 +781,7 @@ public PagedFlux listByTopLevelArmResourceAsync(String resou /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -802,7 +802,7 @@ private PagedResponse listByTopLevelArmResourceSinglePage(St /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -824,7 +824,7 @@ private PagedResponse listByTopLevelArmResourceSinglePage(St /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -842,7 +842,7 @@ public PagedIterable listByTopLevelArmResource(String resour /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -861,7 +861,7 @@ public PagedIterable listByTopLevelArmResource(String resour /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -882,7 +882,7 @@ public Mono>> actionWithoutBodyWithResponseAsync(Strin /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -901,7 +901,7 @@ private Response actionWithoutBodyWithResponse(String resourceGroupN /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -920,7 +920,7 @@ private Response actionWithoutBodyWithResponse(String resourceGroupN /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -940,7 +940,7 @@ public PollerFlux, Void> beginActionWithoutBodyAsync(String res /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -959,7 +959,7 @@ public SyncPoller, Void> beginActionWithoutBody(String resource /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -979,7 +979,7 @@ public SyncPoller, Void> beginActionWithoutBody(String resource /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -997,7 +997,7 @@ public Mono actionWithoutBodyAsync(String resourceGroupName, String topLev /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -1012,7 +1012,7 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -1029,7 +1029,7 @@ public void actionWithoutBody(String resourceGroupName, String topLevelArmResour /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1050,7 +1050,7 @@ private Mono> listByTopLevelArmResourceNextSin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1068,7 +1068,7 @@ private PagedResponse listByTopLevelArmResourceNextSinglePag /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java index 6c16d9e70ec..ec4d1b05aac 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/LroNoBodiesClientImpl.java @@ -50,7 +50,7 @@ public final class LroNoBodiesClientImpl implements LroNoBodiesClient { /** * Initializes an instance of LroNoBodiesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LroNoBodiesClientImpl(ArmClientImpl client) { @@ -111,7 +111,7 @@ Response actionSync(@HostParam("endpoint") String endpoint, /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -133,7 +133,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -153,7 +153,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -173,7 +173,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -193,7 +193,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -212,7 +212,7 @@ public SyncPoller, ResourceLroNoBody> beginCreateO /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -233,7 +233,7 @@ public SyncPoller, ResourceLroNoBody> beginCreateO /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -251,7 +251,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, Str /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -268,7 +268,7 @@ public ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourc /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -286,7 +286,7 @@ public ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourc /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -306,7 +306,7 @@ public Mono>> actionWithResponseAsync(String resourceG /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -323,7 +323,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -342,7 +342,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -360,7 +360,7 @@ public PollerFlux, ActionFinalResult> beginActionA /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -378,7 +378,7 @@ public SyncPoller, ActionFinalResult> beginAction( /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. @@ -397,7 +397,7 @@ public SyncPoller, ActionFinalResult> beginAction( /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -413,7 +413,7 @@ public Mono actionAsync(String resourceGroupName, String reso /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -428,7 +428,7 @@ public ActionFinalResult action(String resourceGroupName, String resourceLroNoBo /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java index 2f8df3c431d..9afa8c34fe2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceInterfacesClientImpl.java @@ -59,7 +59,7 @@ public final class TopLevelArmResourceInterfacesClientImpl implements TopLevelAr /** * Initializes an instance of TopLevelArmResourceInterfacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ TopLevelArmResourceInterfacesClientImpl(ArmClientImpl client) { @@ -262,7 +262,7 @@ Response listBySubscriptionNextSync( /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -282,7 +282,7 @@ public Mono> getByResourceGroupWithResponseAs /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,7 +299,7 @@ public Mono getByResourceGroupAsync(String resourceGro /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -318,7 +318,7 @@ public Response getByResourceGroupWithResponse(String /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -333,7 +333,7 @@ public TopLevelArmResourceInner getByResourceGroup(String resourceGroupName, Str /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -357,7 +357,7 @@ public Mono>> createOrUpdateWithResponseAsync(String r /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -379,7 +379,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -402,7 +402,7 @@ private Response createOrUpdateWithResponse(String resourceGroupName /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -424,7 +424,7 @@ public PollerFlux, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -445,7 +445,7 @@ public SyncPoller, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -467,7 +467,7 @@ public SyncPoller, TopLevelArmResourceInner /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -486,7 +486,7 @@ public Mono createOrUpdateAsync(String resourceGroupNa /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -503,7 +503,7 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String /** * Create a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param resource Resource create parameters. @@ -521,7 +521,7 @@ public TopLevelArmResourceInner createOrUpdate(String resourceGroupName, String /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -545,7 +545,7 @@ public Mono> updateWithResponseAsync(String r /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -564,7 +564,7 @@ public Mono updateAsync(String resourceGroupName, Stri /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -587,7 +587,7 @@ public Response updateWithResponse(String resourceGrou /** * Update a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param properties The resource properties to be updated. @@ -604,7 +604,7 @@ public TopLevelArmResourceInner update(String resourceGroupName, String topLevel /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -623,7 +623,7 @@ public Mono>> deleteWithResponseAsync(String resourceG /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -639,7 +639,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -657,7 +657,7 @@ private Response deleteWithResponse(String resourceGroupName, String /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -675,7 +675,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -691,7 +691,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -709,7 +709,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -725,7 +725,7 @@ public Mono deleteAsync(String resourceGroupName, String topLevelArmResour /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -739,7 +739,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName) { /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -754,7 +754,7 @@ public void delete(String resourceGroupName, String topLevelArmResourceName, Con /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -775,7 +775,7 @@ private Mono> listByResourceGroupSingleP /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -790,7 +790,7 @@ public PagedFlux listByResourceGroupAsync(String resou /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -808,7 +808,7 @@ private PagedResponse listByResourceGroupSinglePage(St /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -828,7 +828,7 @@ private PagedResponse listByResourceGroupSinglePage(St /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -843,7 +843,7 @@ public PagedIterable listByResourceGroup(String resour /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -859,7 +859,7 @@ public PagedIterable listByResourceGroup(String resour /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation along with {@link PagedResponse} on successful @@ -878,7 +878,7 @@ private Mono> listSinglePageAsync() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedFlux}. @@ -891,7 +891,7 @@ public PagedFlux listAsync() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation along with {@link PagedResponse}. @@ -907,7 +907,7 @@ private PagedResponse listSinglePage() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -925,7 +925,7 @@ private PagedResponse listSinglePage(Context context) /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -937,7 +937,7 @@ public PagedIterable list() { /** * List TopLevelArmResource resources by subscription ID. - * + * * @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. @@ -952,7 +952,7 @@ public PagedIterable list(Context context) { /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -972,7 +972,7 @@ public Mono>> actionWithResponseAsync(String resourceG /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -989,7 +989,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1008,7 +1008,7 @@ private Response actionWithResponse(String resourceGroupName, String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1026,7 +1026,7 @@ public PollerFlux, ResultInner> beginActionAsync(String /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1044,7 +1044,7 @@ public SyncPoller, ResultInner> beginAction(String resou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1063,7 +1063,7 @@ public SyncPoller, ResultInner> beginAction(String resou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1079,7 +1079,7 @@ public Mono actionAsync(String resourceGroupName, String topLevelAr /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1094,7 +1094,7 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1110,7 +1110,7 @@ public ResultInner action(String resourceGroupName, String topLevelArmResourceNa /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1130,7 +1130,7 @@ public Mono> publishXmlWithResponseAsync(String resourceGro /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1146,7 +1146,7 @@ public Mono publishXmlAsync(String resourceGroupName, String topLeve /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -1165,7 +1165,7 @@ public Response publishXmlWithResponse(String resourceGroupName, Str /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1180,7 +1180,7 @@ public BinaryData publishXml(String resourceGroupName, String topLevelArmResourc /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1201,7 +1201,7 @@ private Mono> listByResourceGroupNextSin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1219,7 +1219,7 @@ private PagedResponse listByResourceGroupNextSinglePag /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1239,7 +1239,7 @@ private PagedResponse listByResourceGroupNextSinglePag /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1260,7 +1260,7 @@ private Mono> listBySubscriptionNextSing /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1278,7 +1278,7 @@ private PagedResponse listBySubscriptionNextSinglePage /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java index 1c3094c01ba..0e705f4e6bb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResource.java @@ -16,77 +16,77 @@ public interface ChildResource { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: Provisioning State of Top Level Arm Resource. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * 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 name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner tsptest.armresourceprovider.fluent.models.ChildResourceInner object. - * + * * @return the inner object. */ ChildResourceInner innerModel(); @@ -114,7 +114,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -122,7 +122,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -135,7 +135,7 @@ interface WithLocation { interface WithParentResource { /** * Specifies resourceGroupName, topLevelArmResourceName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @return the next definition stage. @@ -150,14 +150,14 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. - * + * * @return the created resource. */ ChildResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -170,7 +170,7 @@ interface WithCreate extends DefinitionStages.WithTags { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -180,7 +180,7 @@ interface WithTags { /** * Begins update for the ChildResource resource. - * + * * @return the stage of resource update. */ ChildResource.Update update(); @@ -191,14 +191,14 @@ interface WithTags { interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ ChildResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ @@ -215,7 +215,7 @@ interface UpdateStages { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -225,14 +225,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ChildResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -240,7 +240,7 @@ interface WithTags { /** * The actionWithoutBody operation. - * + * * @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. */ @@ -248,7 +248,7 @@ interface WithTags { /** * The actionWithoutBody operation. - * + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java index b444c4076b2..61b9bb2d56c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/ChildResourcesInterfaces.java @@ -14,7 +14,7 @@ public interface ChildResourcesInterfaces { /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -29,7 +29,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Get a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -42,7 +42,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -54,7 +54,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * Delete a ChildResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -67,7 +67,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +79,7 @@ Response getWithResponse(String resourceGroupName, String topLeve /** * List ChildResource resources by TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -93,7 +93,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroupName, /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -105,7 +105,7 @@ PagedIterable listByTopLevelArmResource(String resourceGroupName, /** * The actionWithoutBody operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param childResourceName ChildResources. @@ -119,7 +119,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Get a ChildResource. - * + * * @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. @@ -130,7 +130,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Get a ChildResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +142,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Delete a ChildResource. - * + * * @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. @@ -152,7 +152,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Delete a ChildResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -163,7 +163,7 @@ void actionWithoutBody(String resourceGroupName, String topLevelArmResourceName, /** * Begins definition for a new ChildResource resource. - * + * * @param name resource name. * @return the first stage of the new ChildResource definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java index 55c3b53818c..491876f952b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/LroNoBodies.java @@ -12,7 +12,7 @@ public interface LroNoBodies { /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -26,7 +26,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * Create a ResourceLroNoBody. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param resource Resource create parameters. @@ -41,7 +41,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -53,7 +53,7 @@ ResourceLroNoBody createOrUpdate(String resourceGroupName, String resourceLroNoB /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceLroNoBodyName The name of the ResourceLroNoBody. * @param context The context to associate with this operation. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java index eb481f1e0d3..1e361be04f8 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResource.java @@ -20,119 +20,119 @@ public interface TopLevelArmResource { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the configurationEndpoints property: Configuration Endpoints. - * + * * @return the configurationEndpoints value. */ List configurationEndpoints(); /** * Gets the userName property: The userName property. - * + * * @return the userName value. */ String userName(); /** * Gets the userNames property: The userNames property. - * + * * @return the userNames value. */ String userNames(); /** * Gets the accuserName property: The accuserName property. - * + * * @return the accuserName value. */ String accuserName(); /** * Gets the startTimeStamp property: The startTimeStamp property. - * + * * @return the startTimeStamp value. */ OffsetDateTime startTimeStamp(); /** * Gets the size property: The size property. - * + * * @return the size value. */ Float size(); /** * Gets the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * 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 name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner tsptest.armresourceprovider.fluent.models.TopLevelArmResourceInner object. - * + * * @return the inner object. */ TopLevelArmResourceInner innerModel(); @@ -160,7 +160,7 @@ interface Blank extends WithLocation { interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -168,7 +168,7 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -181,7 +181,7 @@ interface WithLocation { interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -196,14 +196,14 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithUse DefinitionStages.WithUserNames, DefinitionStages.WithAccuserName, DefinitionStages.WithStartTimeStamp { /** * Executes the create request. - * + * * @return the created resource. */ TopLevelArmResource create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ @@ -216,7 +216,7 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithUse interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -229,7 +229,7 @@ interface WithTags { interface WithUserName { /** * Specifies the userName property: The userName property.. - * + * * @param userName The userName property. * @return the next definition stage. */ @@ -242,7 +242,7 @@ interface WithUserName { interface WithUserNames { /** * Specifies the userNames property: The userNames property.. - * + * * @param userNames The userNames property. * @return the next definition stage. */ @@ -255,7 +255,7 @@ interface WithUserNames { interface WithAccuserName { /** * Specifies the accuserName property: The accuserName property.. - * + * * @param accuserName The accuserName property. * @return the next definition stage. */ @@ -268,7 +268,7 @@ interface WithAccuserName { interface WithStartTimeStamp { /** * Specifies the startTimeStamp property: The startTimeStamp property.. - * + * * @param startTimeStamp The startTimeStamp property. * @return the next definition stage. */ @@ -278,7 +278,7 @@ interface WithStartTimeStamp { /** * Begins update for the TopLevelArmResource resource. - * + * * @return the stage of resource update. */ TopLevelArmResource.Update update(); @@ -290,14 +290,14 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithUserName, Updat UpdateStages.WithAccuserName { /** * Executes the update request. - * + * * @return the updated resource. */ TopLevelArmResource apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ @@ -314,7 +314,7 @@ interface UpdateStages { interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -327,7 +327,7 @@ interface WithTags { interface WithUserName { /** * Specifies the userName property: The userName property.. - * + * * @param userName The userName property. * @return the next definition stage. */ @@ -340,7 +340,7 @@ interface WithUserName { interface WithUserNames { /** * Specifies the userNames property: The userNames property.. - * + * * @param userNames The userNames property. * @return the next definition stage. */ @@ -353,7 +353,7 @@ interface WithUserNames { interface WithAccuserName { /** * Specifies the accuserName property: The accuserName property.. - * + * * @param accuserName The accuserName property. * @return the next definition stage. */ @@ -363,14 +363,14 @@ interface WithAccuserName { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ TopLevelArmResource refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -378,7 +378,7 @@ interface WithAccuserName { /** * The action operation. - * + * * @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. @@ -387,7 +387,7 @@ interface WithAccuserName { /** * The action operation. - * + * * @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. @@ -398,7 +398,7 @@ interface WithAccuserName { /** * A synchronous resource action. - * + * * @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. @@ -409,7 +409,7 @@ interface WithAccuserName { /** * A synchronous resource action. - * + * * @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. diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java index f47c8896bcb..2573e18decf 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/TopLevelArmResourceInterfaces.java @@ -15,7 +15,7 @@ public interface TopLevelArmResourceInterfaces { /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -29,7 +29,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Get a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +41,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +52,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * Delete a TopLevelArmResource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -64,7 +64,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -75,7 +75,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -87,7 +87,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by subscription ID. - * + * * @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 of a TopLevelArmResource list operation as paginated response with {@link PagedIterable}. @@ -96,7 +96,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * List TopLevelArmResource resources by subscription 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. @@ -107,7 +107,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -119,7 +119,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * The action operation. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -132,7 +132,7 @@ Response getByResourceGroupWithResponse(String resourceGrou /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @param context The context to associate with this operation. @@ -146,7 +146,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * A synchronous resource action. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param topLevelArmResourceName arm resource name for path. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -158,7 +158,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Get a TopLevelArmResource. - * + * * @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. @@ -169,7 +169,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Get a TopLevelArmResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +181,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Delete a TopLevelArmResource. - * + * * @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. @@ -191,7 +191,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Delete a TopLevelArmResource. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,7 +202,7 @@ Response publishXmlWithResponse(String resourceGroupName, String top /** * Begins definition for a new TopLevelArmResource resource. - * + * * @param name resource name. * @return the first stage of the new TopLevelArmResource definition. */ diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json new file mode 100644 index 00000000000..1dba4b1f82c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-xml_metadata.json @@ -0,0 +1 @@ +{"flavor":"Azure","apiVersions":{},"crossLanguagePackageId":"Payload.Xml","crossLanguageVersion":"5b03b60108c5","crossLanguageDefinitions":{"payload.xml.ModelWithArrayOfModelValueAsyncClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueAsyncClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueAsyncClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient":"Payload.Xml.ModelWithArrayOfModelValue","payload.xml.ModelWithArrayOfModelValueClient.get":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.getWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.get","payload.xml.ModelWithArrayOfModelValueClient.put":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithArrayOfModelValueClient.putWithResponse":"Payload.Xml.ModelWithArrayOfModelValue.put","payload.xml.ModelWithAttributesValueAsyncClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueAsyncClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueAsyncClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient":"Payload.Xml.ModelWithAttributesValue","payload.xml.ModelWithAttributesValueClient.get":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.getWithResponse":"Payload.Xml.ModelWithAttributesValue.get","payload.xml.ModelWithAttributesValueClient.put":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithAttributesValueClient.putWithResponse":"Payload.Xml.ModelWithAttributesValue.put","payload.xml.ModelWithDatetimeValueAsyncClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueAsyncClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueAsyncClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient":"Payload.Xml.ModelWithDatetimeValue","payload.xml.ModelWithDatetimeValueClient.get":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.getWithResponse":"Payload.Xml.ModelWithDatetimeValue.get","payload.xml.ModelWithDatetimeValueClient.put":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDatetimeValueClient.putWithResponse":"Payload.Xml.ModelWithDatetimeValue.put","payload.xml.ModelWithDictionaryValueAsyncClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueAsyncClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueAsyncClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient":"Payload.Xml.ModelWithDictionaryValue","payload.xml.ModelWithDictionaryValueClient.get":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.getWithResponse":"Payload.Xml.ModelWithDictionaryValue.get","payload.xml.ModelWithDictionaryValueClient.put":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithDictionaryValueClient.putWithResponse":"Payload.Xml.ModelWithDictionaryValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueAsyncClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueAsyncClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient":"Payload.Xml.ModelWithEmptyArrayValue","payload.xml.ModelWithEmptyArrayValueClient.get":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.getWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.get","payload.xml.ModelWithEmptyArrayValueClient.put":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEmptyArrayValueClient.putWithResponse":"Payload.Xml.ModelWithEmptyArrayValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueAsyncClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueAsyncClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient":"Payload.Xml.ModelWithEncodedNamesValue","payload.xml.ModelWithEncodedNamesValueClient.get":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.getWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.get","payload.xml.ModelWithEncodedNamesValueClient.put":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEncodedNamesValueClient.putWithResponse":"Payload.Xml.ModelWithEncodedNamesValue.put","payload.xml.ModelWithEnumValueAsyncClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueAsyncClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueAsyncClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient":"Payload.Xml.ModelWithEnumValue","payload.xml.ModelWithEnumValueClient.get":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.getWithResponse":"Payload.Xml.ModelWithEnumValue.get","payload.xml.ModelWithEnumValueClient.put":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithEnumValueClient.putWithResponse":"Payload.Xml.ModelWithEnumValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient":"Payload.Xml.ModelWithNamespaceOnPropertiesValue","payload.xml.ModelWithNamespaceOnPropertiesValueClient.get":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.get","payload.xml.ModelWithNamespaceOnPropertiesValueClient.put":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceOnPropertiesValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceOnPropertiesValue.put","payload.xml.ModelWithNamespaceValueAsyncClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueAsyncClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueAsyncClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient":"Payload.Xml.ModelWithNamespaceValue","payload.xml.ModelWithNamespaceValueClient.get":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.getWithResponse":"Payload.Xml.ModelWithNamespaceValue.get","payload.xml.ModelWithNamespaceValueClient.put":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNamespaceValueClient.putWithResponse":"Payload.Xml.ModelWithNamespaceValue.put","payload.xml.ModelWithNestedModelValueAsyncClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient":"Payload.Xml.ModelWithNestedModelValue","payload.xml.ModelWithNestedModelValueClient.get":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithNestedModelValue.get","payload.xml.ModelWithNestedModelValueClient.put":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithNestedModelValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueAsyncClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueAsyncClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient":"Payload.Xml.ModelWithOptionalFieldValue","payload.xml.ModelWithOptionalFieldValueClient.get":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.getWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.get","payload.xml.ModelWithOptionalFieldValueClient.put":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithOptionalFieldValueClient.putWithResponse":"Payload.Xml.ModelWithOptionalFieldValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueAsyncClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueAsyncClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient":"Payload.Xml.ModelWithRenamedArraysValue","payload.xml.ModelWithRenamedArraysValueClient.get":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.get","payload.xml.ModelWithRenamedArraysValueClient.put":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedArraysValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedArraysValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueAsyncClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueAsyncClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient":"Payload.Xml.ModelWithRenamedAttributeValue","payload.xml.ModelWithRenamedAttributeValueClient.get":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.get","payload.xml.ModelWithRenamedAttributeValueClient.put":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedAttributeValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedAttributeValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueAsyncClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueAsyncClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient":"Payload.Xml.ModelWithRenamedFieldsValue","payload.xml.ModelWithRenamedFieldsValueClient.get":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.get","payload.xml.ModelWithRenamedFieldsValueClient.put":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedFieldsValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedFieldsValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient":"Payload.Xml.ModelWithRenamedNestedModelValue","payload.xml.ModelWithRenamedNestedModelValueClient.get":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.get","payload.xml.ModelWithRenamedNestedModelValueClient.put":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedNestedModelValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedNestedModelValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueAsyncClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueAsyncClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient":"Payload.Xml.ModelWithRenamedPropertyValue","payload.xml.ModelWithRenamedPropertyValueClient.get":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.get","payload.xml.ModelWithRenamedPropertyValueClient.put":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedPropertyValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedPropertyValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.get","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedUnwrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.get","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.get":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.get","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.put":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithRenamedWrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithRenamedWrappedModelArrayValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueAsyncClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueAsyncClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient":"Payload.Xml.ModelWithSimpleArraysValue","payload.xml.ModelWithSimpleArraysValueClient.get":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.getWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.get","payload.xml.ModelWithSimpleArraysValueClient.put":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithSimpleArraysValueClient.putWithResponse":"Payload.Xml.ModelWithSimpleArraysValue.put","payload.xml.ModelWithTextValueAsyncClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueAsyncClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueAsyncClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient":"Payload.Xml.ModelWithTextValue","payload.xml.ModelWithTextValueClient.get":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.getWithResponse":"Payload.Xml.ModelWithTextValue.get","payload.xml.ModelWithTextValueClient.put":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithTextValueClient.putWithResponse":"Payload.Xml.ModelWithTextValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient":"Payload.Xml.ModelWithUnwrappedArrayValue","payload.xml.ModelWithUnwrappedArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.get","payload.xml.ModelWithUnwrappedArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient":"Payload.Xml.ModelWithUnwrappedModelArrayValue","payload.xml.ModelWithUnwrappedModelArrayValueClient.get":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.getWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.get","payload.xml.ModelWithUnwrappedModelArrayValueClient.put":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithUnwrappedModelArrayValueClient.putWithResponse":"Payload.Xml.ModelWithUnwrappedModelArrayValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.get":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.getWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.get","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.put":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient.putWithResponse":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNamesValue.put","payload.xml.SimpleModelValueAsyncClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueAsyncClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueAsyncClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueAsyncClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient":"Payload.Xml.SimpleModelValue","payload.xml.SimpleModelValueClient.get":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.getWithResponse":"Payload.Xml.SimpleModelValue.get","payload.xml.SimpleModelValueClient.put":"Payload.Xml.SimpleModelValue.put","payload.xml.SimpleModelValueClient.putWithResponse":"Payload.Xml.SimpleModelValue.put","payload.xml.XmlClientBuilder":"Payload.Xml","payload.xml.XmlErrorValueAsyncClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueAsyncClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueAsyncClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient":"Payload.Xml.XmlErrorValue","payload.xml.XmlErrorValueClient.get":"Payload.Xml.XmlErrorValue.get","payload.xml.XmlErrorValueClient.getWithResponse":"Payload.Xml.XmlErrorValue.get","payload.xml.models.Author":"Payload.Xml.Author","payload.xml.models.Book":"Payload.Xml.Book","payload.xml.models.ModelWithArrayOfModel":"Payload.Xml.ModelWithArrayOfModel","payload.xml.models.ModelWithAttributes":"Payload.Xml.ModelWithAttributes","payload.xml.models.ModelWithDatetime":"Payload.Xml.ModelWithDatetime","payload.xml.models.ModelWithDictionary":"Payload.Xml.ModelWithDictionary","payload.xml.models.ModelWithEmptyArray":"Payload.Xml.ModelWithEmptyArray","payload.xml.models.ModelWithEncodedNames":"Payload.Xml.ModelWithEncodedNames","payload.xml.models.ModelWithEnum":"Payload.Xml.ModelWithEnum","payload.xml.models.ModelWithNamespace":"Payload.Xml.ModelWithNamespace","payload.xml.models.ModelWithNamespaceOnProperties":"Payload.Xml.ModelWithNamespaceOnProperties","payload.xml.models.ModelWithNestedModel":"Payload.Xml.ModelWithNestedModel","payload.xml.models.ModelWithOptionalField":"Payload.Xml.ModelWithOptionalField","payload.xml.models.ModelWithRenamedArrays":"Payload.Xml.ModelWithRenamedArrays","payload.xml.models.ModelWithRenamedAttribute":"Payload.Xml.ModelWithRenamedAttribute","payload.xml.models.ModelWithRenamedFields":"Payload.Xml.ModelWithRenamedFields","payload.xml.models.ModelWithRenamedNestedModel":"Payload.Xml.ModelWithRenamedNestedModel","payload.xml.models.ModelWithRenamedProperty":"Payload.Xml.ModelWithRenamedProperty","payload.xml.models.ModelWithRenamedUnwrappedModelArray":"Payload.Xml.ModelWithRenamedUnwrappedModelArray","payload.xml.models.ModelWithRenamedWrappedAndItemModelArray":"Payload.Xml.ModelWithRenamedWrappedAndItemModelArray","payload.xml.models.ModelWithRenamedWrappedModelArray":"Payload.Xml.ModelWithRenamedWrappedModelArray","payload.xml.models.ModelWithSimpleArrays":"Payload.Xml.ModelWithSimpleArrays","payload.xml.models.ModelWithText":"Payload.Xml.ModelWithText","payload.xml.models.ModelWithUnwrappedArray":"Payload.Xml.ModelWithUnwrappedArray","payload.xml.models.ModelWithUnwrappedModelArray":"Payload.Xml.ModelWithUnwrappedModelArray","payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames":"Payload.Xml.ModelWithWrappedPrimitiveCustomItemNames","payload.xml.models.SimpleModel":"Payload.Xml.SimpleModel","payload.xml.models.Status":"Payload.Xml.Status"},"generatedFiles":["src/main/java/module-info.java","src/main/java/payload/xml/ModelWithArrayOfModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithArrayOfModelValueClient.java","src/main/java/payload/xml/ModelWithAttributesValueAsyncClient.java","src/main/java/payload/xml/ModelWithAttributesValueClient.java","src/main/java/payload/xml/ModelWithDatetimeValueAsyncClient.java","src/main/java/payload/xml/ModelWithDatetimeValueClient.java","src/main/java/payload/xml/ModelWithDictionaryValueAsyncClient.java","src/main/java/payload/xml/ModelWithDictionaryValueClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithEmptyArrayValueClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithEncodedNamesValueClient.java","src/main/java/payload/xml/ModelWithEnumValueAsyncClient.java","src/main/java/payload/xml/ModelWithEnumValueClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceOnPropertiesValueClient.java","src/main/java/payload/xml/ModelWithNamespaceValueAsyncClient.java","src/main/java/payload/xml/ModelWithNamespaceValueClient.java","src/main/java/payload/xml/ModelWithNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithNestedModelValueClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueAsyncClient.java","src/main/java/payload/xml/ModelWithOptionalFieldValueClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedArraysValueClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedAttributeValueClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedFieldsValueClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedNestedModelValueClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedPropertyValueClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedAndItemModelArrayValueClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithRenamedWrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueAsyncClient.java","src/main/java/payload/xml/ModelWithSimpleArraysValueClient.java","src/main/java/payload/xml/ModelWithTextValueAsyncClient.java","src/main/java/payload/xml/ModelWithTextValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedArrayValueClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueAsyncClient.java","src/main/java/payload/xml/ModelWithUnwrappedModelArrayValueClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueAsyncClient.java","src/main/java/payload/xml/ModelWithWrappedPrimitiveCustomItemNamesValueClient.java","src/main/java/payload/xml/SimpleModelValueAsyncClient.java","src/main/java/payload/xml/SimpleModelValueClient.java","src/main/java/payload/xml/XmlClientBuilder.java","src/main/java/payload/xml/XmlErrorValueAsyncClient.java","src/main/java/payload/xml/XmlErrorValueClient.java","src/main/java/payload/xml/implementation/ModelWithArrayOfModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithAttributesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDatetimeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithDictionaryValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEmptyArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEncodedNamesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithEnumValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceOnPropertiesValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNamespaceValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithOptionalFieldValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedAttributeValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedFieldsValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedNestedModelValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedPropertyValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedAndItemModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithRenamedWrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithSimpleArraysValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithTextValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithUnwrappedModelArrayValuesImpl.java","src/main/java/payload/xml/implementation/ModelWithWrappedPrimitiveCustomItemNamesValuesImpl.java","src/main/java/payload/xml/implementation/SimpleModelValuesImpl.java","src/main/java/payload/xml/implementation/XmlClientImpl.java","src/main/java/payload/xml/implementation/XmlErrorValuesImpl.java","src/main/java/payload/xml/implementation/XmlSerializer.java","src/main/java/payload/xml/implementation/XmlSerializerProviders.java","src/main/java/payload/xml/implementation/package-info.java","src/main/java/payload/xml/models/Author.java","src/main/java/payload/xml/models/Book.java","src/main/java/payload/xml/models/ModelWithArrayOfModel.java","src/main/java/payload/xml/models/ModelWithAttributes.java","src/main/java/payload/xml/models/ModelWithDatetime.java","src/main/java/payload/xml/models/ModelWithDictionary.java","src/main/java/payload/xml/models/ModelWithEmptyArray.java","src/main/java/payload/xml/models/ModelWithEncodedNames.java","src/main/java/payload/xml/models/ModelWithEnum.java","src/main/java/payload/xml/models/ModelWithNamespace.java","src/main/java/payload/xml/models/ModelWithNamespaceOnProperties.java","src/main/java/payload/xml/models/ModelWithNestedModel.java","src/main/java/payload/xml/models/ModelWithOptionalField.java","src/main/java/payload/xml/models/ModelWithRenamedArrays.java","src/main/java/payload/xml/models/ModelWithRenamedAttribute.java","src/main/java/payload/xml/models/ModelWithRenamedFields.java","src/main/java/payload/xml/models/ModelWithRenamedNestedModel.java","src/main/java/payload/xml/models/ModelWithRenamedProperty.java","src/main/java/payload/xml/models/ModelWithRenamedUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedAndItemModelArray.java","src/main/java/payload/xml/models/ModelWithRenamedWrappedModelArray.java","src/main/java/payload/xml/models/ModelWithSimpleArrays.java","src/main/java/payload/xml/models/ModelWithText.java","src/main/java/payload/xml/models/ModelWithUnwrappedArray.java","src/main/java/payload/xml/models/ModelWithUnwrappedModelArray.java","src/main/java/payload/xml/models/ModelWithWrappedPrimitiveCustomItemNames.java","src/main/java/payload/xml/models/SimpleModel.java","src/main/java/payload/xml/models/Status.java","src/main/java/payload/xml/models/package-info.java","src/main/java/payload/xml/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json index 5617f0fdbaa..beaa0178c93 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-multipleclientssameversion_metadata.json @@ -1 +1 @@ -{"flavor":"Azure","apiVersions":{"TspTest.MultipleClientsSameVersion":"2023-06-01"},"crossLanguagePackageId":"TspTest.MultipleClientsSameVersion","crossLanguageVersion":"310aa2ab63d8","crossLanguageDefinitions":{"tsptest.multipleclientssameversion.AlphaAsyncClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClientBuilder":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.BetaAsyncClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaAsyncClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaAsyncClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClientBuilder":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.models.Resource":"TspTest.MultipleClientsSameVersion.Resource"},"generatedFiles":["src/main/java/module-info.java","src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java","src/main/java/tsptest/multipleclientssameversion/models/Resource.java","src/main/java/tsptest/multipleclientssameversion/models/package-info.java","src/main/java/tsptest/multipleclientssameversion/package-info.java"]} \ No newline at end of file +{"flavor":"Azure","apiVersions":{"TspTest.MultipleClientsSameVersion":"2023-06-01"},"crossLanguagePackageId":"TspTest.MultipleClientsSameVersion","crossLanguageVersion":"451a8a0d4aa0","crossLanguageDefinitions":{"tsptest.multipleclientssameversion.AlphaAsyncClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaAsyncClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.AlphaClient.getAlpha":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClient.getAlphaWithResponse":"TspTest.MultipleClientsSameVersion.AlphaClient.getAlpha","tsptest.multipleclientssameversion.AlphaClientBuilder":"TspTest.MultipleClientsSameVersion.AlphaClient","tsptest.multipleclientssameversion.BetaAsyncClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaAsyncClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaAsyncClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.BetaClient.getBeta":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClient.getBetaWithResponse":"TspTest.MultipleClientsSameVersion.BetaClient.getBeta","tsptest.multipleclientssameversion.BetaClientBuilder":"TspTest.MultipleClientsSameVersion.BetaClient","tsptest.multipleclientssameversion.models.Resource":"TspTest.MultipleClientsSameVersion.Resource"},"generatedFiles":["src/main/java/module-info.java","src/main/java/tsptest/multipleclientssameversion/AlphaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClient.java","src/main/java/tsptest/multipleclientssameversion/AlphaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/BetaAsyncClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClient.java","src/main/java/tsptest/multipleclientssameversion/BetaClientBuilder.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/MultipleClientsSameVersionServiceVersion.java","src/main/java/tsptest/multipleclientssameversion/implementation/AlphaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/BetaClientImpl.java","src/main/java/tsptest/multipleclientssameversion/implementation/package-info.java","src/main/java/tsptest/multipleclientssameversion/models/Resource.java","src/main/java/tsptest/multipleclientssameversion/models/package-info.java","src/main/java/tsptest/multipleclientssameversion/package-info.java"]} \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties new file mode 100644 index 00000000000..ca812989b4f --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/payload-xml.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java new file mode 100644 index 00000000000..685aa6f22f3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/XmlTests.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package payload.xml; + +import com.azure.core.exception.HttpResponseException; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import payload.xml.models.Author; +import payload.xml.models.Book; +import payload.xml.models.ModelWithArrayOfModel; +import payload.xml.models.ModelWithAttributes; +import payload.xml.models.ModelWithDatetime; +import payload.xml.models.ModelWithDictionary; +import payload.xml.models.ModelWithEmptyArray; +import payload.xml.models.ModelWithEncodedNames; +import payload.xml.models.ModelWithEnum; +import payload.xml.models.ModelWithNamespace; +import payload.xml.models.ModelWithNamespaceOnProperties; +import payload.xml.models.ModelWithNestedModel; +import payload.xml.models.ModelWithOptionalField; +import payload.xml.models.ModelWithRenamedArrays; +import payload.xml.models.ModelWithRenamedAttribute; +import payload.xml.models.ModelWithRenamedFields; +import payload.xml.models.ModelWithRenamedNestedModel; +import payload.xml.models.ModelWithRenamedProperty; +import payload.xml.models.ModelWithRenamedUnwrappedModelArray; +import payload.xml.models.ModelWithRenamedWrappedAndItemModelArray; +import payload.xml.models.ModelWithRenamedWrappedModelArray; +import payload.xml.models.ModelWithSimpleArrays; +import payload.xml.models.ModelWithText; +import payload.xml.models.ModelWithUnwrappedArray; +import payload.xml.models.ModelWithUnwrappedModelArray; +import payload.xml.models.ModelWithWrappedPrimitiveCustomItemNames; +import payload.xml.models.SimpleModel; +import payload.xml.models.Status; + +public final class XmlTests { + + @Test + public void testSimpleModel() { + SimpleModelValueClient client = new XmlClientBuilder().buildSimpleModelValueClient(); + + client.put(new SimpleModel("foo", 123)); + + SimpleModel model = client.get(); + Assertions.assertEquals("foo", model.getName()); + Assertions.assertEquals(123, model.getAge()); + } + + @Test + public void testModelWithSimpleArrays() { + ModelWithSimpleArraysValueClient client = new XmlClientBuilder().buildModelWithSimpleArraysValueClient(); + + client.put(new ModelWithSimpleArrays(List.of("red", "green", "blue"), List.of(1, 2))); + + ModelWithSimpleArrays model = client.get(); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + Assertions.assertEquals(List.of(1, 2), model.getCounts()); + } + + @Test + public void testModelWithArrayOfModel() { + ModelWithArrayOfModelValueClient client = new XmlClientBuilder().buildModelWithArrayOfModelValueClient(); + + client.put(new ModelWithArrayOfModel(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithArrayOfModel model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithOptionalField() { + ModelWithOptionalFieldValueClient client = new XmlClientBuilder().buildModelWithOptionalFieldValueClient(); + + client.put(new ModelWithOptionalField("widget")); + + ModelWithOptionalField model = client.get(); + Assertions.assertEquals("widget", model.getItem()); + } + + @Test + public void testModelWithAttributes() { + ModelWithAttributesValueClient client = new XmlClientBuilder().buildModelWithAttributesValueClient(); + + client.put(new ModelWithAttributes(123, "foo", true)); + + ModelWithAttributes model = client.get(); + Assertions.assertEquals(123, model.getId1()); + Assertions.assertEquals("foo", model.getId2()); + Assertions.assertEquals(true, model.isEnabled()); + } + + @Test + public void testModelWithUnwrappedArray() { + ModelWithUnwrappedArrayValueClient client = new XmlClientBuilder().buildModelWithUnwrappedArrayValueClient(); + + client.put(new ModelWithUnwrappedArray(List.of("red", "green", "blue"), List.of(1, 2))); + + ModelWithUnwrappedArray model = client.get(); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + Assertions.assertEquals(List.of(1, 2), model.getCounts()); + } + + @Test + public void testModelWithRenamedArrays() { + ModelWithRenamedArraysValueClient client = new XmlClientBuilder().buildModelWithRenamedArraysValueClient(); + + client.put(new ModelWithRenamedArrays(List.of("red", "green", "blue"), List.of(1, 2))); + + ModelWithRenamedArrays model = client.get(); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + Assertions.assertEquals(List.of(1, 2), model.getCounts()); + } + + @Test + public void testModelWithRenamedFields() { + ModelWithRenamedFieldsValueClient client = new XmlClientBuilder().buildModelWithRenamedFieldsValueClient(); + + client.put(new ModelWithRenamedFields(new SimpleModel("foo", 123), new SimpleModel("bar", 456))); + + ModelWithRenamedFields model = client.get(); + Assertions.assertEquals("foo", model.getInputData().getName()); + Assertions.assertEquals(123, model.getInputData().getAge()); + Assertions.assertEquals("bar", model.getOutputData().getName()); + Assertions.assertEquals(456, model.getOutputData().getAge()); + } + + @Test + public void testModelWithEmptyArray() { + ModelWithEmptyArrayValueClient client = new XmlClientBuilder().buildModelWithEmptyArrayValueClient(); + + client.put(new ModelWithEmptyArray(Collections.emptyList())); + + ModelWithEmptyArray model = client.get(); + Assertions.assertTrue(model.getItems() == null || model.getItems().isEmpty()); + } + + @Test + public void testModelWithText() { + ModelWithTextValueClient client = new XmlClientBuilder().buildModelWithTextValueClient(); + + client.put(new ModelWithText("foo", "\n This is some text.\n")); + + ModelWithText model = client.get(); + Assertions.assertEquals("foo", model.getLanguage()); + Assertions.assertEquals("\n This is some text.\n", model.getContent()); + } + + @Test + public void testModelWithDictionary() { + ModelWithDictionaryValueClient client = new XmlClientBuilder().buildModelWithDictionaryValueClient(); + + client.put(new ModelWithDictionary(Map.of("Color", "blue", "Count", "123", "Enabled", "false"))); + + ModelWithDictionary model = client.get(); + Assertions.assertEquals("blue", model.getMetadata().get("Color")); + Assertions.assertEquals("123", model.getMetadata().get("Count")); + Assertions.assertEquals("false", model.getMetadata().get("Enabled")); + } + + @Test + public void testModelWithEncodedNames() { + ModelWithEncodedNamesValueClient client = new XmlClientBuilder().buildModelWithEncodedNamesValueClient(); + + client.put(new ModelWithEncodedNames(new SimpleModel("foo", 123), List.of("red", "green", "blue"))); + + ModelWithEncodedNames model = client.get(); + Assertions.assertEquals("foo", model.getModelData().getName()); + Assertions.assertEquals(123, model.getModelData().getAge()); + Assertions.assertEquals(List.of("red", "green", "blue"), model.getColors()); + } + + @Test + public void testModelWithEnum() { + ModelWithEnumValueClient client = new XmlClientBuilder().buildModelWithEnumValueClient(); + + client.put(new ModelWithEnum(Status.SUCCESS)); + + ModelWithEnum model = client.get(); + Assertions.assertEquals(Status.SUCCESS, model.getStatus()); + } + + @Test + public void testModelWithDatetime() { + ModelWithDatetimeValueClient client = new XmlClientBuilder().buildModelWithDatetimeValueClient(); + + OffsetDateTime rfc3339 = OffsetDateTime.of(2022, 8, 26, 18, 38, 0, 0, ZoneOffset.UTC); + OffsetDateTime rfc7231 = OffsetDateTime.of(2022, 8, 26, 14, 38, 0, 0, ZoneOffset.UTC); + + client.put(new ModelWithDatetime(rfc3339, rfc7231)); + + ModelWithDatetime model = client.get(); + Assertions.assertEquals(rfc3339, model.getRfc3339()); + Assertions.assertEquals(rfc7231, model.getRfc7231()); + } + + @Test + public void testXmlErrorValue() { + XmlErrorValueClient client = new XmlClientBuilder().buildXmlErrorValueClient(); + + HttpResponseException exception = Assertions.assertThrows(HttpResponseException.class, client::get); + Assertions.assertEquals(400, exception.getResponse().getStatusCode()); + } + + @Test + public void testModelWithRenamedProperty() { + ModelWithRenamedPropertyValueClient client = new XmlClientBuilder().buildModelWithRenamedPropertyValueClient(); + + client.put(new ModelWithRenamedProperty("foo", "bar")); + + ModelWithRenamedProperty model = client.get(); + Assertions.assertEquals("foo", model.getTitle()); + Assertions.assertEquals("bar", model.getAuthor()); + } + + @Test + public void testModelWithNestedModel() { + ModelWithNestedModelValueClient client = new XmlClientBuilder().buildModelWithNestedModelValueClient(); + + client.put(new ModelWithNestedModel(new SimpleModel("foo", 123))); + + ModelWithNestedModel model = client.get(); + Assertions.assertEquals("foo", model.getNested().getName()); + Assertions.assertEquals(123, model.getNested().getAge()); + } + + @Test + public void testModelWithRenamedNestedModel() { + ModelWithRenamedNestedModelValueClient client + = new XmlClientBuilder().buildModelWithRenamedNestedModelValueClient(); + + client.put(new ModelWithRenamedNestedModel(new Author("foo"))); + + ModelWithRenamedNestedModel model = client.get(); + Assertions.assertEquals("foo", model.getAuthor().getName()); + } + + @Test + public void testModelWithWrappedPrimitiveCustomItemNames() { + ModelWithWrappedPrimitiveCustomItemNamesValueClient client + = new XmlClientBuilder().buildModelWithWrappedPrimitiveCustomItemNamesValueClient(); + + client.put(new ModelWithWrappedPrimitiveCustomItemNames(List.of("fiction", "classic"))); + + ModelWithWrappedPrimitiveCustomItemNames model = client.get(); + Assertions.assertEquals(List.of("fiction", "classic"), model.getTags()); + } + + @Test + public void testModelWithUnwrappedModelArray() { + ModelWithUnwrappedModelArrayValueClient client + = new XmlClientBuilder().buildModelWithUnwrappedModelArrayValueClient(); + + client.put(new ModelWithUnwrappedModelArray(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithUnwrappedModelArray model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithRenamedWrappedModelArray() { + ModelWithRenamedWrappedModelArrayValueClient client + = new XmlClientBuilder().buildModelWithRenamedWrappedModelArrayValueClient(); + + client.put( + new ModelWithRenamedWrappedModelArray(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithRenamedWrappedModelArray model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithRenamedUnwrappedModelArray() { + ModelWithRenamedUnwrappedModelArrayValueClient client + = new XmlClientBuilder().buildModelWithRenamedUnwrappedModelArrayValueClient(); + + client.put( + new ModelWithRenamedUnwrappedModelArray(List.of(new SimpleModel("foo", 123), new SimpleModel("bar", 456)))); + + ModelWithRenamedUnwrappedModelArray model = client.get(); + Assertions.assertEquals(2, model.getItems().size()); + Assertions.assertEquals("foo", model.getItems().get(0).getName()); + Assertions.assertEquals(123, model.getItems().get(0).getAge()); + Assertions.assertEquals("bar", model.getItems().get(1).getName()); + Assertions.assertEquals(456, model.getItems().get(1).getAge()); + } + + @Test + public void testModelWithRenamedWrappedAndItemModelArray() { + ModelWithRenamedWrappedAndItemModelArrayValueClient client + = new XmlClientBuilder().buildModelWithRenamedWrappedAndItemModelArrayValueClient(); + + client.put(new ModelWithRenamedWrappedAndItemModelArray( + List.of(new Book("The Great Gatsby"), new Book("Les Miserables")))); + + ModelWithRenamedWrappedAndItemModelArray model = client.get(); + Assertions.assertEquals(2, model.getBooks().size()); + Assertions.assertEquals("The Great Gatsby", model.getBooks().get(0).getTitle()); + Assertions.assertEquals("Les Miserables", model.getBooks().get(1).getTitle()); + } + + @Test + public void testModelWithRenamedAttribute() { + ModelWithRenamedAttributeValueClient client + = new XmlClientBuilder().buildModelWithRenamedAttributeValueClient(); + + client.put(new ModelWithRenamedAttribute(123, "The Great Gatsby", "F. Scott Fitzgerald")); + + ModelWithRenamedAttribute model = client.get(); + Assertions.assertEquals(123, model.getId()); + Assertions.assertEquals("The Great Gatsby", model.getTitle()); + Assertions.assertEquals("F. Scott Fitzgerald", model.getAuthor()); + } + + @Disabled("namespace mismatch") + @Test + public void testModelWithNamespace() { + ModelWithNamespaceValueClient client = new XmlClientBuilder().buildModelWithNamespaceValueClient(); + + client.put(new ModelWithNamespace(123, "The Great Gatsby")); + + ModelWithNamespace model = client.get(); + Assertions.assertEquals(123, model.getId()); + Assertions.assertEquals("The Great Gatsby", model.getTitle()); + } + + @Disabled("namespace mismatch") + @Test + public void testModelWithNamespaceOnProperties() { + ModelWithNamespaceOnPropertiesValueClient client + = new XmlClientBuilder().buildModelWithNamespaceOnPropertiesValueClient(); + + client.put(new ModelWithNamespaceOnProperties(123, "The Great Gatsby", "F. Scott Fitzgerald")); + + ModelWithNamespaceOnProperties model = client.get(); + Assertions.assertEquals(123, model.getId()); + Assertions.assertEquals("The Great Gatsby", model.getTitle()); + Assertions.assertEquals("F. Scott Fitzgerald", model.getAuthor()); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java new file mode 100644 index 00000000000..573d808ba9b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/xml/generated/XmlClientTestBase.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.xml.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 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.xml.ModelWithArrayOfModelValueClient; +import payload.xml.ModelWithAttributesValueClient; +import payload.xml.ModelWithDatetimeValueClient; +import payload.xml.ModelWithDictionaryValueClient; +import payload.xml.ModelWithEmptyArrayValueClient; +import payload.xml.ModelWithEncodedNamesValueClient; +import payload.xml.ModelWithEnumValueClient; +import payload.xml.ModelWithNamespaceOnPropertiesValueClient; +import payload.xml.ModelWithNamespaceValueClient; +import payload.xml.ModelWithNestedModelValueClient; +import payload.xml.ModelWithOptionalFieldValueClient; +import payload.xml.ModelWithRenamedArraysValueClient; +import payload.xml.ModelWithRenamedAttributeValueClient; +import payload.xml.ModelWithRenamedFieldsValueClient; +import payload.xml.ModelWithRenamedNestedModelValueClient; +import payload.xml.ModelWithRenamedPropertyValueClient; +import payload.xml.ModelWithRenamedUnwrappedModelArrayValueClient; +import payload.xml.ModelWithRenamedWrappedAndItemModelArrayValueClient; +import payload.xml.ModelWithRenamedWrappedModelArrayValueClient; +import payload.xml.ModelWithSimpleArraysValueClient; +import payload.xml.ModelWithTextValueClient; +import payload.xml.ModelWithUnwrappedArrayValueClient; +import payload.xml.ModelWithUnwrappedModelArrayValueClient; +import payload.xml.ModelWithWrappedPrimitiveCustomItemNamesValueClient; +import payload.xml.SimpleModelValueClient; +import payload.xml.XmlClientBuilder; +import payload.xml.XmlErrorValueClient; + +class XmlClientTestBase extends TestProxyTestBase { + protected SimpleModelValueClient simpleModelValueClient; + + protected ModelWithRenamedPropertyValueClient modelWithRenamedPropertyValueClient; + + protected ModelWithRenamedFieldsValueClient modelWithRenamedFieldsValueClient; + + protected ModelWithNestedModelValueClient modelWithNestedModelValueClient; + + protected ModelWithRenamedNestedModelValueClient modelWithRenamedNestedModelValueClient; + + protected ModelWithSimpleArraysValueClient modelWithSimpleArraysValueClient; + + protected ModelWithUnwrappedArrayValueClient modelWithUnwrappedArrayValueClient; + + protected ModelWithRenamedArraysValueClient modelWithRenamedArraysValueClient; + + protected ModelWithWrappedPrimitiveCustomItemNamesValueClient modelWithWrappedPrimitiveCustomItemNamesValueClient; + + protected ModelWithArrayOfModelValueClient modelWithArrayOfModelValueClient; + + protected ModelWithUnwrappedModelArrayValueClient modelWithUnwrappedModelArrayValueClient; + + protected ModelWithRenamedWrappedModelArrayValueClient modelWithRenamedWrappedModelArrayValueClient; + + protected ModelWithRenamedUnwrappedModelArrayValueClient modelWithRenamedUnwrappedModelArrayValueClient; + + protected ModelWithRenamedWrappedAndItemModelArrayValueClient modelWithRenamedWrappedAndItemModelArrayValueClient; + + protected ModelWithAttributesValueClient modelWithAttributesValueClient; + + protected ModelWithRenamedAttributeValueClient modelWithRenamedAttributeValueClient; + + protected ModelWithNamespaceValueClient modelWithNamespaceValueClient; + + protected ModelWithNamespaceOnPropertiesValueClient modelWithNamespaceOnPropertiesValueClient; + + protected ModelWithTextValueClient modelWithTextValueClient; + + protected ModelWithOptionalFieldValueClient modelWithOptionalFieldValueClient; + + protected ModelWithEmptyArrayValueClient modelWithEmptyArrayValueClient; + + protected ModelWithDictionaryValueClient modelWithDictionaryValueClient; + + protected ModelWithEncodedNamesValueClient modelWithEncodedNamesValueClient; + + protected ModelWithEnumValueClient modelWithEnumValueClient; + + protected ModelWithDatetimeValueClient modelWithDatetimeValueClient; + + protected XmlErrorValueClient xmlErrorValueClient; + + @Override + protected void beforeTest() { + XmlClientBuilder simpleModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + simpleModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + simpleModelValueClient = simpleModelValueClientbuilder.buildSimpleModelValueClient(); + + XmlClientBuilder modelWithRenamedPropertyValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedPropertyValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedPropertyValueClient + = modelWithRenamedPropertyValueClientbuilder.buildModelWithRenamedPropertyValueClient(); + + XmlClientBuilder modelWithRenamedFieldsValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedFieldsValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedFieldsValueClient + = modelWithRenamedFieldsValueClientbuilder.buildModelWithRenamedFieldsValueClient(); + + XmlClientBuilder modelWithNestedModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithNestedModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithNestedModelValueClient = modelWithNestedModelValueClientbuilder.buildModelWithNestedModelValueClient(); + + XmlClientBuilder modelWithRenamedNestedModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedNestedModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedNestedModelValueClient + = modelWithRenamedNestedModelValueClientbuilder.buildModelWithRenamedNestedModelValueClient(); + + XmlClientBuilder modelWithSimpleArraysValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithSimpleArraysValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithSimpleArraysValueClient + = modelWithSimpleArraysValueClientbuilder.buildModelWithSimpleArraysValueClient(); + + XmlClientBuilder modelWithUnwrappedArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithUnwrappedArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithUnwrappedArrayValueClient + = modelWithUnwrappedArrayValueClientbuilder.buildModelWithUnwrappedArrayValueClient(); + + XmlClientBuilder modelWithRenamedArraysValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedArraysValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedArraysValueClient + = modelWithRenamedArraysValueClientbuilder.buildModelWithRenamedArraysValueClient(); + + XmlClientBuilder modelWithWrappedPrimitiveCustomItemNamesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithWrappedPrimitiveCustomItemNamesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithWrappedPrimitiveCustomItemNamesValueClient = modelWithWrappedPrimitiveCustomItemNamesValueClientbuilder + .buildModelWithWrappedPrimitiveCustomItemNamesValueClient(); + + XmlClientBuilder modelWithArrayOfModelValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithArrayOfModelValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithArrayOfModelValueClient + = modelWithArrayOfModelValueClientbuilder.buildModelWithArrayOfModelValueClient(); + + XmlClientBuilder modelWithUnwrappedModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithUnwrappedModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithUnwrappedModelArrayValueClient + = modelWithUnwrappedModelArrayValueClientbuilder.buildModelWithUnwrappedModelArrayValueClient(); + + XmlClientBuilder modelWithRenamedWrappedModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedWrappedModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedWrappedModelArrayValueClient + = modelWithRenamedWrappedModelArrayValueClientbuilder.buildModelWithRenamedWrappedModelArrayValueClient(); + + XmlClientBuilder modelWithRenamedUnwrappedModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedUnwrappedModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedUnwrappedModelArrayValueClient = modelWithRenamedUnwrappedModelArrayValueClientbuilder + .buildModelWithRenamedUnwrappedModelArrayValueClient(); + + XmlClientBuilder modelWithRenamedWrappedAndItemModelArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedWrappedAndItemModelArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedWrappedAndItemModelArrayValueClient = modelWithRenamedWrappedAndItemModelArrayValueClientbuilder + .buildModelWithRenamedWrappedAndItemModelArrayValueClient(); + + XmlClientBuilder modelWithAttributesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithAttributesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithAttributesValueClient = modelWithAttributesValueClientbuilder.buildModelWithAttributesValueClient(); + + XmlClientBuilder modelWithRenamedAttributeValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithRenamedAttributeValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithRenamedAttributeValueClient + = modelWithRenamedAttributeValueClientbuilder.buildModelWithRenamedAttributeValueClient(); + + XmlClientBuilder modelWithNamespaceValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithNamespaceValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithNamespaceValueClient = modelWithNamespaceValueClientbuilder.buildModelWithNamespaceValueClient(); + + XmlClientBuilder modelWithNamespaceOnPropertiesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithNamespaceOnPropertiesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithNamespaceOnPropertiesValueClient + = modelWithNamespaceOnPropertiesValueClientbuilder.buildModelWithNamespaceOnPropertiesValueClient(); + + XmlClientBuilder modelWithTextValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithTextValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithTextValueClient = modelWithTextValueClientbuilder.buildModelWithTextValueClient(); + + XmlClientBuilder modelWithOptionalFieldValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithOptionalFieldValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithOptionalFieldValueClient + = modelWithOptionalFieldValueClientbuilder.buildModelWithOptionalFieldValueClient(); + + XmlClientBuilder modelWithEmptyArrayValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithEmptyArrayValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithEmptyArrayValueClient = modelWithEmptyArrayValueClientbuilder.buildModelWithEmptyArrayValueClient(); + + XmlClientBuilder modelWithDictionaryValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithDictionaryValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithDictionaryValueClient = modelWithDictionaryValueClientbuilder.buildModelWithDictionaryValueClient(); + + XmlClientBuilder modelWithEncodedNamesValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithEncodedNamesValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithEncodedNamesValueClient + = modelWithEncodedNamesValueClientbuilder.buildModelWithEncodedNamesValueClient(); + + XmlClientBuilder modelWithEnumValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithEnumValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithEnumValueClient = modelWithEnumValueClientbuilder.buildModelWithEnumValueClient(); + + XmlClientBuilder modelWithDatetimeValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + modelWithDatetimeValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + modelWithDatetimeValueClient = modelWithDatetimeValueClientbuilder.buildModelWithDatetimeValueClient(); + + XmlClientBuilder xmlErrorValueClientbuilder = new XmlClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.RECORD) { + xmlErrorValueClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + xmlErrorValueClient = xmlErrorValueClientbuilder.buildXmlErrorValueClient(); + + } +} 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 218d6f8853b..93728dc59be 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 @@ -129,6 +129,16 @@ protected void writeHelperClasses(Client client, CodeModel codeModel, JavaPackag } } + // XmlSerializer + final boolean generateXmlSerializer = JavaSettings.getInstance().isAzureV1() + && client.getModels().stream().filter(ModelUtil::isGeneratingModel).anyMatch(ClientModel::isUsedInXml); + if (generateXmlSerializer) { + javaPackage.addJavaFromResources(settings.getPackage(settings.getImplementationSubpackage()), + ClientModelUtil.XML_SERIALIZER_CLASS_NAME); + javaPackage.addJavaFromResources(settings.getPackage(settings.getImplementationSubpackage()), + ClientModelUtil.XML_SERIALIZER_PROVIDERS_CLASS_NAME); + } + // OperationLocationPollingStrategy if (ClientModelUtil.requireOperationLocationPollingStrategy(codeModel)) { if (JavaSettings.getInstance().isAzureV2()) { From 79713cc22b8a9b6d191104242b72453808301b2b Mon Sep 17 00:00:00 2001 From: jenny <63012604+JennyPng@users.noreply.github.com> Date: Tue, 21 Jul 2026 01:05:31 -0700 Subject: [PATCH 038/249] fix(python): Fix duplicate model docstrings on regeneration (#11289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up fix to #11197 (pylint-guidelines-checker `0.5.9` bump). On regeneration, DPG models emitted a **duplicate docstring**: `:keyword:`/`:paramtype:` lines in the class docstring duplicated the existing `:ivar:`/`:vartype:` entries (e.g. `InvalidAuth`). ## Changes - Remove the redundant keyword-doc generation for DPG models (the source of the duplicated lines). - For DPG models, suppress `docstring-keyword-should-match-keyword-only` at the class line instead — DPG `__init__` overloads have empty bodies, so the checker validates keyword-only args against the *class* docstring, and we intentionally document those args once as `:ivar:` entries. ## Validation - locally ran `npm run regenerate` and full regeneration (azure + unbranded) succeeds; docstrings no longer duplicated. ## todo - [ ] disable `no-cross-package-private-import` in pylintrc of `typespec-azure` --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Yuchao Yan --- ...cstring-duplicate-fix-2026-7-16-22-38-0.md | 8 ++++++++ .../codegen/serializers/model_serializer.py | 19 ++++++++++--------- .../codegen/templates/model_dpg.py.jinja2 | 5 ----- 3 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 .chronus/changes/python-docstring-duplicate-fix-2026-7-16-22-38-0.md diff --git a/.chronus/changes/python-docstring-duplicate-fix-2026-7-16-22-38-0.md b/.chronus/changes/python-docstring-duplicate-fix-2026-7-16-22-38-0.md new file mode 100644 index 00000000000..b25638ff083 --- /dev/null +++ b/.chronus/changes/python-docstring-duplicate-fix-2026-7-16-22-38-0.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@typespec/http-client-python" +--- + +[Python] Fix duplicate `:keyword:`/`:paramtype:` lines in generated DPG model docstrings that duplicated the existing `:ivar:`/`:vartype:` entries diff --git a/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py b/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py index 15e82108a89..be35a23b89e 100644 --- a/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py +++ b/packages/http-client-python/generator/pygen/codegen/serializers/model_serializer.py @@ -122,15 +122,6 @@ def input_documentation_string(prop: Property) -> list[str]: # building the param line of the property doc return _documentation_string(prop, "keyword", "paramtype") - def keyword_documentation_string(self, model: ModelType) -> list[str]: - # building the ``:keyword:``/``:paramtype:`` lines for the keyword-only - # arguments of the generated ``__init__`` overload so that the docstring - # keeps a 1:1 correlation with the keyword-only arguments in the signature. - retval: list[str] = [] - for prop in sorted(self._init_line_parameters(model), key=lambda x: x.optional): - retval.extend(self.input_documentation_string(prop)) - return retval - @staticmethod def variable_documentation_string(prop: Property) -> list[str]: return _documentation_string(prop, "ivar", "vartype") @@ -428,6 +419,16 @@ def declare_model(self, model: ModelType) -> str: basename += f", discriminator='{model.discriminator_value}'" return f"class {model.name}({basename}):{self.class_pylint_disable(model)}" + def class_pylint_disable(self, model: ModelType) -> str: + retval = super().class_pylint_disable(model) + # DPG models render an empty ``@overload def __init__(self, *, ...)`` body, so the + # guideline checker validates the keyword-only arguments against the *class* docstring. + # We only document those arguments as instance variables (``:ivar:``) to avoid a redundant + # ``:keyword:`` entry per property, so silence the keyword/keyword-only correlation check. + if self._init_line_parameters(model): + retval = add_to_pylint_disable(retval, "docstring-keyword-should-match-keyword-only") + return retval + @staticmethod def get_properties_to_declare(model: ModelType) -> list[Property]: if model.parents: diff --git a/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 b/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 index 6a2b533ae55..8bcbbf4af41 100644 --- a/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 +++ b/packages/http-client-python/generator/pygen/codegen/templates/model_dpg.py.jinja2 @@ -16,11 +16,6 @@ {% endfor %} {% endfor %} {% endif %} - {% if serializer.need_init(model) %} - {% for line in serializer.keyword_documentation_string(model) %} - {{ macros.wrap_model_string(line, '\n ') -}} - {% endfor %} - {% endif %} """ {% if model.is_polymorphic %} From 3a8d49e65401c963a621beba58186cbead6d1756 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Tue, 21 Jul 2026 19:36:20 +0800 Subject: [PATCH 039/249] chore: stop tracking generated rule and diagnostic reference pages (#11326) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem Since tspd generates one reference page per linter rule and diagnostic from each definition's `docs` field, the generated pages checked into the website content duplicate their source markdown: - `website/.../libraries/http/rules/op-reference-container-route.md` ↔ `packages/http/src/rules/op-reference-container-route.md` - `website/.../emitters/openapi3/reference/diagnostics/*.md` (6 files) ↔ `packages/openapi3/src/diagnostics/*.md` Keeping both copies in git means every content edit has to be made (or regenerated) in two places. ## Fix Follow the same approach as [Azure/typespec-azure#4968](https://github.com/Azure/typespec-azure/pull/4968) and the repo's existing `js-api` precedent (`**/docs/**/js-api/` is already gitignored): stop tracking the generated pages and regenerate them during the website build. - `.gitignore` — ignore the generated pages: - `website/src/content/docs/docs/**/rules/` - `website/src/content/docs/docs/**/reference/diagnostics/` - Untrack the 7 generated pages (their source markdown under `packages/*/src/**` remains the single tracked copy). The website build regenerates them: `website` build runs `build:web`, which runs `regen-all-packages-docs` before `astro check`/`astro build`. ## Validation - Deleted the generated pages from disk, ran `regen-docs` for http + openapi3, and confirmed all 7 pages are reproduced at the same paths — and git now treats them as ignored (no longer tracked, not shown as untracked). - `@typespec/http` (rules) and `@typespec/openapi3` (diagnostics) are the only libraries in this repo that use the `docs` field, so the globs only match generated content. - `chronus verify` passes (no shipped package changes). Co-authored-by: tadelesh Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitignore | 7 +++ .../reference/diagnostics/duplicate-header.md | 32 ------------- .../reference/diagnostics/inline-cycle.md | 29 ----------- .../reference/diagnostics/invalid-schema.md | 30 ------------ .../diagnostics/invalid-server-variable.md | 24 ---------- .../reference/diagnostics/path-query.md | 36 -------------- .../reference/diagnostics/union-null.md | 13 ----- .../rules/op-reference-container-route.md | 48 ------------------- 8 files changed, 7 insertions(+), 212 deletions(-) delete mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md delete mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md delete mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md delete mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md delete mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md delete mode 100644 website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md delete mode 100644 website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md diff --git a/.gitignore b/.gitignore index b2d237a3bf9..692c2245fd6 100644 --- a/.gitignore +++ b/.gitignore @@ -211,6 +211,13 @@ vite.config.ts.timestamp-* packages/*/etc/ **/docs/**/js-api/ +# Generated linter rule and diagnostic reference pages (produced by `tspd doc` / +# regen-docs from each rule/diagnostic's `docs` field). Regenerated during the +# website build (build:web), so they are not tracked. The source docs live in +# packages/*/src/rules/*.md and packages/*/src/diagnostics/*.md. +website/src/content/docs/docs/**/rules/ +website/src/content/docs/docs/**/reference/diagnostics/ + # VS Code test web temp files .vscode-test-web/ diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md deleted file mode 100644 index 935f3dda65c..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/duplicate-header.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "duplicate-header" ---- - -```text title="Id" -@typespec/openapi3/duplicate-header -``` - -**Severity:** error - -This diagnostic is issued when a response header is defined more than once for a response of a specific status code. - -To fix this issue, ensure that each response header is defined only once for each status code. - -### Example - -```yaml -responses: - "200": - description: Successful response - headers: - X-Rate-Limit: - description: The number of allowed requests in the current period - schema: - type: integer - X-Rate-Limit: - description: The number of allowed requests in the current period - schema: - type: integer -``` - -In this example, the `X-Rate-Limit` header is defined twice for the `200` status code. To fix this issue, remove the duplicate header definition. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md deleted file mode 100644 index 62e392e1c08..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/inline-cycle.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "inline-cycle" ---- - -```text title="Id" -@typespec/openapi3/inline-cycle -``` - -**Severity:** error - -This diagnostic is issued when a cyclic reference is detected within inline schemas. - -To fix this issue, refactor the schemas to remove the cyclic reference. - -### Example - -```yaml -components: - schemas: - Node: - type: object - properties: - value: - type: string - next: - $ref: "#/components/schemas/Node" -``` - -In this example, the `Node` schema references itself, creating a cyclic reference. To fix this issue, refactor the schema to remove the cyclic reference. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md deleted file mode 100644 index ad052ec03b8..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-schema.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "invalid-schema" ---- - -```text title="Id" -@typespec/openapi3/invalid-schema -``` - -**Severity:** error - -This diagnostic is issued when a schema is invalid according to the OpenAPI v3 specification. - -To fix this issue, review your TypeSpec definitions to ensure they map to valid OpenAPI schemas. - -### Example - -```yaml -components: - schemas: - User: - type: object - properties: - id: - type: string - age: - type: integer - format: "int" # Invalid format -``` - -In this example, the `format` value for the `age` property is invalid. To fix this issue, provide a valid format value such as `int32` or `int64`. diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md deleted file mode 100644 index 26c49e3aee1..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/invalid-server-variable.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "invalid-server-variable" ---- - -```text title="Id" -@typespec/openapi3/invalid-server-variable -``` - -**Severity:** error - -This diagnostic is issued when a variable in the `@server` decorator is not defined as a string type. -Since server variables are substituted into the server URL which is a string, all variables must have string values. - -To fix this issue, make sure all server variables are of a type that is assignable to `string`. - -### Example - -```typespec -@server("{protocol}://{host}/api/{version}", "Custom endpoint", { - protocol: "http" | "https", - host: string, - version: 1, // Should be a string: "1" -}) -``` diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md deleted file mode 100644 index 22a9107204f..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/path-query.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "path-query" ---- - -```text title="Id" -@typespec/openapi3/path-query -``` - -**Severity:** error - -This diagnostic is issued when the OpenAPI emitter finds an `@route` decorator that specifies a path that contains a query parameter. This is not permitted by the OpenAPI v3 specification, which requires query parameters to be defined separately. - -To fix this issue, redesign the API to only use paths without query parameters, and define query parameters using the `@query` decorator. - -### Example - -Instead of: - -```typespec -@route("/users?filter={filter}") -op getUsers(filter: string): User[]; -``` - -Use: - -```typespec -@route("/users") -op getUsers(@query filter?: string): User[]; -``` - -Alternatively, you can leverage TypeSpec's support for URI templates: - -```typespec -@route("/users{?filter}") -op getUsers(filter?: string): User[]; -``` diff --git a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md b/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md deleted file mode 100644 index 4d1113c7785..00000000000 --- a/website/src/content/docs/docs/emitters/openapi3/reference/diagnostics/union-null.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "union-null" ---- - -```text title="Id" -@typespec/openapi3/union-null -``` - -**Severity:** error - -This diagnostic is issued when the result of model composition is effectively a `null` schema which cannot be represented in OpenAPI. - -To fix this issue, review your model compositions to ensure they produce valid schemas with actual properties or types. diff --git a/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md b/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md deleted file mode 100644 index 2a746e9f825..00000000000 --- a/website/src/content/docs/docs/libraries/http/rules/op-reference-container-route.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: "op-reference-container-route" ---- - -```text title="Id" -@typespec/http/op-reference-container-route -``` - -Check for referenced (`op is`) operations which have a @route on one of their containers. - -When referencing an operation with `op is`, only the data on the operation itself is carried over; anything on the parent container is lost. -This results in unexpected behavior where information is lost. -As a best practice the route should be provided on the operation itself. - -#### ❌ Incorrect - -```tsp -namespace Library { - @route("/pets") - interface Pets { - @route("/read") read(): string; - } -} - -@service -namespace Service { - interface PetStore { - readPet is Library.Pets.read; - } -} -``` - -#### ✅ Correct - -```tsp -namespace Library { - interface Pets { - @route("/pets/read") read(): string; - } -} - -@service -namespace Service { - interface PetStore { - readPet is Library.Pets.read; - } -} -``` From ceac062057fbc07d22555e1042a33341a20d220b Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 21 Jul 2026 08:41:41 -0400 Subject: [PATCH 040/249] Fix lockfile containing bad feed url and add check to make sure never merged by mistake that way (#11321) ## Summary - Reverted `pnpm-lock.yaml` to remove registry-proxy-injected `tarball:` URLs (load-balanced `ms-feed-N.pkgs.visualstudio.com` hosts) that are environment-specific and break CI. The lockfile is now integrity-only again. - Added a `check-lockfile` script (`eng/common/scripts/check-lockfile.ts`) that fails if any `tarball:` URL is present in `pnpm-lock.yaml`. - Wired it into the `version-consistency` job in `consistency.yml`. ## Why not a pnpm setting? pnpm's `lockfile-include-tarball-url=false` is already the default and is [known to be flaky](https://github.com/pnpm/pnpm/issues/6667) when the registry host differs from the tarball host, so it does not reliably prevent this. A lightweight CI guard is the robust option. ## Validation - `pnpm run check-lockfile` passes on the cleaned lockfile. - Verified it exits non-zero when a `tarball:` URL is injected. - `tsc -p ./tsconfig.eng.json --noEmit` passes. --- .github/workflows/consistency.yml | 3 + eng/common/scripts/check-lockfile.ts | 41 ++ package.json | 1 + pnpm-lock.yaml | 846 +++++++++++++-------------- 4 files changed, 468 insertions(+), 423 deletions(-) create mode 100644 eng/common/scripts/check-lockfile.ts diff --git a/.github/workflows/consistency.yml b/.github/workflows/consistency.yml index e83a123e568..80cc88e26dd 100644 --- a/.github/workflows/consistency.yml +++ b/.github/workflows/consistency.yml @@ -137,3 +137,6 @@ jobs: - run: pnpm run check-catalog name: Check catalog usage + + - run: pnpm run check-lockfile + name: Check lockfile has no tarball URLs diff --git a/eng/common/scripts/check-lockfile.ts b/eng/common/scripts/check-lockfile.ts new file mode 100644 index 00000000000..1e343368c83 --- /dev/null +++ b/eng/common/scripts/check-lockfile.ts @@ -0,0 +1,41 @@ +import { readFileSync } from "fs"; +import { join } from "path"; +import { repoRoot } from "./utils/common.js"; + +/** + * Validates that `pnpm-lock.yaml` does not contain explicit `tarball:` URLs in its + * resolution entries. Some registry proxies (e.g. packagefeedproxy.microsoft.io) inject + * load-balanced tarball URLs (ms-feed-N.pkgs.visualstudio.com) into the lockfile which are + * environment-specific and break CI. The lockfile should stay integrity-only. + */ + +const lockfilePath = join(repoRoot, "pnpm-lock.yaml"); +const content = readFileSync(lockfilePath, "utf8"); + +const offenders: string[] = []; +const lines = content.split(/\r?\n/); +for (let i = 0; i < lines.length; i++) { + if (lines[i].includes("tarball:")) { + offenders.push(` pnpm-lock.yaml:${i + 1}: ${lines[i].trim()}`); + } +} + +if (offenders.length > 0) { + console.log(`\n✘ Found ${offenders.length} tarball URL(s) in pnpm-lock.yaml:`); + const preview = offenders.slice(0, 20); + for (const o of preview) { + console.log(o); + } + if (offenders.length > preview.length) { + console.log(` ...and ${offenders.length - preview.length} more.`); + } + console.log( + "\nThe lockfile must stay integrity-only (no explicit `tarball:` URLs). These are usually" + + "\ninjected by a registry proxy and are not portable across environments. Regenerate the" + + "\nlockfile against the pinned registry, or strip the `, tarball: ...` suffix from each" + + "\n`resolution:` entry.", + ); + process.exit(1); +} + +console.log("✔ pnpm-lock.yaml is integrity-only (no tarball URLs)."); diff --git a/package.json b/package.json index ac253cc5d7e..31799214e5b 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "check:eng": "tsc -p ./tsconfig.eng.json --noEmit", "setup:min": "pnpm install && pnpm --filter \"@typespec/prettier-plugin-typespec...\" --filter \"@typespec/tspd...\" run build", "check-catalog": "tsx eng/common/scripts/check-catalog.ts", + "check-lockfile": "tsx eng/common/scripts/check-lockfile.ts", "change": "chronus", "clean": "turbo clean", "cspell": "cspell --no-progress .", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d82a0b1461..3ee96b5fb04 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3061,49 +3061,49 @@ packages: resolution: {integrity: sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==} '@algolia/cache-browser-local-storage@4.27.0': - resolution: {integrity: sha1-/tBTiYL9IYWPRS8Xan8WeL3JHFU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.27.0.tgz} + resolution: {integrity: sha512-YGog2s57sO20lvpa+hv5XLAAmiTI1kHsCMRtPVfiaOdIQnvRla21lfH08onqEbZihOPVI8GULwt79zQB2ymKzg==} '@algolia/cache-common@4.27.0': - resolution: {integrity: sha1-+knhvihBgtxxJER76gFXeB/wN2M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/cache-common/-/cache-common-4.27.0.tgz} + resolution: {integrity: sha512-Sr8zjNXj82p6lO4W9CdzfF0m0/9h/H6VAdSHOTtimm/cTzXIYXRI2IZq7+Nt2ljJ7Ukx+7dIFcxQjE57eQSPsw==} '@algolia/cache-in-memory@4.27.0': - resolution: {integrity: sha1-DwAaYgitaNvC+7+vbKaTZ7f4Gzw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/cache-in-memory/-/cache-in-memory-4.27.0.tgz} + resolution: {integrity: sha512-abgMRTcVD0IllNvMM9JFhxtyLn1v6Ey7mQ7+BGS3JCzvkCX7KZqlS0BIuVUDgx9sPIfOeNsG/awGzMmP50TwZw==} '@algolia/client-account@4.27.0': - resolution: {integrity: sha1-0Mji39IoBsUjjv6NAUMeS1k+1Uk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-account/-/client-account-4.27.0.tgz} + resolution: {integrity: sha512-sSHxwrKTKJrwfoR/LcQJZfmiWJcM5d9Rp7afMChxOcdGdkSdIwrNBC8SCcHRenA3GsZ6mg+j6px7KWYxJ34btA==} '@algolia/client-analytics@4.27.0': - resolution: {integrity: sha1-3HgsCNEhzXxxvF+lFD1qvhTHPjY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-analytics/-/client-analytics-4.27.0.tgz} + resolution: {integrity: sha512-MqIDyxODljn9ZC4oqjQD0kez2a4zjIJ9ywA/b7cIiUiK/tDjZNTVjYd9WXMKQlXnWUwfrfXJZClVVqN1iCXS+Q==} '@algolia/client-common@4.27.0': - resolution: {integrity: sha1-b9b2HZfVII2jw4rr6MVPsFKQLZU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-common/-/client-common-4.27.0.tgz} + resolution: {integrity: sha512-ZrT6l/YPQgyIUuBCxcYPeXol2VBLUMuNb1rKXrm6z1f/iTiwqtnEEb16/6CC11+Re0ZGXrdcMVrgDRrzveQ1aQ==} '@algolia/client-personalization@4.27.0': - resolution: {integrity: sha1-3ZWXyLr/gVx2Z3BquzM7qNU7XQk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-personalization/-/client-personalization-4.27.0.tgz} + resolution: {integrity: sha512-OZqaFFVm+10hAlmxpiTWi/o2n+YKBESbSqSy2yXAumPH/kaK4moJHFblbh8IkV3KZR0lLm4hzPtn8Q2nWNiDUA==} '@algolia/client-search@4.27.0': - resolution: {integrity: sha1-kKWEYURjagofrOpYE/3isgYGdzk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/client-search/-/client-search-4.27.0.tgz} + resolution: {integrity: sha512-qmX/f67ay0eZ4V5Io8fWWOcUVo/gqre2yei1PnmEhQU2Gul6ushg25QnNrfu4BODiRrw1rwYveZaLCiHvcUxrQ==} '@algolia/logger-common@4.27.0': - resolution: {integrity: sha1-rxEAS66kRp8gKFlCV+Xf7IxtP2g=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/logger-common/-/logger-common-4.27.0.tgz} + resolution: {integrity: sha512-pIrmQRXtDV+zTMVXKtKCosC2rWhn0F0TdUeb9etA6RiAz6jY6bY6f0+JX7YekDK09SnmZMLIyUa7Jci+Ied9bw==} '@algolia/logger-console@4.27.0': - resolution: {integrity: sha1-qCCJtRKQu7T+EfiZyuFIfJrL7HI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/logger-console/-/logger-console-4.27.0.tgz} + resolution: {integrity: sha512-UWvta8BxsR/u5z9eI088mOSLQaGtmoCtXeN3DYJurlxAdJwPuKtEb5+433kxA6/E9f2/JgoW89KZ1vNP9pcHBQ==} '@algolia/recommend@4.27.0': - resolution: {integrity: sha1-FZ8jDJoSPleBSZy6i30FwjW/yl4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/recommend/-/recommend-4.27.0.tgz} + resolution: {integrity: sha512-CFy54xDjrsazPi3KN04yPmLRDT72AKokc3RLOdWQvG0/uEUjj7dhWqe9qenxpL4ydsjO7S1eY5YqmX+uMGonlg==} '@algolia/requester-browser-xhr@4.27.0': - resolution: {integrity: sha1-urmBu0bd7SiX5K0yfiIufsg23yg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.27.0.tgz} + resolution: {integrity: sha512-dTenMBIIpyp5o3C2ZnfbsuSlD/lL9jPkk6T+2+qm38fyw2nf49ANbcHFE79NgiGrnmw7QrYveCs9NIP3Wk4v6g==} '@algolia/requester-common@4.27.0': - resolution: {integrity: sha1-BYbE32Yvnc5xKl6Z22GTK4IyhwA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/requester-common/-/requester-common-4.27.0.tgz} + resolution: {integrity: sha512-VC3prAQVgWTubMStb3mJz6i61Hqbtagi2LeIbgNtoFJFff3XZDcAaO1D5r0GYl2+DrB2VzUHnQXbkiuI+HHYyg==} '@algolia/requester-node-http@4.27.0': - resolution: {integrity: sha1-ujY3/xULEWHnk/eici7FAz6nT3c=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/requester-node-http/-/requester-node-http-4.27.0.tgz} + resolution: {integrity: sha512-y8nUqaUQeSOQ5oaNo0b2QPznyBFW9LoIwljyUphJ+gUZpU6O/j2/C8ovoqDpIe6J0etqHg5RCcBizrCFZuLpyw==} '@algolia/transporter@4.27.0': - resolution: {integrity: sha1-Ulk1ygMzEBo8bP8TBOQZHQYc9ik=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@algolia/transporter/-/transporter-4.27.0.tgz} + resolution: {integrity: sha512-PvSbELU4VjN3xSX79ki+zIdOGhTxyJXWvRDzkUjfTx2iNfPWDdTjzKbP1o+268coJztxrkuBwJz90Urek7o1Kw==} '@alloy-js/babel-plugin-jsx-dom-expressions@0.40.0': resolution: {integrity: sha512-vK4enF0fmATGjqv2E2S3Zhci3TmM7+jp+cmsAhhLE0U/6kFmYJqqKV+swdcRs/fAlRJwaoevqarbMLm4zY05OQ==} @@ -3161,58 +3161,58 @@ packages: typescript: ^5.0.0 || ^6.0.0 '@astrojs/compiler-binding-darwin-arm64@0.2.2': - resolution: {integrity: sha1-SJ45Tbu1NrmT61X9C5DCIQ6LWnE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-darwin-arm64/-/compiler-binding-darwin-arm64-0.2.2.tgz} + resolution: {integrity: sha512-1WxpECx3izz5X4Ha3l6ex79HZlUHpKBTElGJsfOosnhVvXhccfcXAsBlrYPNmUOKJWiG7mcrje0ELSr1KPE69Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@astrojs/compiler-binding-darwin-x64@0.2.2': - resolution: {integrity: sha1-ghM5ZNT2nuA9sVb0JS6kp9Jh9yw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-darwin-x64/-/compiler-binding-darwin-x64-0.2.2.tgz} + resolution: {integrity: sha512-PdIQidwQ4nUX/qNL0JXzSwNYadr+yX/Yoo+kZSCxBZqlAqug9SlKR/1H5EG5jSEpkEDRo2d1JdrO1W4kU6uNHw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@astrojs/compiler-binding-linux-arm64-gnu@0.2.2': - resolution: {integrity: sha1-Wzgy/Pt2HPsvWZmCwStDRgqIapM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-arm64-gnu/-/compiler-binding-linux-arm64-gnu-0.2.2.tgz} + resolution: {integrity: sha512-5sZicPkJCoyxTEOW2he+u6UV97pTXY4c7fbHOZ/aslu9ewsunD0231QUBSvnjBB9hRFzzP2JRfNCLY+IvWfw0Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@astrojs/compiler-binding-linux-arm64-musl@0.2.2': - resolution: {integrity: sha1-CkJ24XSJR9fiX3/hEOn7J5HKlkM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-arm64-musl/-/compiler-binding-linux-arm64-musl-0.2.2.tgz} + resolution: {integrity: sha512-Vto5fqRzMepQNJPeEhQLOIkmAoNbSBQNlpMe64OHTjEbAtQpJYVHEwe+8WJLaEGLA9qBksLv7ctiYPLLxgVVYQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@astrojs/compiler-binding-linux-x64-gnu@0.2.2': - resolution: {integrity: sha1-C0BJg6RytGAklAn9ApC9jmJ2ZB8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-x64-gnu/-/compiler-binding-linux-x64-gnu-0.2.2.tgz} + resolution: {integrity: sha512-NJTTaUDU49WEJT+ImS9evlv3i3x42HN8PbcqdyydI9picnKtuf5TxRL94naoW09YDMYWpkrwVeVqaG7GTSIepQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@astrojs/compiler-binding-linux-x64-musl@0.2.2': - resolution: {integrity: sha1-JiD1kU67xSaqBChL6heEhHfcnVo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-linux-x64-musl/-/compiler-binding-linux-x64-musl-0.2.2.tgz} + resolution: {integrity: sha512-9nFdNDkWaU35bhWUIciDmi439W0fq2ZNgv1GCi2A/LSb+8vTw9l9z+fVW4YEn7Tlvbs8gyQkJvbc62ZD1H76xA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@astrojs/compiler-binding-wasm32-wasi@0.2.2': - resolution: {integrity: sha1-QMuEgGz5udqTJ9Ih3yduptSXgyE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-wasm32-wasi/-/compiler-binding-wasm32-wasi-0.2.2.tgz} + resolution: {integrity: sha512-3NWaxRc3KSwr9zHBEGcQ147rMgAhi/HzZWZJPRN2YLbtuLhoeBPruhdX1MIlOYAg3FvJPYdzGCAKvvWWU6pF0A==} engines: {node: '>=14.0.0'} cpu: [wasm32] '@astrojs/compiler-binding-win32-arm64-msvc@0.2.2': - resolution: {integrity: sha1-mZoSv0E8jf7HmdAFw0iumzwkN6c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-win32-arm64-msvc/-/compiler-binding-win32-arm64-msvc-0.2.2.tgz} + resolution: {integrity: sha512-QsyOgocLGOwDm8zAyuAiziALMzbTTevaqBLv5lvdhyhj2JC5yjp0H3yeEBtE0owRLr1gDQdX0+1qBSc5tTwp4g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@astrojs/compiler-binding-win32-x64-msvc@0.2.2': - resolution: {integrity: sha1-YgCfnNDfTZ0eLNV2c46SN9gtZz8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@astrojs/compiler-binding-win32-x64-msvc/-/compiler-binding-win32-x64-msvc-0.2.2.tgz} + resolution: {integrity: sha512-+/C8Oh9YS8C0fwtaqDtUSPniKwlJqgiQbxp7XuzxCP0RI/Jf7yOlz9ZHNr6jD3ZJa4CHdq0mYq7pd8QFiNGIZA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -3579,28 +3579,28 @@ packages: resolution: {integrity: sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==} '@bruits/satteri-darwin-arm64@0.9.1': - resolution: {integrity: sha1-e5R/kMk/ISXEVwKiHd/UaSlwK/g=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-darwin-arm64/-/satteri-darwin-arm64-0.9.1.tgz} + resolution: {integrity: sha512-NE4qC2sRd0+R+oPMsKcUikIvWTGpAV16fSXNBoMSW7nK7Pd9e/ZGB7M8knep83pFmGmOb/5NbGKiVIh3oLbljw==} cpu: [arm64] os: [darwin] '@bruits/satteri-darwin-x64@0.9.1': - resolution: {integrity: sha1-QAOJzH5zo1rIvS6zrIVn8GwOVsY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-darwin-x64/-/satteri-darwin-x64-0.9.1.tgz} + resolution: {integrity: sha512-Am8z5nX0L/sJR/n7np+5rMVP434MOBe3zlU+IO8fXbv2UaPNRCrEQPMS6lyxCj7dZHQI2AynSJw3v4fgQE8xSQ==} cpu: [x64] os: [darwin] '@bruits/satteri-linux-x64-gnu@0.9.1': - resolution: {integrity: sha1-3I6cRNkCDXTpl11hfHITpNLJ1Fs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-linux-x64-gnu/-/satteri-linux-x64-gnu-0.9.1.tgz} + resolution: {integrity: sha512-Bivw60+SIfmlaU9wEZ39HAcyPh1xU9TvOrz4KJgc+ziRStQs4EzYoWW4Eh9aSdiol+xV0vjEWYuA79aF3dr7kg==} cpu: [x64] os: [linux] libc: [glibc] '@bruits/satteri-wasm32-wasi@0.9.1': - resolution: {integrity: sha1-2eBYrsjIrzXoKkU6/fOntFxSX/g=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-wasm32-wasi/-/satteri-wasm32-wasi-0.9.1.tgz} + resolution: {integrity: sha512-lEFk5ebh5SxRquA5RJisEoMoDmOiSnS10PGgXgXeVlWgF8KWKI9D3hSzVqNjEg/qKOjHcNdjIfyx/03Wrl6J3g==} engines: {node: '>=14.0.0'} cpu: [wasm32] '@bruits/satteri-win32-x64-msvc@0.9.1': - resolution: {integrity: sha1-tyDECTV/dOLWx0Vcn9e4dLLfJC4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@bruits/satteri-win32-x64-msvc/-/satteri-win32-x64-msvc-0.9.1.tgz} + resolution: {integrity: sha512-YBhm8yARopswAPeTih11BzMxWVQFD5CI9Yryp6HWepi6F/CeMycqxv18DXrj9U2fDDlbVGwT2IiEM2UPBjIPDQ==} cpu: [x64] os: [win32] @@ -3635,7 +3635,7 @@ packages: engines: {node: '>= 20.12.0'} '@colors/colors@1.5.0': - resolution: {integrity: sha1-u1BFecHK6SPmV2pPXaQ9Jfl729k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@colors/colors/-/colors-1.5.0.tgz} + resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} '@cspell/cspell-bundled-dicts@10.0.1': @@ -3936,40 +3936,40 @@ packages: resolution: {integrity: sha512-fXVXEyFA5Yv3M3n8sUGT7+fvecGrZP4k6FnWWMSZVQf69kAq0LLpaBQLGcPR30m3zMmKYhECP4k/ZkzvhEW5kw==} '@emnapi/core@1.10.0': - resolution: {integrity: sha1-OAzMjyQS6iLR2XLff47iOjucdGc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.10.0.tgz} + resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} '@emnapi/core@1.11.0': - resolution: {integrity: sha1-imVQQtu7ENAmZnDJkDw0pwAccFs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.11.0.tgz} + resolution: {integrity: sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q==} '@emnapi/core@1.9.1': - resolution: {integrity: sha1-IUMGnHRMokQgdPgHhGLlHt1jx70=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.9.1.tgz} + resolution: {integrity: sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==} '@emnapi/core@1.9.2': - resolution: {integrity: sha1-OHAmXs/8c1LQHq1i2Ng9g1ii0DQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.9.2.tgz} + resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} '@emnapi/runtime@1.10.0': - resolution: {integrity: sha1-SyYMDTU0IE6YxhELjbGph9JuyHw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.10.0.tgz} + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} '@emnapi/runtime@1.11.0': - resolution: {integrity: sha1-zhazZ0/3Jmu/UPlmi96KBPMBTU4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.11.0.tgz} + resolution: {integrity: sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==} '@emnapi/runtime@1.11.1': - resolution: {integrity: sha1-WPHz1dgamxL3k6tojJY3GQECfCQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.11.1.tgz} + resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} '@emnapi/runtime@1.9.1': - resolution: {integrity: sha1-EV/yoNWJhlvmvY6dcB5JnEc/Ko0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.9.1.tgz} + resolution: {integrity: sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==} '@emnapi/runtime@1.9.2': - resolution: {integrity: sha1-i0aaPbFggXytsd6QUCEanR6oT6I=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.9.2.tgz} + resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} '@emnapi/wasi-threads@1.2.0': - resolution: {integrity: sha1-oZ2Xcsw9GVNwv24qgF7sQKp14Y4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz} + resolution: {integrity: sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==} '@emnapi/wasi-threads@1.2.1': - resolution: {integrity: sha1-KP7SGhuhznl8RKBwq8lNQvOuhUg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz} + resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} '@emnapi/wasi-threads@1.2.2': - resolution: {integrity: sha1-TJO+z1v6OxPRu9zAau44MhrYE5o=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz} + resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} '@emotion/hash@0.9.2': resolution: {integrity: sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==} @@ -3978,157 +3978,157 @@ packages: resolution: {integrity: sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==} '@esbuild/aix-ppc64@0.28.1': - resolution: {integrity: sha1-egGo0uwvuy2seK2tCbD6eB5Agr4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz} + resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] '@esbuild/android-arm64@0.28.1': - resolution: {integrity: sha1-tUCifRTkr9BYSWpNvsTT9BTbEQo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz} + resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==} engines: {node: '>=18'} cpu: [arm64] os: [android] '@esbuild/android-arm@0.28.1': - resolution: {integrity: sha1-cEvSl95tdi3lTqu+r79V9nVqvi8=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-arm/-/android-arm-0.28.1.tgz} + resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==} engines: {node: '>=18'} cpu: [arm] os: [android] '@esbuild/android-x64@0.28.1': - resolution: {integrity: sha1-0csWbTSw+/D+irRgpVlPJKN4cB4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-x64/-/android-x64-0.28.1.tgz} + resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==} engines: {node: '>=18'} cpu: [x64] os: [android] '@esbuild/darwin-arm64@0.28.1': - resolution: {integrity: sha1-EDSyZFf8iGNo/mG70J9lP2r6jlQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz} + resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] '@esbuild/darwin-x64@0.28.1': - resolution: {integrity: sha1-ZVVqQyoeTXIDLYIYwZMvzKGkl3I=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz} + resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] '@esbuild/freebsd-arm64@0.28.1': - resolution: {integrity: sha1-LmHgWS+QMNfj2uGO4l68U1kYrvY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz} + resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] '@esbuild/freebsd-x64@0.28.1': - resolution: {integrity: sha1-yV7CiZWe+AecTcqBeh4sS+Zrm9M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz} + resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] '@esbuild/linux-arm64@0.28.1': - resolution: {integrity: sha1-QLIhdd2gYYLz7oFBGGxf8wTEpxc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz} + resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==} engines: {node: '>=18'} cpu: [arm64] os: [linux] '@esbuild/linux-arm@0.28.1': - resolution: {integrity: sha1-wJoPZ5F1kqwN6JKpvk04FN69Kmw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz} + resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==} engines: {node: '>=18'} cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.28.1': - resolution: {integrity: sha1-pYD5xnZ5eDOJHlGfx6EzfIr9jbM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz} + resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==} engines: {node: '>=18'} cpu: [ia32] os: [linux] '@esbuild/linux-loong64@0.28.1': - resolution: {integrity: sha1-RkUs8yHcf56Rwvp4Cla7Vuec1os=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz} + resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] '@esbuild/linux-mips64el@0.28.1': - resolution: {integrity: sha1-QhGzGE3WYI9T3LIuOfXTTuCIUsg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz} + resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] '@esbuild/linux-ppc64@0.28.1': - resolution: {integrity: sha1-aXhXwqYcubC2u2ZS5AwdxeHKjl0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz} + resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] '@esbuild/linux-riscv64@0.28.1': - resolution: {integrity: sha1-0ZKUPrFGpArExkl9DPe+NbmGvwg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz} + resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] '@esbuild/linux-s390x@0.28.1': - resolution: {integrity: sha1-rOoDVtoODrwI+Xz3ucLkAeHmSNw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz} + resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==} engines: {node: '>=18'} cpu: [s390x] os: [linux] '@esbuild/linux-x64@0.28.1': - resolution: {integrity: sha1-bww84MtkxTS3DExF7LLBbTTjXf0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz} + resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==} engines: {node: '>=18'} cpu: [x64] os: [linux] '@esbuild/netbsd-arm64@0.28.1': - resolution: {integrity: sha1-i813B3oNzjN4tXT+2ybSolO3PTY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz} + resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] '@esbuild/netbsd-x64@0.28.1': - resolution: {integrity: sha1-5/sqAemcgwyU5mI82f77TI+1g0c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz} + resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] '@esbuild/openbsd-arm64@0.28.1': - resolution: {integrity: sha1-xSkJNy24uG4sVeBaiUADO1Zgo7I=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz} + resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] '@esbuild/openbsd-x64@0.28.1': - resolution: {integrity: sha1-xCe5vlpkwmL/mn63C1+7qt9EbGw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz} + resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] '@esbuild/openharmony-arm64@0.28.1': - resolution: {integrity: sha1-3JsUe6yi5sSzyFVxdB70hgpIkJc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz} + resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] '@esbuild/sunos-x64@0.28.1': - resolution: {integrity: sha1-zoZtEt8TwV5MmfBzo9Rm9uBkmzo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz} + resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==} engines: {node: '>=18'} cpu: [x64] os: [sunos] '@esbuild/win32-arm64@0.28.1': - resolution: {integrity: sha1-dGjjaS0B1inVlB5dg4F7uA+eObQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz} + resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] '@esbuild/win32-ia32@0.28.1': - resolution: {integrity: sha1-pbwAY/sryrbQ7WPyoVN5WLwmnsY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz} + resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==} engines: {node: '>=18'} cpu: [ia32] os: [win32] '@esbuild/win32-x64@0.28.1': - resolution: {integrity: sha1-EAZO5E9DR7kMmgK0Rrv4CpFjKxI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz} + resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -4146,33 +4146,33 @@ packages: resolution: {integrity: sha512-hu7EI+YxlEWEKrb2himbS13HNaq5mlUePASf99KeQqkiNeqiAZbKqG4w59uDcLZs8JrV3qJqS/NYib5ZMhbfTQ==} '@eslint-community/eslint-utils@4.9.1': - resolution: {integrity: sha1-TpCvZ7xR3e5s3vUoTt9XLsN2tZU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz} + resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 '@eslint-community/regexpp@4.12.2': - resolution: {integrity: sha1-vM32Fbz3tujbgw7AuNIcmiXeWXs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint-community/regexpp/-/regexpp-4.12.2.tgz} + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/config-array@0.23.5': - resolution: {integrity: sha1-VuhtJDBJGV2KzAwGobPf3D+j3pU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/config-array/-/config-array-0.23.5.tgz} + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/config-helpers@0.6.0': - resolution: {integrity: sha1-75o2iB0539Xb6sIrDamX+r+wiwM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/config-helpers/-/config-helpers-0.6.0.tgz} + resolution: {integrity: sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/core@1.2.1': - resolution: {integrity: sha1-wdp80bgvqHh/mLVin7gRhIobY84=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/core/-/core-1.2.1.tgz} + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/object-schema@3.0.5': - resolution: {integrity: sha1-iOm/TRHSsZwILnjr586IckpesJE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/object-schema/-/object-schema-3.0.5.tgz} + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/plugin-kit@0.7.2': - resolution: {integrity: sha1-Swli8/LHzovJiz7P40UlwJ0styk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz} + resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@expressive-code/core@0.43.1': @@ -4744,23 +4744,23 @@ packages: engines: {node: '>=12.20'} '@humanfs/core@0.19.2': - resolution: {integrity: sha1-qCcsoDsqz0kmcCIrIyC2xCG/3mA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanfs/core/-/core-0.19.2.tgz} + resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} engines: {node: '>=18.18.0'} '@humanfs/node@0.16.8': - resolution: {integrity: sha1-j4AMzME/T4zTEW4tnAqUk52j4+0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanfs/node/-/node-0.16.8.tgz} + resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} engines: {node: '>=18.18.0'} '@humanfs/types@0.15.0': - resolution: {integrity: sha1-8qCfYgEjkLK/8/xvskjd7IwJoJA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanfs/types/-/types-0.15.0.tgz} + resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha1-r1smkaIrRL6EewyoFkHF+2rQFyw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz} + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha1-wrnS43TuYsWG062+qHGZsdenpro=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@humanwhocodes/retry/-/retry-0.4.3.tgz} + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} '@iconify/types@2.0.0': @@ -4774,308 +4774,308 @@ packages: engines: {node: '>=18'} '@img/sharp-darwin-arm64@0.34.5': - resolution: {integrity: sha1-bgcy3K3hJrZnCveqFwYLkmg16oY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz} + resolution: {integrity: sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [darwin] '@img/sharp-darwin-arm64@0.35.2': - resolution: {integrity: sha1-g6UQolFhKVzsR3P7iBy8ytdDyMI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.2.tgz} + resolution: {integrity: sha512-eEieHsMksAW4IiO5NzauESRl2D2qz3J/kwUxUrSfV06A93eEaRfMpHXyUb1mAqrR7i8U9A0GRqE9pjn6u1Jjpg==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [darwin] '@img/sharp-darwin-x64@0.34.5': - resolution: {integrity: sha1-Gbwd1uum1alig0mLnJ9AEYDunHs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz} + resolution: {integrity: sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [darwin] '@img/sharp-darwin-x64@0.35.2': - resolution: {integrity: sha1-iGHxsTh2w3NdwdOCFH/5aJqQu9s=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.2.tgz} + resolution: {integrity: sha512-BaktuGPCeHJMARpodR8jK4uKiZrPAy9WrfQW0sdI37clracq8Bp01AYS3SZgi5FS/y5twa9t4+LIuuxQjqRrWw==} engines: {node: '>=20.9.0'} cpu: [x64] os: [darwin] '@img/sharp-freebsd-wasm32@0.35.2': - resolution: {integrity: sha1-vRwwNW/ZP52oCvF0a3vL0rza/2M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.2.tgz} + resolution: {integrity: sha512-YoAxdnd8hPUkvLHd3bWY+YA8nw3xM/RyRopYucNsWHVSan8NLVM3X2volsfoRDcXdUJPg6tXahSd7HXPK7lRnw==} engines: {node: '>=20.9.0'} os: [freebsd] '@img/sharp-libvips-darwin-arm64@1.2.4': - resolution: {integrity: sha1-KJTAy4fUInbDiJlC6OLbUXpJLEM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz} + resolution: {integrity: sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==} cpu: [arm64] os: [darwin] '@img/sharp-libvips-darwin-arm64@1.3.1': - resolution: {integrity: sha1-qq7rc6tSKQzj7IlqCDVXUQ89i3A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.1.tgz} + resolution: {integrity: sha512-4V/M3roRMTYjiwZY9IOVQOE8OyeCxFAkYmyZDrZl51uOKjibm3oeEJ4WAmLxutAfzFbC9jqUiPs2gbnGflH+7g==} cpu: [arm64] os: [darwin] '@img/sharp-libvips-darwin-x64@1.2.4': - resolution: {integrity: sha1-5jaB9FOalK+c0XJG7YiBc0OG+Mw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz} + resolution: {integrity: sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==} cpu: [x64] os: [darwin] '@img/sharp-libvips-darwin-x64@1.3.1': - resolution: {integrity: sha1-BzMN/+F52i+7odp8zKctQsQgcxU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.1.tgz} + resolution: {integrity: sha512-c0/DxItpJv2+dGhgycJBBgotdqruGYDvA79drdh0MD1dFpy7JzJ/PlXwi1H4rFf0eTy8tgbI91aHDnZIceY3jQ==} cpu: [x64] os: [darwin] '@img/sharp-libvips-linux-arm64@1.2.4': - resolution: {integrity: sha1-sbKIs2hks7zlRa2R+m2tzxpK0xg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz} + resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-arm64@1.3.1': - resolution: {integrity: sha1-pnu5Zm6PJB2i++3BYmgShJoT7wU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.1.tgz} + resolution: {integrity: sha512-JznefmcK9j1JKPz8AkQDh89kjojubyfOasWBPKfzMIhPwsgDy9evpE/naJTXXXmghS1iFwR8u/kTwh/I2/+GCw==} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': - resolution: {integrity: sha1-uSYN0evm+eO9vL3KydKsEl81hS0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz} + resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-arm@1.3.1': - resolution: {integrity: sha1-cWGfUM8W3qPu2YXNr27b5NBw9fM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.1.tgz} + resolution: {integrity: sha512-aGGy9aWzXgHBG7HNyQPWorZthlp7+x6fDRoPAQbGO3ThcttuTyKIx3NuSHb6zb4gBNq6/yNn9f1cy9nFKS/Vmg==} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': - resolution: {integrity: sha1-S4Ps8qgpBXIis4hIx7Ai57TQeqc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz} + resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.3.1': - resolution: {integrity: sha1-HjXJEZnQdTpC2Qrs8BnfkuDf0SM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.1.tgz} + resolution: {integrity: sha512-1EkwGNCZk6iWNCMWqrvdJ+r1j0PT1zIz60CNPhYnJlK/zyeWqlsPZIe+ocBVqPF8k/Ssee/NCk+tE9Ryrko6ng==} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': - resolution: {integrity: sha1-iAtGeACeWiCArxkjMrALCq+KSN4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz} + resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.3.1': - resolution: {integrity: sha1-fIk1FrL+aoZP3EwKxi8WjfsthXk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.1.tgz} + resolution: {integrity: sha512-Ilays+w2bXdnxzxtQdmXR62u8o8GYa3eL4+Gr+1KiE4xperMZUslRaVPJwwPkzlHEjGfXAfRVAa/7CYCtSqsBw==} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': - resolution: {integrity: sha1-dPNDyOEPrYIbOPdc7TBIiTncWew=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz} + resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-s390x@1.3.1': - resolution: {integrity: sha1-44254Sz2N5QZg9CL6cyZ/CD0AvU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.1.tgz} + resolution: {integrity: sha512-VfBwVHQTbRoj4XlpA/KLZ7ltgMpz+4WSejFzQ+GnoImjo1PtEJ59QB2qR1xQEeRPYIkNrPIm2L4cICMvz4C2ew==} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': - resolution: {integrity: sha1-30GD6L2EEPfWG2aFmjXt6rClMc4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz} + resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-libvips-linux-x64@1.3.1': - resolution: {integrity: sha1-vhUKFeiCXunV5RmLOt5tuQMPB2s=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.1.tgz} + resolution: {integrity: sha512-+c8ukgwU62DS54nCAjw7keOfHUkmr0B5QHEdcOqRnodF/MNXJbVI8Eopoj4B/0H8Asr65I+A4Amrn7a85/md6A==} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': - resolution: {integrity: sha1-yNa0ghHfZxN1QQB+6NG3sfjKjgY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz} + resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-libvips-linuxmusl-arm64@1.3.1': - resolution: {integrity: sha1-kLLzVXnYdOugO+Y5fjbKRaA1mls=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.1.tgz} + resolution: {integrity: sha512-qlKb/pwbkAi1WMsJrYHk7CuDrd12s27U2QnRhFYUoJNrRCmkosMTttuRFat/DDB3IlDm5qE1TJgZ4JDnHX8Ldw==} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': - resolution: {integrity: sha1-vhHHW+5bCAy+4xoVOod5RI+Rn3U=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz} + resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.3.1': - resolution: {integrity: sha1-vseNOKinRG7jERDsBIfBSezZ7nU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.1.tgz} + resolution: {integrity: sha512-yO21HwoUVLN8Qa+/SBjQLMYwBWAVJjeGPNe+hc0OUeMeifEtJqu5a1c4HayE1nNpDih9y3/KkoltfkDodmKAlg==} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-linux-arm64@0.34.5': - resolution: {integrity: sha1-eqd2TvnAAfFeYQVG1C/OVpEXkMw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz} + resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-linux-arm64@0.35.2': - resolution: {integrity: sha1-XgwsGTmL/4iLhqvmaDrxRrume5Q=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.2.tgz} + resolution: {integrity: sha512-af12Pnd0ZGu2HfP8NayB0kk6eC/lrfbQE6HlR4jD+34wdJ1Vw9TF6TMn6ZvffT+WgqVsl0hRbmNvz2u/23VmwA==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] libc: [glibc] '@img/sharp-linux-arm@0.34.5': - resolution: {integrity: sha1-X7DDaV3RJSLTnD/3pryBZGF4Cg0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz} + resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-linux-arm@0.35.2': - resolution: {integrity: sha1-ne4abrJBvD8DnaIKaSBjMsrR73o=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.2.tgz} + resolution: {integrity: sha512-SE4kzF2mepn6z+6E7L6lsV8FzuLL6IPQdyX8ZiwROAG/G8td+hP/m7FsFPwidtrF19gvajuC9l6TxAVcsA4S7A==} engines: {node: '>=20.9.0'} cpu: [arm] os: [linux] libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': - resolution: {integrity: sha1-nCE6gVIKIMr2aXjz1MB0Vv8uCBM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz} + resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-linux-ppc64@0.35.2': - resolution: {integrity: sha1-Tl8DlF+u/E2SEhuh9TS3BpflONU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.2.tgz} + resolution: {integrity: sha512-hYSBm7zcNtDCozCxQHYZJiu63b/bXsgRZuOxCIBZsStMM9Vap47iFHdbX4kCvQsblPB/k+clhELpdQJHQLSHvg==} engines: {node: '>=20.9.0'} cpu: [ppc64] os: [linux] libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': - resolution: {integrity: sha1-zdKBgndOrb4E9iZ1oWqrvMuDP2A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz} + resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-linux-riscv64@0.35.2': - resolution: {integrity: sha1-5YoOh3IoyJEKQEFg6XxMP1OfYdw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.2.tgz} + resolution: {integrity: sha512-qQt0Kc13+Hoan/Awq/qMSQw3L+RI1NCRPgD5cUJ/1WSSmIoysLOc72jlRM3E0OHN9Yr313jgeQ2T+zW+F03QFA==} engines: {node: '>=20.9.0'} cpu: [riscv64] os: [linux] libc: [glibc] '@img/sharp-linux-s390x@0.34.5': - resolution: {integrity: sha1-k+rGAbnzKbsnkX4OGQmMci1jDfc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz} + resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-linux-s390x@0.35.2': - resolution: {integrity: sha1-4SkhNwQjMsNYGCPqUVNd3pccU40=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.2.tgz} + resolution: {integrity: sha512-E4fLLfRPzDLlEeDaTzI98OFLcv++WL5ChLLMwPoVd0CIoZQqupBSNbOisPL5am9XsbQ9T84+iiMpUvbFtkunbA==} engines: {node: '>=20.9.0'} cpu: [s390x] os: [linux] libc: [glibc] '@img/sharp-linux-x64@0.34.5': - resolution: {integrity: sha1-VavHzXVP/KUAK2wrcZq9/IRoGag=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz} + resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-linux-x64@0.35.2': - resolution: {integrity: sha1-ujob+uwAqzlJU/hD8v6NWVB9CCY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.2.tgz} + resolution: {integrity: sha512-gi0zFJJRLswfCZmHtJdikXPOc5u7qamSOS3NHedLqLd4W8Q0NqjdBr6TTRIgsfFjqfTsHFgdfvJ9LwqSgcHiAA==} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': - resolution: {integrity: sha1-1lFe6XG7YvcwAaSCm52GWhG3cIY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz} + resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-linuxmusl-arm64@0.35.2': - resolution: {integrity: sha1-Avazdc4Ws342rSn0zd1EkjJ68hI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.2.tgz} + resolution: {integrity: sha512-siWbOW1u6HFnFLrp0waKyW7VEf7jYvcDWdrXEFa8AkdAQgEvuu5Fz8/Y70w9EeqAdwDtfU012BhEHHaDqvQNzg==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [linux] libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': - resolution: {integrity: sha1-2Xl4rsfFIS+ZlxTy9bc2RX4S7p8=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz} + resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-linuxmusl-x64@0.35.2': - resolution: {integrity: sha1-3A2OWKlOp03G5lklqXVSVXX2878=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.2.tgz} + resolution: {integrity: sha512-YBqMMcjDi4QGYiSn4vNOYBhmlC4z5AXqkOUUqI2e0AFA4urNv4ESgOgwNl3K+4etQhha0twXlzeF20bbULm9Yg==} engines: {node: '>=20.9.0'} cpu: [x64] os: [linux] libc: [musl] '@img/sharp-wasm32@0.34.5': - resolution: {integrity: sha1-LxWAOqYm+MWd18nQu8dm8atSz6A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz} + resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [wasm32] '@img/sharp-wasm32@0.35.2': - resolution: {integrity: sha1-n1o8XlOYEns0+o+r7Qf/3YyjQo0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-wasm32/-/sharp-wasm32-0.35.2.tgz} + resolution: {integrity: sha512-Mrv4JQNYVQ94xH+jzZ9r+gowleN8mv2FTgKT+PI6bx5C0G8TdNYndu161pg2i7uoBwxy2ImPMHrJOM2LZef7Bw==} engines: {node: '>=20.9.0'} '@img/sharp-webcontainers-wasm32@0.35.2': - resolution: {integrity: sha1-NZT16i6s80gcF4cUat4998/Y7r4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.2.tgz} + resolution: {integrity: sha512-QNV27pxs9wpApEiCfvHM1RDoP1w1+2KrUWWDPEhEwg+latvOrfuhWrHWZKwdSFwU6jh3myjw/yOCRsUIuOft3g==} engines: {node: '>=20.9.0'} cpu: [wasm32] '@img/sharp-win32-arm64@0.34.5': - resolution: {integrity: sha1-Nwbp46w1/d/ByH+U6Enxt1MHzgo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz} + resolution: {integrity: sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [win32] '@img/sharp-win32-arm64@0.35.2': - resolution: {integrity: sha1-cDHJE0/jTmbCSuIaDu01dDDoHlo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.2.tgz} + resolution: {integrity: sha512-BiVRYc/t6/Vl3e1hBx0hugG4oN9Pydf4fgMSpxTQJmwGUg/YoXTWHiFeRymHfCZzifxu4F4rpk/I67D0LQ20wQ==} engines: {node: '>=20.9.0'} cpu: [arm64] os: [win32] '@img/sharp-win32-ia32@0.34.5': - resolution: {integrity: sha1-C3EWZZmwSeAy8IX7kmPgL05HiN4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz} + resolution: {integrity: sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ia32] os: [win32] '@img/sharp-win32-ia32@0.35.2': - resolution: {integrity: sha1-a5Ehne+4ghUpH5sF1d+P+Ysb5iw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.2.tgz} + resolution: {integrity: sha512-YYEhx9PImCC7T0tI8JDMi4DB9LwLCXCU5OWNYEXAxh5Q1ShKkyC6byxzoBJ3gEFDnH2lQckWuDe70G7mB2XJog==} engines: {node: ^20.9.0} cpu: [ia32] os: [win32] '@img/sharp-win32-x64@0.34.5': - resolution: {integrity: sha1-qB/7AOaSZ80KHWJurtuKhDCysvg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz} + resolution: {integrity: sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [win32] '@img/sharp-win32-x64@0.35.2': - resolution: {integrity: sha1-QGUigNhztAwaaMO51usJqy9CWQE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.2.tgz} + resolution: {integrity: sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ==} engines: {node: '>=20.9.0'} cpu: [x64] os: [win32] @@ -5322,7 +5322,7 @@ packages: resolution: {integrity: sha512-xgAyonlVVS+q7Vc7qLW0UrJU7rSFcETRWsqdXZtjzRU8dF+6CkozTK4V4y1LwOX7j8r/vHphjDeMeGI4tNGeGA==} '@napi-rs/wasm-runtime@1.1.5': - resolution: {integrity: sha1-zM1uvEC5kd6mk2+RJrG4FVtsTJU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz} + resolution: {integrity: sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 @@ -5514,128 +5514,128 @@ packages: resolution: {integrity: sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==} '@oxc-parser/binding-android-arm-eabi@0.127.0': - resolution: {integrity: sha1-t155YknuIvYy5A6UJ0bEv2SM7pI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.127.0.tgz} + resolution: {integrity: sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] '@oxc-parser/binding-android-arm64@0.127.0': - resolution: {integrity: sha1-4mRGf+OfgAGPYvoNroLbC4AmBEQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.127.0.tgz} + resolution: {integrity: sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@oxc-parser/binding-darwin-arm64@0.127.0': - resolution: {integrity: sha1-BXbTUQnADcxidyALouyntH4H8bE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.127.0.tgz} + resolution: {integrity: sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@oxc-parser/binding-darwin-x64@0.127.0': - resolution: {integrity: sha1-76G6SQdaoxj/VAocL4pEIBdBcgY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.127.0.tgz} + resolution: {integrity: sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@oxc-parser/binding-freebsd-x64@0.127.0': - resolution: {integrity: sha1-gXujxQjXUdlNbm/Yavad2qJ9pTE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.127.0.tgz} + resolution: {integrity: sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@oxc-parser/binding-linux-arm-gnueabihf@0.127.0': - resolution: {integrity: sha1-scMJbGVHcZmEgDFu8Q0eXSntx5s=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.127.0.tgz} + resolution: {integrity: sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxc-parser/binding-linux-arm-musleabihf@0.127.0': - resolution: {integrity: sha1-xEqPEObJA2hYJa6/Eon8IIau1h4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.127.0.tgz} + resolution: {integrity: sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxc-parser/binding-linux-arm64-gnu@0.127.0': - resolution: {integrity: sha1-YcJFq/q29jBFkVtcnPp9M1rXxEA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.127.0.tgz} + resolution: {integrity: sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-arm64-musl@0.127.0': - resolution: {integrity: sha1-NYu9kOXIW2w1El9ab/CE4JtpTAQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.127.0.tgz} + resolution: {integrity: sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@oxc-parser/binding-linux-ppc64-gnu@0.127.0': - resolution: {integrity: sha1-t+p7Ub9U20xCgZGH92DgadQz2sM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.127.0.tgz} + resolution: {integrity: sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-riscv64-gnu@0.127.0': - resolution: {integrity: sha1-OjsQ0WCYjfULu81jHGrznePdRR0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.127.0.tgz} + resolution: {integrity: sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-riscv64-musl@0.127.0': - resolution: {integrity: sha1-N4fTfh0KFe4jn1FhAphQAyGzFzA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.127.0.tgz} + resolution: {integrity: sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] '@oxc-parser/binding-linux-s390x-gnu@0.127.0': - resolution: {integrity: sha1-txoWy7oRWkaWSY+RSbxUzE4d+c0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.127.0.tgz} + resolution: {integrity: sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-x64-gnu@0.127.0': - resolution: {integrity: sha1-cVJ90ChLpyfTWpPIQckRkq8+vew=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.127.0.tgz} + resolution: {integrity: sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@oxc-parser/binding-linux-x64-musl@0.127.0': - resolution: {integrity: sha1-FoMK+ksAHzSc67k+ErJ45yYByz8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.127.0.tgz} + resolution: {integrity: sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@oxc-parser/binding-openharmony-arm64@0.127.0': - resolution: {integrity: sha1-pBxx0knLWX3DVwOOscvjznMkU/g=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.127.0.tgz} + resolution: {integrity: sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@oxc-parser/binding-wasm32-wasi@0.127.0': - resolution: {integrity: sha1-se/NtDOzDtSjrZEvoD2jg0vUhF0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.127.0.tgz} + resolution: {integrity: sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] '@oxc-parser/binding-win32-arm64-msvc@0.127.0': - resolution: {integrity: sha1-titeMoEmMj1Brh7nrclVN8TEQjo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.127.0.tgz} + resolution: {integrity: sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@oxc-parser/binding-win32-ia32-msvc@0.127.0': - resolution: {integrity: sha1-2sMN5pcdvmOqVyK+mkzAcP08ZQ4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.127.0.tgz} + resolution: {integrity: sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] '@oxc-parser/binding-win32-x64-msvc@0.127.0': - resolution: {integrity: sha1-ot+HmwgD9ys1CnVnNlzuW4l47fA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.127.0.tgz} + resolution: {integrity: sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -5647,267 +5647,267 @@ packages: resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==} '@oxc-resolver/binding-android-arm-eabi@11.21.3': - resolution: {integrity: sha1-98pC2UYU7sl+ILmvqnFz79YBnuk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.21.3.tgz} + resolution: {integrity: sha512-eNU11A2WNizh04v3uyaJCootrHIaS0B9aHYXvAvVnPNk4xYSjMUjHnhQ6dewPN2MRYDskV85d1N0Aw0WNWhcyg==} cpu: [arm] os: [android] '@oxc-resolver/binding-android-arm64@11.21.3': - resolution: {integrity: sha1-9yNoLFm03+FD7cttNk1aA94+lJ4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.21.3.tgz} + resolution: {integrity: sha512-8Q+ZjTLvn2dIcWsrmhdrEihm7q+ag/k+mkry7Z+t0QbbHaVxXQfvH9AewyVMh/WrpEKhQ3DDgx9fYbqeCpeOEw==} cpu: [arm64] os: [android] '@oxc-resolver/binding-darwin-arm64@11.21.3': - resolution: {integrity: sha1-58TzdByHkRxAxCmiCgW3gTacq6o=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.21.3.tgz} + resolution: {integrity: sha512-wkh0qKZGHXVUDxFw3oA1TXnU2BDYY/r775oJflGeIr8uDPPoN2pk8gijQIzYRT6hoql/lg3+Tx/SaTn9e2/aGg==} cpu: [arm64] os: [darwin] '@oxc-resolver/binding-darwin-x64@11.21.3': - resolution: {integrity: sha1-jSNFzS2NTc+lBCLibzsAja6Rv8E=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.21.3.tgz} + resolution: {integrity: sha512-HbNc23FAQYbuyDV2vBWMez4u4mrsm5RAkniGZAWqr6lYZ3N4beeqIb776jzwRl8qL2zRhHVXpUj97X0QgogVzg==} cpu: [x64] os: [darwin] '@oxc-resolver/binding-freebsd-x64@11.21.3': - resolution: {integrity: sha1-t1VMOreQOpWq1hC6XRY5lvS3EJU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.21.3.tgz} + resolution: {integrity: sha512-K6xNsTUPEUdfrn0+kbMq5nOUB5w1C5pavPQngt4TM2FpN91lP0PBe2srSpamb4d69O7h86oAi/qWX/kZNRSjkw==} cpu: [x64] os: [freebsd] '@oxc-resolver/binding-linux-arm-gnueabihf@11.21.3': - resolution: {integrity: sha1-KnF9b3m911pczch1vNCp/uWF8cM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.21.3.tgz} + resolution: {integrity: sha512-VcFmOpcpWX1zoEy8M58tR2M9YxM+Z9RuQhqAx5q0CTmrruaP7Gveejg75hzd/5sg5nk9G3aLALEa3hE2FsmmTQ==} cpu: [arm] os: [linux] '@oxc-resolver/binding-linux-arm-musleabihf@11.21.3': - resolution: {integrity: sha1-LP1SNN4pE8KAXkK1+uWqk1TZm6k=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.21.3.tgz} + resolution: {integrity: sha512-quVoxFLBy43hWaQbbDtQNRwAX5vX76mv7n64icAtQcJ3eNgVeblqmkupF/hAneNthdqSlnd1sTjb3aQSaDPaCQ==} cpu: [arm] os: [linux] '@oxc-resolver/binding-linux-arm64-gnu@11.21.3': - resolution: {integrity: sha1-MhcvvRtm191tygX82Fzuew4yBgo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.21.3.tgz} + resolution: {integrity: sha512-X0AqNZgcD07Q4V3RDK18/vYOj/HQT/FnmEFGYS2jTWqY7JO13ryE3TEs3eAIgUJhBnNkpEaiXqz3VK8M7qQhWQ==} cpu: [arm64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-arm64-musl@11.21.3': - resolution: {integrity: sha1-rDHkiUy7DAC9pb4eUmZBBzkjv9w=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.21.3.tgz} + resolution: {integrity: sha512-YkaQnaKYdbuaXvRt5Qd0GpbihzVnyfR6z1SpYfIUC6RTu4NF7lDKPjVkYb+jRI2gedVO2rVpN35Y6akG6ud4Lw==} cpu: [arm64] os: [linux] libc: [musl] '@oxc-resolver/binding-linux-ppc64-gnu@11.21.3': - resolution: {integrity: sha1-qK5+zBElkYEk0YdJ79caTgTgqFY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.21.3.tgz} + resolution: {integrity: sha512-gB9HwhrPiFqUzDeEq+y/CgAijz1YdI6BnXz5GaH2Pa9cWdutchlkGFAiAuGb/PjVQpiK6NFKzFuztxrweoit7A==} cpu: [ppc64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-riscv64-gnu@11.21.3': - resolution: {integrity: sha1-0kztmzIfZg8ahZ+ZEt6rP4f9MRU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.21.3.tgz} + resolution: {integrity: sha512-zjDWBlYk8QGv0H8dsPUWqkfjYIIjG2TvspGkzXL0eImbgxtZorA/klKeHyolevoT3Kvbi+1iMr9Lhrh7jf54Og==} cpu: [riscv64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-riscv64-musl@11.21.3': - resolution: {integrity: sha1-sgzWttTGHqYnGJvJOaxfRppabIk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.21.3.tgz} + resolution: {integrity: sha512-4UfsQvacV388y1zpXL7C1x1FNYaV52JtuNRiuzrfQA2z1z6ElVrsidkGsrvQ5EgeSq1Pj7kaKqrgGkvFuxJ/tw==} cpu: [riscv64] os: [linux] libc: [musl] '@oxc-resolver/binding-linux-s390x-gnu@11.21.3': - resolution: {integrity: sha1-0/SuyCtMuhh+UOIRxg+Va8YRb38=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.21.3.tgz} + resolution: {integrity: sha512-b5uH+HKH0MP5mNBYaK75SKsJbw52URqrx2LavYdq6wb0l3ExAG5niYRP9DWUNHdKilpaBVM2bXk9HNWrH3ew7Q==} cpu: [s390x] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-x64-gnu@11.21.3': - resolution: {integrity: sha1-rdO3YpPvHolZ4AvGtiradm4YSFw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.21.3.tgz} + resolution: {integrity: sha512-PjYlmilBpNRh2ntXNYAK3Am5w/nPfEpnU/96iNx7CI8EzAn12J4JRiec63wHJTH31nLoCNxBg/829pN+3CfG3Q==} cpu: [x64] os: [linux] libc: [glibc] '@oxc-resolver/binding-linux-x64-musl@11.21.3': - resolution: {integrity: sha1-S0x5vSaIoPmgLAoLZxAV/y98Zfw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.21.3.tgz} + resolution: {integrity: sha512-QTBAb7JuHlZ7JUEyM8UiQi2f7m/L4swBhP2TNpYIDc9Wp/wRw1G/8sl6i13aIzQAXH7LKIm294LeOHd0lQR8zA==} cpu: [x64] os: [linux] libc: [musl] '@oxc-resolver/binding-openharmony-arm64@11.21.3': - resolution: {integrity: sha1-PcM6FZqu830td9EN8EWt76tYUt8=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.21.3.tgz} + resolution: {integrity: sha512-4j1DFwjwv36ec9kds0jU/ucQ5Ha4ERO/H95BxR5JFf0kqUUAJ1kwII7XhTc1vZrkdJkvLGC9Q2MbpObpum8RBg==} cpu: [arm64] os: [openharmony] '@oxc-resolver/binding-wasm32-wasi@11.21.3': - resolution: {integrity: sha1-a8ib4FPijVU9sQCzUFxrDSUZsOw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.21.3.tgz} + resolution: {integrity: sha512-i8oluoel5kru/j1WNrjmQSiA3GQ7wvIYVR1IwIoZtKogAhya2iub+ZKIeSIkcJOrnzQ18Tzl/F+kL3fYOxZLvA==} engines: {node: '>=14.0.0'} cpu: [wasm32] '@oxc-resolver/binding-win32-arm64-msvc@11.21.3': - resolution: {integrity: sha1-Y0XucnpZn+wGLEikO5Rct4huh+o=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.21.3.tgz} + resolution: {integrity: sha512-M/8dw8dD6aOs+NlPJax401CZB9I7Aut84isQLgALGGwke4Afvw+/7yYhZb94yXf6t2sPLhQLmSmtSV+2FhsOWg==} cpu: [arm64] os: [win32] '@oxc-resolver/binding-win32-x64-msvc@11.21.3': - resolution: {integrity: sha1-0Nox/ORta4VnL6HnUVQA+vzkXho=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.21.3.tgz} + resolution: {integrity: sha512-H7BCt/VnS9hnmMp42eGhZ99izSCRvlnWwy/N71K1/J8QoExwY4262Z8QiEkMDtduRJrztayDxETTckmUuAVL9Q==} cpu: [x64] os: [win32] '@oxlint-tsgolint/darwin-arm64@0.23.0': - resolution: {integrity: sha1-lvouDN2mF8tZVbz9Tt3uxIZxhf0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/darwin-arm64/-/darwin-arm64-0.23.0.tgz} + resolution: {integrity: sha512-gOs9PVr2wEg4ox9z0aJo+RKhhImW86YL5N6yav8BK/rgPsIrwN/igSZ+pbRr723NFvUNKde9fgMhRA6JrXAOZw==} cpu: [arm64] os: [darwin] '@oxlint-tsgolint/darwin-x64@0.23.0': - resolution: {integrity: sha1-1EmBRiRi71G0C6agfKCiSnjjNf0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/darwin-x64/-/darwin-x64-0.23.0.tgz} + resolution: {integrity: sha512-kjJ8B+7n4tB9VJdxS5A9GdJt6/bYpzbu4lXp2uO1S3sRmCB5gDEABlGoiePNApRWaW+xqL4b4xgiE727jSLhuA==} cpu: [x64] os: [darwin] '@oxlint-tsgolint/linux-arm64@0.23.0': - resolution: {integrity: sha1-YLGEaFABM7BsfiYA1kGWek20Cxc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/linux-arm64/-/linux-arm64-0.23.0.tgz} + resolution: {integrity: sha512-6dCZuKNu135seMXilkRk9SpCx6i1XgmiipYGalLij5WVRX6ZYS8c4xI7preN/zv9fCXhsQclTIMDu2Y/cytTjw==} cpu: [arm64] os: [linux] '@oxlint-tsgolint/linux-x64@0.23.0': - resolution: {integrity: sha1-+NZ3o3/TvTVAUEMWRxcysIlQm4k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/linux-x64/-/linux-x64-0.23.0.tgz} + resolution: {integrity: sha512-3bdilnyA7kmSTjK27rvjIjSxL5SIg3wt7vwNiRkouWB83ytssyKnuGvxSYJxgMEmFpSutzaBzcCUM2jDtPGcgA==} cpu: [x64] os: [linux] '@oxlint-tsgolint/win32-arm64@0.23.0': - resolution: {integrity: sha1-xeYC03dilvFXpcf/pJsKtyRlYMs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/win32-arm64/-/win32-arm64-0.23.0.tgz} + resolution: {integrity: sha512-j+OEp44SVYiQ+ZD+uttsX7u6L9SvmbbQ77SO1pSFCcJlsVMeCk8qZsjhKfGKuT/jIA+ipOJMVs/+pqUfObBWNw==} cpu: [arm64] os: [win32] '@oxlint-tsgolint/win32-x64@0.23.0': - resolution: {integrity: sha1-ofG2DzOnhgd9IJxWi/M6iEEUxeo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint-tsgolint/win32-x64/-/win32-x64-0.23.0.tgz} + resolution: {integrity: sha512-5MyjFuqf+g8OUPJBSGWHJtmoWnzFJYyOg4To9WMQshZYEWig/vtu7JtJ03VWnzHv9LJkAUeApY0gVCOywFR/iQ==} cpu: [x64] os: [win32] '@oxlint/binding-android-arm-eabi@1.71.0': - resolution: {integrity: sha1-hgB+KTt6nMho9u9EFt5mrf99UgQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.71.0.tgz} + resolution: {integrity: sha512-ImGmd1njEg4FEJH03jhRnveEegtO3czCtfptvaHivKAZQIYATbVFBrrzbaYMYv0oJioTnxZAZVSyV+oL7W8S2g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] '@oxlint/binding-android-arm64@1.71.0': - resolution: {integrity: sha1-nb0CWG/HIkoQHjy/P0hOrAf50mo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-android-arm64/-/binding-android-arm64-1.71.0.tgz} + resolution: {integrity: sha512-4A5BEexBrwY1YFF8Kiq/lp/wQPRG79G3BWIE1FuWaM5MvmpYSd+7ZySVcKkHdwo0UDzdQGddp6pD9mpctMqLnw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@oxlint/binding-darwin-arm64@1.71.0': - resolution: {integrity: sha1-eA9SQhJB2hgPJkHToj6nIFIHkLU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.71.0.tgz} + resolution: {integrity: sha512-9wJA9GJulLwS2usU3CEisI/ESDO1n1z9eyTCvApMDrAkbJ1ve0mORgTMjcWWsKxkzkeZ2N/Gpra5IQE7x8tYgQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@oxlint/binding-darwin-x64@1.71.0': - resolution: {integrity: sha1-ChLX+0bl5bAmZGqomYRew3r4TfE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.71.0.tgz} + resolution: {integrity: sha512-PlLCjS06V0PeJMAJwzjrExw1sYNW9Gch3JtNlcwwZDXGlTYDuwHNN89zYH8LTXFfgkVtsYvs2nv0FqrzyuFDzg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@oxlint/binding-freebsd-x64@1.71.0': - resolution: {integrity: sha1-UzsBoSAHX/++s1SMB1PO/Tld2r0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.71.0.tgz} + resolution: {integrity: sha512-Lhil7bWre0ncxbUoDoxfS0JzpTz17BRQKW7iwoAUY8GJ66+WwJEfYPCFJ1P0WgVZR5/O/b3Q2pENlHOjeXLOGQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@oxlint/binding-linux-arm-gnueabihf@1.71.0': - resolution: {integrity: sha1-EFQRgTHD1JqKEyghqsnQ8V3oQdk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.71.0.tgz} + resolution: {integrity: sha512-Oo9/L58PYD3RC0x05d2upAPLllHytTjHQGsnC06P6Ynn7jKkp5mdImQxXdJ3+FnBaKspNpGogzgVsi6g872LiA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxlint/binding-linux-arm-musleabihf@1.71.0': - resolution: {integrity: sha1-0Y223az7wGmNlmDtqS/7/cRRAbY=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.71.0.tgz} + resolution: {integrity: sha512-mSHfyfgJrEbyIR29ejaeS50BdPk+GoNPlC1dckpDiUZbJAIel68sjSMdOt4WY0/gva+ECC7FNITQkxMJU+vSBw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxlint/binding-linux-arm64-gnu@1.71.0': - resolution: {integrity: sha1-S7iwJArXkNGZdI5LqGyshxFG0cY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.71.0.tgz} + resolution: {integrity: sha512-n9yY4M2tiy3aij4AqtlnspzpfdpeT5JQfK2/w2d8oyp5W0FRwOb1dIeX99nORNcxGr08iD9bH8N5XFz3I2iy8w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@oxlint/binding-linux-arm64-musl@1.71.0': - resolution: {integrity: sha1-jLsaZgPZ6qBfmyVGnQT3HfqjrgU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.71.0.tgz} + resolution: {integrity: sha512-fJZrs5sDZtTaPIOiemRQQmo82Ezy+vOGXemPc4Ok7iVVsYsFa7SlW6Z5XN819VfsqBHRm3NJ3rTdnR8+bJYJdQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@oxlint/binding-linux-ppc64-gnu@1.71.0': - resolution: {integrity: sha1-v0gBIOjBu7+/OISm+uwHzy7T2PI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.71.0.tgz} + resolution: {integrity: sha512-cwl7VKGERIy9p+G+AvZdfy/06q0aHXaTt/mMRReC751iuNYJgqKjB7NydXSS30nBT9vtr2tunciOtrR4fD6FUA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@oxlint/binding-linux-riscv64-gnu@1.71.0': - resolution: {integrity: sha1-ki+4B031Nd40bXsf9DPDlPUqYA0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.71.0.tgz} + resolution: {integrity: sha512-eZ8ieVXvzGi8jr7+ybQGPK2STw3mldfxZlgA2738iflfB/rzA69sE6m5rDRpQaxC7dpm745Enlh1Tod0QAk9Gg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] '@oxlint/binding-linux-riscv64-musl@1.71.0': - resolution: {integrity: sha1-VaQ3aTpjsOECbBZ1bFQWYe58nHQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.71.0.tgz} + resolution: {integrity: sha512-puMDbQYe6+NXwfMusojoA7CXGn2b3utukmd23PQqc1E3XhVCwyZ+FueSMzDYeNgDV2dUfIVXAAKZBcFDeCL6sA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] '@oxlint/binding-linux-s390x-gnu@1.71.0': - resolution: {integrity: sha1-KT5BNt6CC3F23qDj6n5KCq5RbGs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.71.0.tgz} + resolution: {integrity: sha512-4NJLxBs1ujISCt3L/1FcywLs73PWtJuw+piD6feK2V6h6OS6P7xu9/sWt1DTRLibe6QCzmfZzmM/2HPORoV/Lg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@oxlint/binding-linux-x64-gnu@1.71.0': - resolution: {integrity: sha1-I1oET4wI1j+6uX7vcFgOshLF9Fk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.71.0.tgz} + resolution: {integrity: sha512-cFDaiR8L3430qp88tfZnvFlt3KotFhR/DlbIL0nHOMMYiG/9Wy4l+6f7t8G8pTa9bd8Lt8+M0y/qjRQ/xcB74g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@oxlint/binding-linux-x64-musl@1.71.0': - resolution: {integrity: sha1-C+j2veztYN4pDRGAEGDUBGicS0M=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.71.0.tgz} + resolution: {integrity: sha512-orfixdt76KlpNly9z0PkWBBNfwjKz+JFVLP/7wnVchlKNU9Dpt9InU/ZggeSej6fC7qwHmHNOGlhLnQXcYoGuA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@oxlint/binding-openharmony-arm64@1.71.0': - resolution: {integrity: sha1-VuyV4rwMdb4d5wNG4Nh1mh0x7vI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.71.0.tgz} + resolution: {integrity: sha512-9emQu2lAp6yhPB3XuI+++vR+l/o6JR1X+EpxwcumPdQXBWXEPAsquPGL7l158EqU8SebQMXTUa/S5zN98juyHw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@oxlint/binding-win32-arm64-msvc@1.71.0': - resolution: {integrity: sha1-4YfIhBlLiCL/E0ctWxLn9h1U5ns=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.71.0.tgz} + resolution: {integrity: sha512-bd5kI8spYwTm3BILDtGhi73zoup5dw8MlPQNT8YB3BD5UIsjNe3K9/4ctrzQMX4SZMoK5HgzVLkLJzacEXB7fA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@oxlint/binding-win32-ia32-msvc@1.71.0': - resolution: {integrity: sha1-okuOrBh6Qla2iTWz/baxGwTu4Mc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.71.0.tgz} + resolution: {integrity: sha512-W4HvOHGzVLHcrmFu+bMrJlho+/yrlX5ZNdJZqGe8MEldkQG+RHYhxxad9P4jvWAYFmIqUA5i9DQ8QsJqSU9GIw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] '@oxlint/binding-win32-x64-msvc@1.71.0': - resolution: {integrity: sha1-sIzKhigT+Li92u5ydE2i4mJKhDE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.71.0.tgz} + resolution: {integrity: sha512-D2kyEIPHk/G/wiZLnwTVC/sVst+T/lKldVOjAFpgTIBUAOlry72e5OiapDbDBF4LfJLkN5ypJb/8Eu6yJzkveQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] '@pagefind/darwin-arm64@1.5.2': - resolution: {integrity: sha1-llFS/8IrzNgpngZffPvGhpob/+A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/darwin-arm64/-/darwin-arm64-1.5.2.tgz} + resolution: {integrity: sha512-MXpI+7HsAdPkvJ0gk9xj9g541BCqBZOBbdwj9g6lB5LCj6kSV6nqDSjzcAJwvOsfu0fjwvC8hQU+ecfhp+MpiQ==} cpu: [arm64] os: [darwin] '@pagefind/darwin-x64@1.5.2': - resolution: {integrity: sha1-tbm0dnPK97KAiRFU4qR1q8SZ+t0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/darwin-x64/-/darwin-x64-1.5.2.tgz} + resolution: {integrity: sha512-IojxFWMEJe0RQ7PQ3KXQsPIImNsbpPYpoZ+QUDrL8fAl/O27IX+LVLs74/UzEZy5uA2LD8Nz1AiwKr72vrkZQw==} cpu: [x64] os: [darwin] @@ -5915,27 +5915,27 @@ packages: resolution: {integrity: sha512-pm1LMnQg8N2B3n2TnjKlhaFihpz6zTiA4HiGQ6/slKO/+8K9CAU5kcjdSSPgpuk1PMuuN4hxLipUIifnrkl3Sg==} '@pagefind/freebsd-x64@1.5.2': - resolution: {integrity: sha1-z24nnZOMI2hzG7ZVi/j2agyAomk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/freebsd-x64/-/freebsd-x64-1.5.2.tgz} + resolution: {integrity: sha512-7EVzo9+0w+2cbe671BtMj10UlNo83I+HrLVLfRxO731svHRJKUfJ/mo05gU14pe9PCfpKNQT8FS3Xc/oDN6pOA==} cpu: [x64] os: [freebsd] '@pagefind/linux-arm64@1.5.2': - resolution: {integrity: sha1-iyLPwaNMWQM8W9Zmdreobvug9fQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/linux-arm64/-/linux-arm64-1.5.2.tgz} + resolution: {integrity: sha512-Ovt9+K35sqzn8H3ZMXGwls4TD/wMJuvRtShHIsmUQREmaxjrDEX7gHckRCrwYJ4XE1H1p6HkLz3wukrAnsfXQw==} cpu: [arm64] os: [linux] '@pagefind/linux-x64@1.5.2': - resolution: {integrity: sha1-pzPRwKnZBTEfafiGh3HAzEKQn+Q=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/linux-x64/-/linux-x64-1.5.2.tgz} + resolution: {integrity: sha512-V+tFqHKXhQKq/WqPBD67AFy7scn1/aZID00ws4fSDd+1daSi5UHR9VVlRrOUYKxn3VuFQYRD7lYXdZK1WED1YA==} cpu: [x64] os: [linux] '@pagefind/windows-arm64@1.5.2': - resolution: {integrity: sha1-bWyzlaVhNqkrkcC9hm9/7DsLvnw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/windows-arm64/-/windows-arm64-1.5.2.tgz} + resolution: {integrity: sha512-hN9Nh90fNW61nNRCW9ZyQrAj/mD0eRvmJ8NlTUzkbuW8kIzGJUi3cxjFkEcMZ5h/8FsKWD/VcouZl4yo1F7B6g==} cpu: [arm64] os: [win32] '@pagefind/windows-x64@1.5.2': - resolution: {integrity: sha1-kx/byfAPcgV5UM0mDvll1P0CqS4=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pagefind/windows-x64/-/windows-x64-1.5.2.tgz} + resolution: {integrity: sha512-Fa2Iyw7kaDRzGMfNYNUXNW2zbL5FQVDgSOcbDHdzBrDEdpqOqg8TcZ68F22ol6NJ9IGzvUdmeyZypLW5dyhqsg==} cpu: [x64] os: [win32] @@ -5943,7 +5943,7 @@ packages: resolution: {integrity: sha512-4HDWyHC51xl3FguYJSzwda3Lr/JxjxDM9Hr62OZ4JEQ3o/bYXd3blfbvvDtTcEvi6u23qYocgFR1jQLpvIwy2A==} '@pkgjs/parseargs@0.11.0': - resolution: {integrity: sha1-p36nQvqyV3UUVDTrHSMoz1ATrDM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pkgjs/parseargs/-/parseargs-0.11.0.tgz} + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} '@playwright/browser-chromium@1.61.0': @@ -5960,7 +5960,7 @@ packages: engines: {node: '>=12.17'} '@pnpm/cafs-types@1000.1.0': - resolution: {integrity: sha1-LYnSSIJrDepfupfrv73FWeotH/0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/cafs-types/-/cafs-types-1000.1.0.tgz} + resolution: {integrity: sha512-uUAnheFdWz+rwgDSr0MO8LH0M27j/ocj+KVXlGmmaAHyMKqIMRnuQZdAciAW7/Cb29WOfmPFm+U/aRtBjysE9g==} engines: {node: '>=18.12'} '@pnpm/catalogs.config@1000.0.6': @@ -6018,7 +6018,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/core-loggers@1001.0.10': - resolution: {integrity: sha1-Ig8Ye3KKhHnVTthfLD90QX4fO9s=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/core-loggers/-/core-loggers-1001.0.10.tgz} + resolution: {integrity: sha512-02ZMWWNmHHzAxtDiB+8AfQpnpsb+UzJLpBdGznUmSd9pwgTph19yQFyFuZ3ZGGXy1EFotd1gRO92VcStP6s+DA==} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6036,7 +6036,7 @@ packages: '@pnpm/logger': ^1001.0.1 '@pnpm/create-cafs-store@1000.0.35': - resolution: {integrity: sha1-fuK1ZfAMIuchFQYftOEh5nAHHsI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/create-cafs-store/-/create-cafs-store-1000.0.35.tgz} + resolution: {integrity: sha512-X2rxUPmcwkFd8E2V0znoOJ2sMtlJISz/bjejfMQJAsnX40lOjN5DH15bJ8joyp9u8Pa69HWm1COyLwkf5Dj7Uw==} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6094,7 +6094,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/exec.pkg-requires-build@1000.0.17': - resolution: {integrity: sha1-EbMscsuxCmFWnJf99HNNkilFdIE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/exec.pkg-requires-build/-/exec.pkg-requires-build-1000.0.17.tgz} + resolution: {integrity: sha512-APWev2tWXUYqqexF3egGDlrri/vpTiqEr6KZmC9BuCqh+qmANOUyWASvnnn15ZXYrulkjbOMfHRAPy6baq6M7w==} engines: {node: '>=18.12'} '@pnpm/fetch@1001.0.0': @@ -6108,7 +6108,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/fetcher-base@1001.2.4': - resolution: {integrity: sha1-2Dkx8Dnz2zOoBJQKrQPF9aiKZ8M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/fetcher-base/-/fetcher-base-1001.2.4.tgz} + resolution: {integrity: sha512-xBdP7eZlCZIKBQ1sKLUKSl34U2QsxSQcgmiCrWhkCmfzaFi/iFCvBZTa6i7COG0X9zKeZ4t9k+iMt/BqepeIEA==} engines: {node: '>=18.12'} '@pnpm/fetching-types@1000.2.1': @@ -6126,7 +6126,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/fs.hard-link-dir@1000.0.6': - resolution: {integrity: sha1-uG1x9+tZFRKwFh/h/n0KstJ6HNk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/fs.hard-link-dir/-/fs.hard-link-dir-1000.0.6.tgz} + resolution: {integrity: sha512-8Z26HRL7YuC7jvkGMT3s5+0sJSBJ8PtldWGQ9gCPtXtjfORr7ep5V/rcTDQk6L1KzFIBuSg5NBOpxLdzJeCUCA==} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': '>=1001.0.0 <1002.0.0' @@ -6138,7 +6138,7 @@ packages: '@pnpm/logger': ^1001.0.1 '@pnpm/fs.indexed-pkg-importer@1000.1.28': - resolution: {integrity: sha1-dgPsEAmqgeodKirp6IkzjYrSQng=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/fs.indexed-pkg-importer/-/fs.indexed-pkg-importer-1000.1.28.tgz} + resolution: {integrity: sha512-mqqvSaztrCln7u6/mON7Bo5jDjHuXIkzErYJWRvDXkzedL6mSJueKsT9PEdMPJoM33+Zb94kk9xhhieuKO2O/Q==} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6171,7 +6171,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/hosted-git-info@1.0.0': - resolution: {integrity: sha1-vM42aKqpkK8QA+R+cYgZm0PBrJI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/hosted-git-info/-/hosted-git-info-1.0.0.tgz} + resolution: {integrity: sha512-QzmNiLShTnNyeTHr+cykG5hYjwph0+v49KHV36Dh8uA2rRMWw30qoZMARuxd00SYdoTwT8bIouqqmzi6TWfJHQ==} engines: {node: '>=10'} '@pnpm/lifecycle@1001.0.37': @@ -6197,7 +6197,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/logger@1001.0.1': - resolution: {integrity: sha1-hOmVA4uf4LTx45kGo+CT0htTGjM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/logger/-/logger-1001.0.1.tgz} + resolution: {integrity: sha512-gdwlAMXC4Wc0s7Dmg/4wNybMEd/4lSd9LsXQxeg/piWY0PPXjgz1IXJWnVScx6dZRaaodWP3c1ornrw8mZdFZw==} engines: {node: '>=18.12'} '@pnpm/manifest-utils@1002.0.5': @@ -6231,7 +6231,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/node-fetch@1.0.0': - resolution: {integrity: sha1-aHq+x5NCHa8TdoIlNcZxnzXDeKI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/node-fetch/-/node-fetch-1.0.0.tgz} + resolution: {integrity: sha512-eYwrzhKUBGFdq78rJStGjaHTUHA2VH+Avr//CVx/T+EJkI7hnFmOy6YghvcB2clj8HpO4V8tXRNuFNfRX08ayw==} engines: {node: ^10.17 || >=12.3} '@pnpm/node.fetcher@1001.0.27': @@ -6311,7 +6311,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/ramda@0.28.1': - resolution: {integrity: sha1-DzKrxSddWGoD4Nwd2QoAmsZo/zM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/ramda/-/ramda-0.28.1.tgz} + resolution: {integrity: sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==} '@pnpm/read-modules-dir@1000.0.0': resolution: {integrity: sha512-IEJ9Zc2DVqKy5iFu0EtwdBMTa0F5nElqh53dBv+dO+2g72dKd31CV4fMyWrjf7PIdFs0YUAknYok5wKBeMTqJw==} @@ -6350,7 +6350,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/resolver-base@1005.4.3': - resolution: {integrity: sha1-+CpbKXa828BI2LeoGA0Viz4i2Uk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/resolver-base/-/resolver-base-1005.4.3.tgz} + resolution: {integrity: sha512-c97+Njdw6nVYnPpX/K0VIJizMj667iicUqC8WzLqEx9XJVw9WPrxSrZTE+lZ9e1F0tImFY3ycub8gLevJGsDiA==} engines: {node: '>=18.12'} '@pnpm/resolving.bun-resolver@1005.0.11': @@ -6390,7 +6390,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/store-controller-types@1004.5.3': - resolution: {integrity: sha1-Cg7XyXtx9flJMURWxw+X/EiLebk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/store-controller-types/-/store-controller-types-1004.5.3.tgz} + resolution: {integrity: sha512-0II55WSiG1ALCJWbIVyRjSnM5v4sE7Sh+wCkBrn+K/eTCa2zmVNYAWOQlYSXPE3rGamju7Hrkrlfm7FMYg57LA==} engines: {node: '>=18.12'} '@pnpm/store-path@1000.0.6': @@ -6402,11 +6402,11 @@ packages: engines: {node: '>=18.12'} '@pnpm/store.cafs@1000.1.6': - resolution: {integrity: sha1-Su6m8PkX8Vp/oTLkeC8k8NzJbiw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/store.cafs/-/store.cafs-1000.1.6.tgz} + resolution: {integrity: sha512-C6F4cWBbohslWaBIXH9uSqNG9mvJXwhZx4IDXJkDCEyBlA3YOeBw63WUQJ+IIBS8blwyli0ba6IGOq5+sA8TEQ==} engines: {node: '>=18.12'} '@pnpm/symlink-dependency@1000.0.20': - resolution: {integrity: sha1-wUKA38MGFuJGMyLFeK7yCQiShAk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/symlink-dependency/-/symlink-dependency-1000.0.20.tgz} + resolution: {integrity: sha512-u7yVH6sdHNWAltbvM8YL48XS0/lT06Hf3F9L5CrfxJ44zNHFKgTCpLoaa5OM/aBKcJLNcgJLzjqDUZ8SKRwU+w==} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6435,7 +6435,7 @@ packages: engines: {node: '>=18.12'} '@pnpm/types@1001.3.1': - resolution: {integrity: sha1-MY4t+y34jBxndQK+nRcBuWXtwmA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/types/-/types-1001.3.1.tgz} + resolution: {integrity: sha512-8dvQ/12/Zko+R2+f7guZPXDMMRVgsJlCDx3HtRGd+sRaFKqn52Er7tUDCqCvdcrBbSsW+75bDt6RCmEOJ9Ewwg==} engines: {node: '>=18.12'} '@pnpm/util.lex-comparator@3.0.2': @@ -6443,12 +6443,12 @@ packages: engines: {node: '>=18.12'} '@pnpm/which@3.0.1': - resolution: {integrity: sha1-GUr9B3w1ZL7Wq28QIiWqk45qdIY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/which/-/which-3.0.1.tgz} + resolution: {integrity: sha512-4ivtS12Oni9axgGefaq+gTPD+7N0VPCFdxFH8izCaWfnxLQblX3iVxba+25ZoagStlzUs8sQg8OMKlCVhyGWTw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} hasBin: true '@pnpm/worker@1000.6.11': - resolution: {integrity: sha1-xbQtqgHqmVK9IjtiD75RMCurzGM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pnpm/worker/-/worker-1000.6.11.tgz} + resolution: {integrity: sha512-5HH0bt8adt5x+sqVsBzxeetwpzC/ThbAU82aPtS70G+jKAfO9w+KiFrR9baWfIcl39A5k47bomotTg0Jro8Evw==} engines: {node: '>=18.12'} peerDependencies: '@pnpm/logger': ^1001.0.1 @@ -6483,53 +6483,53 @@ packages: resolution: {integrity: sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==} '@reflink/reflink-darwin-arm64@0.1.19': - resolution: {integrity: sha1-b6JFFErk8ZTcvkjWSYzEA1LaasA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-darwin-arm64/-/reflink-darwin-arm64-0.1.19.tgz} + resolution: {integrity: sha512-ruy44Lpepdk1FqDz38vExBY/PVUsjxZA+chd9wozjUH9JjuDT/HEaQYA6wYN9mf041l0yLVar6BCZuWABJvHSA==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] '@reflink/reflink-darwin-x64@0.1.19': - resolution: {integrity: sha1-JECv7fMtFcXwVllCdtE8WF7vze8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-darwin-x64/-/reflink-darwin-x64-0.1.19.tgz} + resolution: {integrity: sha512-By85MSWrMZa+c26TcnAy8SDk0sTUkYlNnwknSchkhHpGXOtjNDUOxJE9oByBnGbeuIE1PiQsxDG3Ud+IVV9yuA==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] '@reflink/reflink-linux-arm64-gnu@0.1.19': - resolution: {integrity: sha1-2ch5MolavWOBAu6JFYkcavHUTHk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-arm64-gnu/-/reflink-linux-arm64-gnu-0.1.19.tgz} + resolution: {integrity: sha512-7P+er8+rP9iNeN+bfmccM4hTAaLP6PQJPKWSA4iSk2bNvo6KU6RyPgYeHxXmzNKzPVRcypZQTpFgstHam6maVg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] libc: [glibc] '@reflink/reflink-linux-arm64-musl@0.1.19': - resolution: {integrity: sha1-N0f5K2UFwxBoWAdlzpugI2LidXQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-arm64-musl/-/reflink-linux-arm64-musl-0.1.19.tgz} + resolution: {integrity: sha512-37iO/Dp6m5DDaC2sf3zPtx/hl9FV3Xze4xoYidrxxS9bgP3S8ALroxRK6xBG/1TtfXKTvolvp+IjrUU6ujIGmA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] libc: [musl] '@reflink/reflink-linux-x64-gnu@0.1.19': - resolution: {integrity: sha1-F/B/4zy85H86YkI9Y01uVzDZ8o0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-x64-gnu/-/reflink-linux-x64-gnu-0.1.19.tgz} + resolution: {integrity: sha512-jbI8jvuYCaA3MVUdu8vLoLAFqC+iNMpiSuLbxlAgg7x3K5bsS8nOpTRnkLF7vISJ+rVR8W+7ThXlXlUQ93ulkw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] libc: [glibc] '@reflink/reflink-linux-x64-musl@0.1.19': - resolution: {integrity: sha1-bn6Md29HIJu4rt2Ivvgxiif5A20=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-linux-x64-musl/-/reflink-linux-x64-musl-0.1.19.tgz} + resolution: {integrity: sha512-e9FBWDe+lv7QKAwtKOt6A2W/fyy/aEEfr0g6j/hWzvQcrzHCsz07BNQYlNOjTfeytrtLU7k449H1PI95jA4OjQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] libc: [musl] '@reflink/reflink-win32-arm64-msvc@0.1.19': - resolution: {integrity: sha1-WV+scdaeFJ4y3rDo2hHYPpnzG10=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-win32-arm64-msvc/-/reflink-win32-arm64-msvc-0.1.19.tgz} + resolution: {integrity: sha512-09PxnVIQcd+UOn4WAW73WU6PXL7DwGS6wPlkMhMg2zlHHG65F3vHepOw06HFCq+N42qkaNAc8AKIabWvtk6cIQ==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] '@reflink/reflink-win32-x64-msvc@0.1.19': - resolution: {integrity: sha1-VFo3j0Tq7SISUZFHCydrihjlAE4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@reflink/reflink-win32-x64-msvc/-/reflink-win32-x64-msvc-0.1.19.tgz} + resolution: {integrity: sha512-E//yT4ni2SyhwP8JRjVGWr3cbnhWDiPLgnQ66qqaanjjnMiu3O/2tjCPQXlcGc/DEYofpDc9fvhv6tALQsMV9w==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -6543,96 +6543,96 @@ packages: engines: {node: ^v12.20.0 || ^14.13.0 || >=16.0.0} '@rolldown/binding-android-arm64@1.0.3': - resolution: {integrity: sha1-VM6Pg4IhP0oxSgwve6g/gf/q5ZI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.3.tgz} + resolution: {integrity: sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@rolldown/binding-darwin-arm64@1.0.3': - resolution: {integrity: sha1-OI/KFWbBTADEtEb8OShjDn8Nlfw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.3.tgz} + resolution: {integrity: sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@rolldown/binding-darwin-x64@1.0.3': - resolution: {integrity: sha1-U/V94fWZ7PHbE4I8/IjBj7gJVK0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.3.tgz} + resolution: {integrity: sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@rolldown/binding-freebsd-x64@1.0.3': - resolution: {integrity: sha1-bz/dobeuqsnSaKUmgEtPuW5ONfE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.3.tgz} + resolution: {integrity: sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@rolldown/binding-linux-arm-gnueabihf@1.0.3': - resolution: {integrity: sha1-2HpFS/WFzJZ2hJN36R1uN1KXMm8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.3.tgz} + resolution: {integrity: sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@rolldown/binding-linux-arm64-gnu@1.0.3': - resolution: {integrity: sha1-QZ/Wv2Es80jxBSjLzZTrq5YH2NE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.3.tgz} + resolution: {integrity: sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.3': - resolution: {integrity: sha1-/MaRhpa7doRId+HkkwoY/Q03QGk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.3.tgz} + resolution: {integrity: sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.3': - resolution: {integrity: sha1-Mq7LfI2uXU8qjN5XoFjshpkVQvg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.3.tgz} + resolution: {integrity: sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.3': - resolution: {integrity: sha1-vtk0bqgea7i5PPEfXYi3fbiQt2M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.3.tgz} + resolution: {integrity: sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.3': - resolution: {integrity: sha1-ZMLSb3Xf/ZtaH5dVegCudyUMjLc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.3.tgz} + resolution: {integrity: sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.3': - resolution: {integrity: sha1-WkUTLopHZZ7qrztUDClUqXyGD/M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.3.tgz} + resolution: {integrity: sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.3': - resolution: {integrity: sha1-KQUTBoxV6EnchFejKv7h17Csswk=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.3.tgz} + resolution: {integrity: sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@rolldown/binding-wasm32-wasi@1.0.3': - resolution: {integrity: sha1-PZly2/GpU9PHr6pKDyDvKy458xs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.3.tgz} + resolution: {integrity: sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] '@rolldown/binding-win32-arm64-msvc@1.0.3': - resolution: {integrity: sha1-oASrYHoW1vA7y1VXKP+IivdXc60=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.3.tgz} + resolution: {integrity: sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@rolldown/binding-win32-x64-msvc@1.0.3': - resolution: {integrity: sha1-4qJbNGkaHMihIJ195wkGMCbdDNs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.3.tgz} + resolution: {integrity: sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -6666,140 +6666,140 @@ packages: optional: true '@rollup/rollup-android-arm-eabi@4.62.2': - resolution: {integrity: sha1-XphJtmHCIpz5Z6CNvi276ejJkeU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz} + resolution: {integrity: sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==} cpu: [arm] os: [android] '@rollup/rollup-android-arm64@4.62.2': - resolution: {integrity: sha1-WwaZ7l3UhLIiye10r/Q8keqLF/g=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz} + resolution: {integrity: sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==} cpu: [arm64] os: [android] '@rollup/rollup-darwin-arm64@4.62.2': - resolution: {integrity: sha1-i8UsnXo86NBTPDUanJNd54HaoG8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz} + resolution: {integrity: sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==} cpu: [arm64] os: [darwin] '@rollup/rollup-darwin-x64@4.62.2': - resolution: {integrity: sha1-ui7z6PsxDwrzVYjycM+lqpbkh2Q=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz} + resolution: {integrity: sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==} cpu: [x64] os: [darwin] '@rollup/rollup-freebsd-arm64@4.62.2': - resolution: {integrity: sha1-k7EL2/6K2iJri8DALva39URHTZY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz} + resolution: {integrity: sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==} cpu: [arm64] os: [freebsd] '@rollup/rollup-freebsd-x64@4.62.2': - resolution: {integrity: sha1-PoqjjvPJwwCUaHHj/bsMMOCiD4Y=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz} + resolution: {integrity: sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==} cpu: [x64] os: [freebsd] '@rollup/rollup-linux-arm-gnueabihf@4.62.2': - resolution: {integrity: sha1-HXmUOEuwrRvEGSG1BuFkLU+df8M=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz} + resolution: {integrity: sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==} cpu: [arm] os: [linux] libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.62.2': - resolution: {integrity: sha1-plQPR8+ESla4DKn/ldKs37LO+Xs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz} + resolution: {integrity: sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==} cpu: [arm] os: [linux] libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.62.2': - resolution: {integrity: sha1-QE8gRWUYQMv0jakbptD0kPC8LL8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz} + resolution: {integrity: sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==} cpu: [arm64] os: [linux] libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.62.2': - resolution: {integrity: sha1-o0BP/d97R0tIyZuciTtiR7t2W6U=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz} + resolution: {integrity: sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==} cpu: [arm64] os: [linux] libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.62.2': - resolution: {integrity: sha1-6KrG1Umzd5ReNJiC8Zm3yOt1yjg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz} + resolution: {integrity: sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==} cpu: [loong64] os: [linux] libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.62.2': - resolution: {integrity: sha1-bi5E6lAxCzpYIHipFeX+uHnIINQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz} + resolution: {integrity: sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==} cpu: [loong64] os: [linux] libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.62.2': - resolution: {integrity: sha1-aJgwLabXegU3zeZLK0xrYGWb0RA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz} + resolution: {integrity: sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==} cpu: [ppc64] os: [linux] libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.62.2': - resolution: {integrity: sha1-MzcXyV3Vpmvvj2Pn74qf2EX9GNA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz} + resolution: {integrity: sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==} cpu: [ppc64] os: [linux] libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.62.2': - resolution: {integrity: sha1-gbwGujgDUgBNAfSCbrfNzO+gW60=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz} + resolution: {integrity: sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==} cpu: [riscv64] os: [linux] libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.62.2': - resolution: {integrity: sha1-lafNOd4hOJrWeIpShOqqc44pykw=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz} + resolution: {integrity: sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==} cpu: [riscv64] os: [linux] libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.62.2': - resolution: {integrity: sha1-BubbLsG8SLU3THkj74PC6wJLJFI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz} + resolution: {integrity: sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==} cpu: [s390x] os: [linux] libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.62.2': - resolution: {integrity: sha1-XcgYmIKF4J6IeQxkYt73JBPfLaM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz} + resolution: {integrity: sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==} cpu: [x64] os: [linux] libc: [glibc] '@rollup/rollup-linux-x64-musl@4.62.2': - resolution: {integrity: sha1-IID0qTNJ6a/TS+b8GjfgH8i/yA8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz} + resolution: {integrity: sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==} cpu: [x64] os: [linux] libc: [musl] '@rollup/rollup-openbsd-x64@4.62.2': - resolution: {integrity: sha1-IdZKistmIhckuSPlGvUzPfGvBEs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz} + resolution: {integrity: sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==} cpu: [x64] os: [openbsd] '@rollup/rollup-openharmony-arm64@4.62.2': - resolution: {integrity: sha1-jg/NnQIUHjN7TFtc/1dsuadrG6A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz} + resolution: {integrity: sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==} cpu: [arm64] os: [openharmony] '@rollup/rollup-win32-arm64-msvc@4.62.2': - resolution: {integrity: sha1-vbTMTv1Y7+gIIDNH8PVGPw6hblI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz} + resolution: {integrity: sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==} cpu: [arm64] os: [win32] '@rollup/rollup-win32-ia32-msvc@4.62.2': - resolution: {integrity: sha1-26695a/STq4O7+kV2QFjLny1mGA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz} + resolution: {integrity: sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==} cpu: [ia32] os: [win32] '@rollup/rollup-win32-x64-gnu@4.62.2': - resolution: {integrity: sha1-hBCehf6l+PE1NJn5ZXj9wqDosTg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz} + resolution: {integrity: sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==} cpu: [x64] os: [win32] '@rollup/rollup-win32-x64-msvc@4.62.2': - resolution: {integrity: sha1-NnHOP5uSjVwB+Hl5LVwLYK4U1K0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz} + resolution: {integrity: sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==} cpu: [x64] os: [win32] @@ -6834,7 +6834,7 @@ packages: resolution: {integrity: sha512-fwI076HYknC0IrMXdY6UmjDv+PH7NHhNJX3/pY2UblSE5XrXgndXZPiOe/6ZtuFpn6DvVDVNhtkIzQ+Qu/MhVQ==} '@rushstack/worker-pool@0.4.9': - resolution: {integrity: sha1-8y70qgoP5niOorpT+LgWetIG7Bg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rushstack/worker-pool/-/worker-pool-0.4.9.tgz} + resolution: {integrity: sha512-ibAOeQCuz3g0c88GGawAPO2LVOTZE3uPh4DCEJILZS9SEv9opEUObsovC18EHPgeIuFy4HkoJT+t7l8LURZjIw==} peerDependencies: '@types/node': '*' peerDependenciesMeta: @@ -7139,37 +7139,37 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} '@turbo/darwin-64@2.9.14': - resolution: {integrity: sha1-uexqxje5xf26Xa6ddD9dEh8JEkI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/darwin-64/-/darwin-64-2.9.14.tgz} + resolution: {integrity: sha512-t7QiPflaEyBE4oayeZtSmu4mEfjgIrcNlNNl1z1dmIVPqEdtA7+CfTf8d7KXsOGPh6aNgWjKxyvQg9uGfDQF+A==} cpu: [x64] os: [darwin] '@turbo/darwin-arm64@2.9.14': - resolution: {integrity: sha1-mdGfPlmELFldKCjHKi5O9TdAjzg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/darwin-arm64/-/darwin-arm64-2.9.14.tgz} + resolution: {integrity: sha512-d23147mC9BsCPA9mJ0h/ubcpbRgcJBXbcG3+Vq7YLhjz3IXuvQsJ1UXH8f4MD76ZjJ4m/E4aRdJV+MW88CDfbw==} cpu: [arm64] os: [darwin] '@turbo/linux-64@2.9.14': - resolution: {integrity: sha1-nJB0NPCRzXVSn1SWUW95txk10rs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/linux-64/-/linux-64-2.9.14.tgz} + resolution: {integrity: sha512-P3ZKB5tuUDdDQWuAsACGUR1qv9W7BNWxdxqVJ0kZNuNNPRaVYTPPikLcp79+GiEcW3npsR+KyP38lnQiBc5aSA==} cpu: [x64] os: [linux] '@turbo/linux-arm64@2.9.14': - resolution: {integrity: sha1-ea6QYObung+3hK4HR+mA9YLnUxM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/linux-arm64/-/linux-arm64-2.9.14.tgz} + resolution: {integrity: sha512-ZRTlzcUMrrPv9ZuDzRF9n60Ym13bKeG9jDB8WjxyLhWNzV+AJQN+zdpIk3NJYf2zQsGUm1mNar2P0elRzLw25g==} cpu: [arm64] os: [linux] '@turbo/windows-64@2.9.14': - resolution: {integrity: sha1-aKgPKZ81GJMUGEyIMByq2YLRwMI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/windows-64/-/windows-64-2.9.14.tgz} + resolution: {integrity: sha512-exanwN6sIduZwykYeiTQj8kCmOhazP5WOz3bvXMcYtjhL6Z3iRWLewKrXCBq0bqwSP3iBMb/AerRCnHI4lx46A==} cpu: [x64] os: [win32] '@turbo/windows-arm64@2.9.14': - resolution: {integrity: sha1-TcFmhPDdzlP6/latj1UgXERz0Xo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@turbo/windows-arm64/-/windows-arm64-2.9.14.tgz} + resolution: {integrity: sha512-fVdCsnmYoKICsycbWuuGp6Jvi51/3G/UluFWuAUCvR8PIW5IJkAk5BM9UF8PSm0Q2IphWHFZjYEgjHsh3B9y/g==} cpu: [arm64] os: [win32] '@tybys/wasm-util@0.10.2': - resolution: {integrity: sha1-ErOhsz2x+crU3f8fYEq33QC/Rk4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@tybys/wasm-util/-/wasm-util-0.10.2.tgz} + resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} '@types/argparse@1.0.38': resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} @@ -7322,7 +7322,7 @@ packages: resolution: {integrity: sha512-cMQm7pxu6BxtHyqJ7mQZ2kXWV5SLmugybFdHCBbJ5eHzOo6VhBckEgAT3//rP5FwPHNPeEiq4SmQ5ucBwsOo4Q==} '@types/esrecurse@4.3.1': - resolution: {integrity: sha1-b2Nq+WL75hkbgwvWdrpZhpJrzOw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/esrecurse/-/esrecurse-4.3.1.tgz} + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -7355,7 +7355,7 @@ packages: resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} '@types/json-schema@7.0.15': - resolution: {integrity: sha1-WWoXRyM2lNUPatinhp/Lb1bPWEE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/json-schema/-/json-schema-7.0.15.tgz} + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} '@types/keyv@3.1.4': resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} @@ -7453,7 +7453,7 @@ packages: resolution: {integrity: sha512-hx0o7zWEUU4R2Amn+pjCBQQt23Khy/Dk56gQU5xi5jtPL1h83ACJCeFaB2M/+WO1AntvWrSoVnnCAfI1AQH4Cg==} '@types/trusted-types@2.0.7': - resolution: {integrity: sha1-usywepcLkXB986PoumiWxX6tLRE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/trusted-types/-/trusted-types-2.0.7.tgz} + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} @@ -7480,7 +7480,7 @@ packages: resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} '@types/yoga-layout@1.9.2': - resolution: {integrity: sha1-76+emRpzkNwIGgtnkYWXmoOpY5o=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/yoga-layout/-/yoga-layout-1.9.2.tgz} + resolution: {integrity: sha512-S9q47ByT2pPvD65IvrWp7qppVMpk9WGMbVq9wbWZOHg6tnXSD4vyhao6nOSBwwfDdV2p3Kx9evA9vI+XWTfDvw==} '@typespec/ts-http-runtime@0.3.6': resolution: {integrity: sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og==} @@ -7606,47 +7606,47 @@ packages: hasBin: true '@vscode/vsce-sign-alpine-arm64@2.0.6': - resolution: {integrity: sha1-LNJEyvXo7FQ/QvuR1N87kzZByPo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.6.tgz} + resolution: {integrity: sha512-wKkJBsvKF+f0GfsUuGT0tSW0kZL87QggEiqNqK6/8hvqsXvpx8OsTEc3mnE1kejkh5r+qUyQ7PtF8jZYN0mo8Q==} cpu: [arm64] os: [alpine] '@vscode/vsce-sign-alpine-x64@2.0.6': - resolution: {integrity: sha1-sOgKR5IAHGbif+7iwR6CGtH6FoA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.6.tgz} + resolution: {integrity: sha512-YoAGlmdK39vKi9jA18i4ufBbd95OqGJxRvF3n6ZbCyziwy3O+JgOpIUPxv5tjeO6gQfx29qBivQ8ZZTUF2Ba0w==} cpu: [x64] os: [alpine] '@vscode/vsce-sign-darwin-arm64@2.0.6': - resolution: {integrity: sha1-S4+hq1XygKmZhb48BvtzDleBDM4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.6.tgz} + resolution: {integrity: sha512-5HMHaJRIQuozm/XQIiJiA0W9uhdblwwl2ZNDSSAeXGO9YhB9MH5C4KIHOmvyjUnKy4UCuiP43VKpIxW1VWP4tQ==} cpu: [arm64] os: [darwin] '@vscode/vsce-sign-darwin-x64@2.0.6': - resolution: {integrity: sha1-0skYbZUFSYJyy93YODuwOOvPWCA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.6.tgz} + resolution: {integrity: sha512-25GsUbTAiNfHSuRItoQafXOIpxlYj+IXb4/qarrXu7kmbH94jlm5sdWSCKrrREs8+GsXF1b+l3OB7VJy5jsykw==} cpu: [x64] os: [darwin] '@vscode/vsce-sign-linux-arm64@2.0.6': - resolution: {integrity: sha1-s9hWAUQEC5INjG7dQ3QxS1glVIE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.6.tgz} + resolution: {integrity: sha512-cfb1qK7lygtMa4NUl2582nP7aliLYuDEVpAbXJMkDq1qE+olIw/es+C8j1LJwvcRq1I2yWGtSn3EkDp9Dq5FdA==} cpu: [arm64] os: [linux] '@vscode/vsce-sign-linux-arm@2.0.6': - resolution: {integrity: sha1-CifEKkrbN+lu7HjNe/o4jNTp++8=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.6.tgz} + resolution: {integrity: sha512-UndEc2Xlq4HsuMPnwu7420uqceXjs4yb5W8E2/UkaHBB9OWCwMd3/bRe/1eLe3D8kPpxzcaeTyXiK3RdzS/1CA==} cpu: [arm] os: [linux] '@vscode/vsce-sign-linux-x64@2.0.6': - resolution: {integrity: sha1-reEcru7VJPwWvWxDykmuoAKV3ow=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.6.tgz} + resolution: {integrity: sha512-/olerl1A4sOqdP+hjvJ1sbQjKN07Y3DVnxO4gnbn/ahtQvFrdhUi0G1VsZXDNjfqmXw57DmPi5ASnj/8PGZhAA==} cpu: [x64] os: [linux] '@vscode/vsce-sign-win32-arm64@2.0.6': - resolution: {integrity: sha1-BoiWgUjgPrOSR5yEkcclBnIb7/w=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.6.tgz} + resolution: {integrity: sha512-ivM/MiGIY0PJNZBoGtlRBM/xDpwbdlCWomUWuLmIxbi1Cxe/1nooYrEQoaHD8ojVRgzdQEUzMsRbyF5cJJgYOg==} cpu: [arm64] os: [win32] '@vscode/vsce-sign-win32-x64@2.0.6': - resolution: {integrity: sha1-dEMO/0HSaBjCP5gmsEXYx1cy6us=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.6.tgz} + resolution: {integrity: sha512-mgth9Kvze+u8CruYMmhHw6Zgy3GRX2S+Ed5oSokDEK5vPEwGGKnmuXua9tmFhomeAnhgJnL4DCna3TiNuGrBTQ==} cpu: [x64] os: [win32] @@ -7672,7 +7672,7 @@ packages: engines: {node: '>=14.6'} '@yarnpkg/cli@4.17.0': - resolution: {integrity: sha1-ctHGq++az12AQWtbp4c2eD/3w40=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/cli/-/cli-4.17.0.tgz} + resolution: {integrity: sha512-wSa5ljTrkGF4wJEAYWwZYdg0A0TA35/BRQwpLviFGQ98gRiX6Qzt9t8XLQmyT69laffuJHeeiIeGFKqjY7p8Fg==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.9.0 @@ -7682,7 +7682,7 @@ packages: engines: {node: '>=18.12.0'} '@yarnpkg/extensions@2.0.6': - resolution: {integrity: sha1-2bm3gIPFcna1N16iEa8uB8P1a30=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/extensions/-/extensions-2.0.6.tgz} + resolution: {integrity: sha512-3LciOqpKIuoc9MmYoX3k+NmCdcrvw7HqZT4N/AW3sYkujxfbFA9Ml01JNqu4InzdV9V9NcyFkAKAorCjhY8w6Q==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 @@ -7692,7 +7692,7 @@ packages: engines: {node: '>=18.12.0'} '@yarnpkg/libui@3.1.0': - resolution: {integrity: sha1-B/7NVUqmbf18DMdjkTV1eTucHvI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/libui/-/libui-3.1.0.tgz} + resolution: {integrity: sha512-3R5juEPlnokseN+m19vh8pGmLOdWiU+q5oRLSJDGzpezKiGKiF7R2cZpOJi3A3tal/EFezmPwuHu00YWzfU4Bg==} engines: {node: '>=18.12.0'} peerDependencies: ink: ^3.0.8 @@ -7713,35 +7713,35 @@ packages: engines: {node: '>=18.12.0'} '@yarnpkg/plugin-catalog@1.0.2': - resolution: {integrity: sha1-sfydPw1zih1ptfmFs570f+p4zzI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-catalog/-/plugin-catalog-1.0.2.tgz} + resolution: {integrity: sha512-Oz4pOtcAzU9pQHCMhHll3Supr5wOKhNubV0S1hXVbkevro5ZAqf9/L3XlhSMJAvi+9neXoNFwk12j69qTUHPSg==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.5.0 '@yarnpkg/plugin-pack': ^4.0.4 '@yarnpkg/plugin-compat@4.0.12': - resolution: {integrity: sha1-pGARGVfIi9wKb2vxh7bvpfkcWDU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-compat/-/plugin-compat-4.0.12.tgz} + resolution: {integrity: sha512-c8yEzdKSWcjWUc/lAJ08MI1EmpV4RgJYfd4yEs9iMeuwiF7v0hQPIOsXG75r7O2hzeTXqWB32aXSQU+tt1CV5Q==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-patch': ^4.0.3 '@yarnpkg/plugin-constraints@4.0.5': - resolution: {integrity: sha1-yNyWdZB2o0/wxAA3nVzDh4QKxt4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-constraints/-/plugin-constraints-4.0.5.tgz} + resolution: {integrity: sha512-36i2sOYHkINIMvY2fuDFi37jgzfRD+Qk1blUK1FIo9uET/cSXi0QNLW9ZfyBBwIaKC/NAIkx2oLI6YtaqcT+9w==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.3 '@yarnpkg/core': ^4.4.3 '@yarnpkg/plugin-dlx@4.0.2': - resolution: {integrity: sha1-tVnZCvwX47h9EWVstCgHMgihzyk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-dlx/-/plugin-dlx-4.0.2.tgz} + resolution: {integrity: sha512-d6bAh54j74xbVyOZQ72Hf4ggsW4SmUayzhUeutJNZyc4CkLrqMXSIfkmnWk4BXnjwXsdDAdmqRZpPlKw8Rgb+Q==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.2 '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-essentials@4.6.1': - resolution: {integrity: sha1-skISwTcZxnGXjYFUR1ztFh4qDFM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-essentials/-/plugin-essentials-4.6.1.tgz} + resolution: {integrity: sha512-18oGqcA7aWM95B5aXbJhXa1cDi52lBpwY7ZGs9sb8D1XpoadmZEwTg98xASmeYTtrboYHCsobMhFQiZq/iK1dA==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.17.0 @@ -7749,45 +7749,45 @@ packages: '@yarnpkg/plugin-git': ^3.2.0 '@yarnpkg/plugin-exec@3.1.0': - resolution: {integrity: sha1-EQZYc8qXNf2CsspYOtn0mWhDaqU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-exec/-/plugin-exec-3.1.0.tgz} + resolution: {integrity: sha512-c0PInm8BbyNwGorVJPZyvt2L03OsccLdtmuwtl4sCxSYQjrJ3fwKVhOstL9KaxpUBQ+I9tVzoJzzpe8SzySZ0A==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.7.0 '@yarnpkg/plugin-file@3.0.2': - resolution: {integrity: sha1-08zADstYTIcE3FxmGTejziOiKjU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-file/-/plugin-file-3.0.2.tgz} + resolution: {integrity: sha512-sL47+nbBs5yC2MQS8ihKm1PzeVLPuZihWQRw0UCu1+2H5qgHV8hA/4kCvMSx98amksq4UjP8ybeBFrRvsdhAHA==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-git@3.2.0': - resolution: {integrity: sha1-wuAHvEfeG8B9r4qh1O3nc1XXUTU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-git/-/plugin-git-3.2.0.tgz} + resolution: {integrity: sha512-i/+3fJ7UYqAwmnfKYEc6Yrs9Y2mDVeCIWGXSpyQSZXokDYG0+YSf0ZSqlij4sFs5zSEOCkY0pK3wj6d4NcvhkQ==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.7.0 '@yarnpkg/plugin-github@3.0.2': - resolution: {integrity: sha1-1LxamAaYaqys6ZOdwYPfG+LdcuQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-github/-/plugin-github-3.0.2.tgz} + resolution: {integrity: sha512-NHEaxJkzBC59Z97I30fleJlm6jE7CVY7cXaDD+kYwzIp/qKCb7IaJBp3MqUhCRyvyerNYRf08nIO+PXJ9odMtg==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-git': ^3.1.2 '@yarnpkg/plugin-http@3.0.3': - resolution: {integrity: sha1-ioTHkMiBd68sCoB0yceDCgpQixA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-http/-/plugin-http-3.0.3.tgz} + resolution: {integrity: sha512-IWPKbm34ZAQZO9JO6mmyRJwLofhbrzXd8LJ3kJ943IRgyKN1kCMuPbGNaL1XQqdXlSuxlxwf0UJM2iNjmkcEcQ==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-init@4.1.2': - resolution: {integrity: sha1-Qd29EIGUt0rvs5mQ3z2m2TrXf2U=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-init/-/plugin-init-4.1.2.tgz} + resolution: {integrity: sha512-xh1ll6o9h02L4uTAveIxqgfXZ71Qr1PoFaqT372zxPwyPyZxVVUxZFcIVzAqolQ6G4Ech2ygMAT6wqtpyS7R7Q==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.2 '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-interactive-tools@4.1.0': - resolution: {integrity: sha1-nmjtWCQnUX1IHmvFHGqxKh0CWSk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-interactive-tools/-/plugin-interactive-tools-4.1.0.tgz} + resolution: {integrity: sha512-C/gIsjj+q7ekx5KyEBSQyydTGWggVenaw2gIpbkGKi56Gd9p3HfNdH5/Gp8aa93QZA+DEzy1t25ssxgX4+U6bg==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.13.0 @@ -7795,13 +7795,13 @@ packages: '@yarnpkg/plugin-essentials': ^4.4.5 '@yarnpkg/plugin-jsr@1.1.1': - resolution: {integrity: sha1-man6uEC9j3l2sQ0RTzKE4YEl4kQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-jsr/-/plugin-jsr-1.1.1.tgz} + resolution: {integrity: sha512-aukUcLl6FiOg04GXagVfT7wtkl7/qQlRQmECHyk+r5mt+gBWQX8H8lE4Nxmy0t3J4DX/aW5BTFRifTlQkF8nNQ==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-link@3.0.2': - resolution: {integrity: sha1-nYat2D1IFw0U86wJIZUU6TzMSWc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-link/-/plugin-link-3.0.2.tgz} + resolution: {integrity: sha512-cKRinNuxbNhEJLRWCDc0T1VkXqdOXhjakjcClaoCwyCrZnX+CQdK8bbYEhWzTVKPZIqffdMHd9/rIljGbBwcew==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/core': ^4.4.2 @@ -7814,7 +7814,7 @@ packages: '@yarnpkg/core': ^4.9.0 '@yarnpkg/plugin-npm-cli@4.5.0': - resolution: {integrity: sha1-mSji8kPkfm5p8ByzLlta0/+X6YU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-npm-cli/-/plugin-npm-cli-4.5.0.tgz} + resolution: {integrity: sha512-mzREwl06NeTZL5Zvf4VBGzfxPAhY3Y8UUBdR4Ob5tAxSvc0rEDXXCcO35LQ2TA6655L5n1fjlkQZGPyiiic+og==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.16.0 @@ -7830,14 +7830,14 @@ packages: '@yarnpkg/plugin-pack': ^4.0.4 '@yarnpkg/plugin-pack@4.0.4': - resolution: {integrity: sha1-SXIG9izYMXJblN+z6AUCBS5pIwE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-pack/-/plugin-pack-4.0.4.tgz} + resolution: {integrity: sha512-P+lLCMUsvAr8AXWzrgPYqUtZsBl7nhv7zM/x6jV06czyEcApRKWWJw42ekiFa6+xBlwU4ddvHZK4eWKYf27TIw==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.10.1 '@yarnpkg/core': ^4.4.4 '@yarnpkg/plugin-patch@4.0.4': - resolution: {integrity: sha1-Y6KhgRfNEpN7jGElE8RNzblt1vI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-patch/-/plugin-patch-4.0.4.tgz} + resolution: {integrity: sha512-kUh3A21WpiEG7dmKJ2/BF7AmCt2loTHLfkhng0MPFqg7JDyL35jT3POjtCEgDa/WA1c6u077GLp2GSI/zgdtIQ==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.15.0 @@ -7851,7 +7851,7 @@ packages: '@yarnpkg/core': ^4.9.0 '@yarnpkg/plugin-pnpm@2.3.0': - resolution: {integrity: sha1-WCIRlulusKrsIemY6bJZgDrMNbA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-pnpm/-/plugin-pnpm-2.3.0.tgz} + resolution: {integrity: sha512-vCl7Pca9wXDQC5kUxhxAvIJn63MMOkhkr+XHtBwMshbyQBMMkH9yfjeuZ89K+rbEO9rWnvTgoP8z+7DXfjN3oA==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.17.0 @@ -7865,7 +7865,7 @@ packages: '@yarnpkg/core': ^4.4.2 '@yarnpkg/plugin-typescript@4.1.3': - resolution: {integrity: sha1-SOQHCf/WuKffNrIfu+jw6kJL5RU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-typescript/-/plugin-typescript-4.1.3.tgz} + resolution: {integrity: sha512-szgbkWvtCm7pw9IUFNTeM5bgU5XLayDZFln0iPwGcWtfxXcGGpDcxGqDxnSMdHhrojSTtItb502xw8DVJRywJw==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.2 @@ -7873,7 +7873,7 @@ packages: '@yarnpkg/plugin-essentials': ^4.4.1 '@yarnpkg/plugin-version@4.2.0': - resolution: {integrity: sha1-BlIydkIRYEFxPmQyC55jbLzLg7M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-version/-/plugin-version-4.2.0.tgz} + resolution: {integrity: sha512-vE4NTsoe7lmmECrrqSF1/WkwYpYbAF4JbZY7cCqHVwIfvDHGpX3Y1cla+8FwGcvCU2XEKvSi55iMk59h9NN6fg==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.9.4 @@ -7881,7 +7881,7 @@ packages: '@yarnpkg/plugin-git': ^3.1.3 '@yarnpkg/plugin-workspace-tools@4.1.7': - resolution: {integrity: sha1-5LPmjQQqdFwWBZLzbUdpdnHDukQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@yarnpkg/plugin-workspace-tools/-/plugin-workspace-tools-4.1.7.tgz} + resolution: {integrity: sha512-uVf0+73H6BPmSOVdB/9ueBiyKQy4Li1ztVLIrdGc9ogQW+KOOjQDiWZKNRosKwL/70hKxAt534K6EqQtjSpuqA==} engines: {node: '>=18.12.0'} peerDependencies: '@yarnpkg/cli': ^4.13.0 @@ -7903,7 +7903,7 @@ packages: hasBin: true '@zkochan/boxen@5.1.2': - resolution: {integrity: sha1-pPIZGyPcYrcQZqJhMBQeDypZVu4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@zkochan/boxen/-/boxen-5.1.2.tgz} + resolution: {integrity: sha512-MRUN24GOMTa14zkZ4Jd1BPmlagbk10+C6gegE5FgxzTVqiYMcm3KD+2qJs6OmlpEhqUKmm4pu/oTdn0KcMqbXg==} engines: {node: '>=10'} '@zkochan/cmd-shim@5.4.1': @@ -7926,7 +7926,7 @@ packages: engines: {node: '>=18.12'} '@zkochan/which@2.0.3': - resolution: {integrity: sha1-okOQNZOQ04wVH6YHgbNiC8WhMtA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@zkochan/which/-/which-2.0.3.tgz} + resolution: {integrity: sha512-C1ReN7vt2/2O0fyTsx5xnbQuxBrmG5NMSbcIkPKCCfCTJgpZBsuRYzFXHj3nVq8vTfK7vxHUmzfCpSHgO7j4rg==} engines: {node: '>= 8'} hasBin: true @@ -7996,7 +7996,7 @@ packages: optional: true ajv@6.15.0: - resolution: {integrity: sha1-B+mCx0YmFnqnoklcU4F4ktcTlJI=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ajv/-/ajv-6.15.0.tgz} + resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} ajv@8.18.0: resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} @@ -8005,14 +8005,14 @@ packages: resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} algoliasearch@4.27.0: - resolution: {integrity: sha1-zE/P+3kBPdFLGC9jshgtWasesFA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/algoliasearch/-/algoliasearch-4.27.0.tgz} + resolution: {integrity: sha512-C88C5grLa5VOCp9eYZJt+q99ik7yNdm92l7Q9+4XK0Md8kL05Lg8l2v9ZVX0uMW3mH9pAFxMMXlLOvqNumA4lw==} am-i-vibing@0.3.0: resolution: {integrity: sha512-JTg9e3qPmVP6x8PG9/J4+eCVP6sGx9oS1pSbgf7fpPVlkHzQdRPSNMb6dBlp9BrdBNxDkctMzehPVYSnt16k4w==} hasBin: true ansi-align@3.0.1: - resolution: {integrity: sha1-DN8S4RGs53OobpofrRIlxDyxmlk=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ansi-align/-/ansi-align-3.0.1.tgz} + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} @@ -8022,7 +8022,7 @@ packages: resolution: {integrity: sha512-BIXwHKpjzghBjcwEV10Y4b17tjHfK4nhEqK3LqyQ3JgcMcjmi3DIevozNgrOpfvBMmrq9dfvrPJSu5/5vNUBQg==} ansi-escapes@4.3.2: - resolution: {integrity: sha1-ayKR0dt9mLZSHV8e+kLQ86n+tl4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ansi-escapes/-/ansi-escapes-4.3.2.tgz} + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} ansi-escapes@7.3.0: @@ -8150,7 +8150,7 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} auto-bind@4.0.0: - resolution: {integrity: sha1-41ifxsLaj3ykO6n4T6UqdE/Jl/s=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/auto-bind/-/auto-bind-4.0.0.tgz} + resolution: {integrity: sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==} engines: {node: '>=8'} axobject-query@4.1.0: @@ -8192,7 +8192,7 @@ packages: optional: true bare-fs@4.7.2: - resolution: {integrity: sha1-D1mzF+W9vsahSJtRmgaiA80/4DU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bare-fs/-/bare-fs-4.7.2.tgz} + resolution: {integrity: sha512-aTvMFUWkBmjzKtEQMDGGDNF8bkfpD5N1b/FCwt7A3wrU4t1o/e/85Wzkluh6JlODCjqVESYCkQCdTXqZ9G7VFg==} engines: {bare: '>=1.16.0'} peerDependencies: bare-buffer: '*' @@ -8205,7 +8205,7 @@ packages: engines: {bare: '>=1.14.0'} bare-path@3.0.1: - resolution: {integrity: sha1-wSyBtSeTa2UOh8XQAmTVnvRYCCw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bare-path/-/bare-path-3.0.1.tgz} + resolution: {integrity: sha512-ghj2DSK/2e99a1anTVPCV4m4YIYtrbXhfM7V3D7XZLOTsybnYyaJloymGqssQc8l/or0UoDyRtNQkmkEF/ysgQ==} bare-stream@2.13.3: resolution: {integrity: sha512-Kc+brLqvEqGkjyfiwJmImAOqLZL7OsoLKuavx+hJjgVV3nLTOjloJyPMFxjUPerGGHrNH0fLU06jjykMLWrERQ==} @@ -8265,7 +8265,7 @@ packages: engines: {node: '>=18'} bole@5.0.29: - resolution: {integrity: sha1-W+filLqotowCf0h0qqEEpyD68Aw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bole/-/bole-5.0.29.tgz} + resolution: {integrity: sha512-eYR9i2ubLv5/4TFGyZsQ1cVH4jF9+qLJA72Aow+E7ZZQfqHqQNUZeX3w+pVWF76PQyjl5eDKf2xylyOOX76ozA==} boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -8412,7 +8412,7 @@ packages: engines: {node: '>=4'} chalk@3.0.0: - resolution: {integrity: sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/chalk/-/chalk-3.0.0.tgz} + resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} chalk@4.1.2: @@ -8472,7 +8472,7 @@ packages: engines: {node: '>=18'} ci-info@2.0.0: - resolution: {integrity: sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ci-info/-/ci-info-2.0.0.tgz} + resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} @@ -8487,7 +8487,7 @@ packages: engines: {node: '>=6'} cli-boxes@2.2.1: - resolution: {integrity: sha1-3dUDXSUJT84iDpyrQKRYQKRAMY8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/cli-boxes/-/cli-boxes-2.2.1.tgz} + resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} engines: {node: '>=6'} cli-columns@4.0.0: @@ -8495,7 +8495,7 @@ packages: engines: {node: '>= 10'} cli-cursor@3.1.0: - resolution: {integrity: sha1-JkMFp65JDR0Dvwybp8kl0XU68wc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/cli-cursor/-/cli-cursor-3.1.0.tgz} + resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} cli-cursor@5.0.0: @@ -8563,7 +8563,7 @@ packages: engines: {node: '>=16'} code-excerpt@3.0.0: - resolution: {integrity: sha1-/PtnSMA9uoQxwZ9UdHR/rT8lDxA=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/code-excerpt/-/code-excerpt-3.0.0.tgz} + resolution: {integrity: sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw==} engines: {node: '>=10'} collapse-white-space@2.1.0: @@ -8676,7 +8676,7 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} convert-to-spaces@1.0.2: - resolution: {integrity: sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz} + resolution: {integrity: sha512-cj09EBuObp9gZNQCzc7hByQyrs6jVGE+o9kSJmeUoj+GiPiJvi5LYqEH/Hmme4+MTLHM+Ejtq+FChpjjEnsPdQ==} engines: {node: '>= 4'} cookie-es@1.2.3: @@ -8965,7 +8965,7 @@ packages: resolution: {integrity: sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==} data-uri-to-buffer@3.0.1: - resolution: {integrity: sha1-WUuJc5OMW8LDMEZTV4U0GrxPNjY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz} + resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} engines: {node: '>= 6'} data-urls@5.0.0: @@ -9029,7 +9029,7 @@ packages: engines: {node: '>=4.0.0'} deep-is@0.1.4: - resolution: {integrity: sha1-pvLc5hL63S7x9Rm3NVHxfoUZmDE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/deep-is/-/deep-is-0.1.4.tgz} + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} default-browser-id@5.0.1: resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} @@ -9226,7 +9226,7 @@ packages: resolution: {integrity: sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==} encoding@0.1.13: - resolution: {integrity: sha1-VldK/deR9UqOmyeFwFgqLSYhD6k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/encoding/-/encoding-0.1.13.tgz} + resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} end-of-stream@1.4.5: resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} @@ -9319,7 +9319,7 @@ packages: engines: {node: '>=0.8.0'} escape-string-regexp@2.0.0: - resolution: {integrity: sha1-owME6Z2qMuI7L9IPUbq9B8/8o0Q=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz} + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} escape-string-regexp@4.0.0: @@ -9335,19 +9335,19 @@ packages: engines: {node: ^10.12.0 || >=12.0.0} eslint-scope@9.1.2: - resolution: {integrity: sha1-ud5qzi+rHP8k0uWNhbdMj86jmAI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint-scope/-/eslint-scope-9.1.2.tgz} + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint-visitor-keys@3.4.3: - resolution: {integrity: sha1-DNcv6FUOPC6uFWqWpN3c0cisWAA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz} + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} eslint-visitor-keys@5.0.1: - resolution: {integrity: sha1-njyUiWl4JNLUzjqK0SYo+R6fWb4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz} + resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint@10.5.0: - resolution: {integrity: sha1-X8pp1rQf5+ALoi1BALLkTv5DmtU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/eslint/-/eslint-10.5.0.tgz} + resolution: {integrity: sha512-1y+7C+vi12bUK1IpZeaV3gsH9fHLBmPvYmPx42pvT/E9yG0IC8g3PUZZgp0+JLJl7ZDK0flc2gc+Aw9dpCvIsQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} hasBin: true peerDependencies: @@ -9357,7 +9357,7 @@ packages: optional: true espree@11.2.0: - resolution: {integrity: sha1-AdXkfcMyqrowWQCDYkVKjMNMyqU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/espree/-/espree-11.2.0.tgz} + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} esprima@4.0.1: @@ -9366,15 +9366,15 @@ packages: hasBin: true esquery@1.7.0: - resolution: {integrity: sha1-CNBI8mHw3e21uulfRoCUY9nJSW0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/esquery/-/esquery-1.7.0.tgz} + resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} engines: {node: '>=0.10'} esrecurse@4.3.0: - resolution: {integrity: sha1-eteWTWeauyi+5yzsY3WLHF0smSE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/esrecurse/-/esrecurse-4.3.0.tgz} + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} estraverse@5.3.0: - resolution: {integrity: sha1-LupSkHAvJquP5TcDcP+GyWXSESM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/estraverse/-/estraverse-5.3.0.tgz} + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} estree-util-attach-comments@3.0.0: @@ -9427,7 +9427,7 @@ packages: engines: {node: '>=0.8.x'} execa@5.1.1: - resolution: {integrity: sha1-+ArZy/Qpj3vR1MlVXCHpN0HEEd0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/execa/-/execa-5.1.1.tgz} + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} execa@9.6.1: @@ -9480,10 +9480,10 @@ packages: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} fast-levenshtein@2.0.6: - resolution: {integrity: sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz} + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} fast-safe-stringify@2.1.1: - resolution: {integrity: sha1-xAaoO25w2eNc47MKgRQd8wrrqIQ=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz} + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} fast-string-truncated-width@3.0.3: resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} @@ -9517,7 +9517,7 @@ packages: optional: true fetch-blob@2.1.2: - resolution: {integrity: sha1-p4BdsTYb1Ewe9iu1f7X+jqFz7zw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fetch-blob/-/fetch-blob-2.1.2.tgz} + resolution: {integrity: sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow==} engines: {node: ^10.17.0 || >=12.3.0} peerDependencies: domexception: '*' @@ -9533,7 +9533,7 @@ packages: engines: {node: '>=18'} file-entry-cache@8.0.0: - resolution: {integrity: sha1-d4e93PETG/+5JjbGlFe7wO3W2B8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/file-entry-cache/-/file-entry-cache-8.0.0.tgz} + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} fill-range@7.1.1: @@ -9568,7 +9568,7 @@ packages: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} flat-cache@4.0.1: - resolution: {integrity: sha1-Ds45/LFO4BL0sEEL0z3ZwfAREnw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/flat-cache/-/flat-cache-4.0.1.tgz} + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} flatted@3.4.2: @@ -9632,12 +9632,12 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} fsevents@2.3.2: - resolution: {integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fsevents/-/fsevents-2.3.2.tgz} + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] fsevents@2.3.3: - resolution: {integrity: sha1-ysZAd4XQNnWipeGlMFxpezR9kNY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fsevents/-/fsevents-2.3.3.tgz} + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -9680,7 +9680,7 @@ packages: engines: {node: '>=8'} get-stream@6.0.1: - resolution: {integrity: sha1-omLY7vZ6ztV8KFKtYWdSakPL97c=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/get-stream/-/get-stream-6.0.1.tgz} + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} get-stream@9.0.1: @@ -9692,10 +9692,10 @@ packages: engines: {node: '>=20.20.0'} git-up@7.0.0: - resolution: {integrity: sha1-us4weG429W6jQbb2mt/YMoYzdGc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/git-up/-/git-up-7.0.0.tgz} + resolution: {integrity: sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==} git-url-parse@13.1.1: - resolution: {integrity: sha1-Zkvd8IV8anWzwfCuYjmrsIoUhtQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/git-url-parse/-/git-url-parse-13.1.1.tgz} + resolution: {integrity: sha512-PCFJyeSSdtnbfhSNRw9Wk96dDCNx+sogTe4YNXeXSJxt7xz5hvXekuRn9JX7m+Mf4OscCu8h+mtAl3+h5Fo8lQ==} github-from-package@0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} @@ -9708,7 +9708,7 @@ packages: engines: {node: '>= 6'} glob-parent@6.0.2: - resolution: {integrity: sha1-bSN9mQg5UMeSkPJMdkKj3poo+eM=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/glob-parent/-/glob-parent-6.0.2.tgz} + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} glob@10.5.0: @@ -9734,7 +9734,7 @@ packages: engines: {node: '>=20'} globalyzer@0.1.0: - resolution: {integrity: sha1-y3baeVVWaaFRnVqO3wk6+qC/FGU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/globalyzer/-/globalyzer-0.1.0.tgz} + resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} @@ -9749,7 +9749,7 @@ packages: engines: {node: '>=20'} globrex@0.1.2: - resolution: {integrity: sha1-3V2eyCYjJzDNZ5Ol4zqTApheYJg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/globrex/-/globrex-0.1.2.tgz} + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} @@ -9968,7 +9968,7 @@ packages: engines: {node: '>= 14'} human-signals@2.1.0: - resolution: {integrity: sha1-3JH8ukLk0G5Kuu0zs+ejwC9RTqA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/human-signals/-/human-signals-2.1.0.tgz} + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} human-signals@8.0.1: @@ -10040,7 +10040,7 @@ packages: engines: {node: '>=18'} individual@3.0.0: - resolution: {integrity: sha1-58pPhfiVewGHNPKFdQ3CLsL5hi0=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/individual/-/individual-3.0.0.tgz} + resolution: {integrity: sha512-rUY5vtT748NMRbEMrTNiFfy29BgGZwGXUi2NFUVMWQrogSLzlJvQV9eeMWi+g1aVaQ53tpyLAQtd5x/JH0Nh1g==} inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} @@ -10064,14 +10064,14 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} ink-text-input@4.0.3: - resolution: {integrity: sha1-Y0j++ULnSwakZfmIUXBlFqHivo0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ink-text-input/-/ink-text-input-4.0.3.tgz} + resolution: {integrity: sha512-eQD01ik9ltmNoHmkeQ2t8LszYkv2XwuPSUz3ie/85qer6Ll/j0QSlSaLNl6ENHZakBHdCBVZY04iOXcLLXA0PQ==} engines: {node: '>=10'} peerDependencies: ink: ^3.0.0-3 react: ^16.5.2 || ^17.0.0 ink@3.2.0: - resolution: {integrity: sha1-Q0eTYw3FfWEcj+j/+h22tW8aFrs=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ink/-/ink-3.2.0.tgz} + resolution: {integrity: sha512-firNp1q3xxTzoItj/eOOSZQnYSlyrWks5llCTVX37nJ59K3eXbQ8PtzCguqo8YI19EELo5QxaKnJd4VxzhU8tg==} engines: {node: '>=10'} peerDependencies: '@types/react': '>=16.8.0' @@ -10115,7 +10115,7 @@ packages: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} is-ci@2.0.0: - resolution: {integrity: sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/is-ci/-/is-ci-2.0.0.tgz} + resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} hasBin: true is-core-module@2.16.2: @@ -10217,7 +10217,7 @@ packages: engines: {node: '>=20'} is-ssh@1.4.1: - resolution: {integrity: sha1-dt4c2+j5KouQXRoXK2vAlwTCA5Y=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/is-ssh/-/is-ssh-1.4.1.tgz} + resolution: {integrity: sha512-JNeu1wQsHjyHgn9NcWTaXq6zWSR6hqE0++zhfZlkFBbScNkyvxCdeV8sRkSBaeLKxmbpR21brail63ACNxJ0Tg==} is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} @@ -10257,7 +10257,7 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} isexe@3.1.5: - resolution: {integrity: sha1-QuNo9o1eENrf7k/ae1ULwtiJLck=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/isexe/-/isexe-3.1.5.tgz} + resolution: {integrity: sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==} engines: {node: '>=18'} isexe@4.0.0: @@ -10338,13 +10338,13 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} json-schema-traverse@0.4.1: - resolution: {integrity: sha1-afaofZUTq4u4/mO9sJecRI5oRmA=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz} + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz} + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} json-with-bigint@3.5.8: resolution: {integrity: sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw==} @@ -10396,7 +10396,7 @@ packages: engines: {node: '>= 0.6'} keytar@7.9.0: - resolution: {integrity: sha1-TGIlcI9RtQy/d8Wq6BchlkwpGMs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/keytar/-/keytar-7.9.0.tgz} + resolution: {integrity: sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==} keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -10460,78 +10460,78 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} levn@0.4.1: - resolution: {integrity: sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/levn/-/levn-0.4.1.tgz} + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} lightningcss-android-arm64@1.32.0: - resolution: {integrity: sha1-8DOIURbf79nG9UeHUj41FLYeGWg=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz} + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [android] lightningcss-darwin-arm64@1.32.0: - resolution: {integrity: sha1-ULcYcbAcgZlYS2SeKSVH+up6+bU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz} + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] lightningcss-darwin-x64@1.32.0: - resolution: {integrity: sha1-NfPpczLRMLnKGB4RtWje1q68bV4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz} + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] lightningcss-freebsd-x64@1.32.0: - resolution: {integrity: sha1-l3enZHK2Ttb/lDQq1kx7r9eUpXU=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz} + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] lightningcss-linux-arm-gnueabihf@1.32.0: - resolution: {integrity: sha1-E65lLhq3O5E117faFy9mbEEK1T0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz} + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] lightningcss-linux-arm64-gnu@1.32.0: - resolution: {integrity: sha1-QXhYeVqUWS9oASOhsfnaig4e8zU=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz} + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: - resolution: {integrity: sha1-a+NmkugQtxgECAL9gJYjz/5zITM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz} + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] libc: [musl] lightningcss-linux-x64-gnu@1.32.0: - resolution: {integrity: sha1-C3gDr06yHP043Tn+Kru1PH3QkfY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz} + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] libc: [glibc] lightningcss-linux-x64-musl@1.32.0: - resolution: {integrity: sha1-iNyLqGXd3bGsXvBLDxYYBEGMFjs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz} + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: - resolution: {integrity: sha1-TzC6P6XpJfW3n5RejMDRdsOxqzg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz} + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] lightningcss-win32-x64-msvc@1.32.0: - resolution: {integrity: sha1-FBqlYFZFBkkokCu0rwRfp9n0Igo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz} + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] @@ -10621,7 +10621,7 @@ packages: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} loose-envify@1.4.0: - resolution: {integrity: sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/loose-envify/-/loose-envify-1.4.0.tgz} + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true loupe@3.2.1: @@ -10807,7 +10807,7 @@ packages: engines: {node: '>=18'} merge-stream@2.0.0: - resolution: {integrity: sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/merge-stream/-/merge-stream-2.0.0.tgz} + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -10958,7 +10958,7 @@ packages: hasBin: true mimic-fn@2.1.0: - resolution: {integrity: sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/mimic-fn/-/mimic-fn-2.1.0.tgz} + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} mimic-fn@3.1.0: @@ -11100,7 +11100,7 @@ packages: resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} natural-compare@1.4.0: - resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/natural-compare/-/natural-compare-1.4.0.tgz} + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} @@ -11168,7 +11168,7 @@ packages: engines: {node: '>=20'} node-watch@0.7.3: - resolution: {integrity: sha1-bU24jjnI0J0+ph1laNgOWXWrx6s=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/node-watch/-/node-watch-0.7.3.tgz} + resolution: {integrity: sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==} engines: {node: '>=6'} nopt@1.0.10: @@ -11250,7 +11250,7 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} npm-run-path@4.0.1: - resolution: {integrity: sha1-t+zR5e1T2o43pV4cImnguX7XSOo=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/npm-run-path/-/npm-run-path-4.0.1.tgz} + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} npm-run-path@6.0.0: @@ -11267,7 +11267,7 @@ packages: resolution: {integrity: sha512-7YRhZ3jS45LwmSCT4b2sVFHt/WuovaktDU07QrtOBY2PXskss5a9jfmR9jptyumwXST+rFjrmppMY1KT/yn35A==} object-assign@4.1.1: - resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/object-assign/-/object-assign-4.1.1.tgz} + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} object-inspect@1.13.4: @@ -11300,7 +11300,7 @@ packages: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} onetime@5.1.2: - resolution: {integrity: sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/onetime/-/onetime-5.1.2.tgz} + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} onetime@7.0.0: @@ -11322,7 +11322,7 @@ packages: engines: {node: '>=20'} optionator@0.9.4: - resolution: {integrity: sha1-fqHBpdkddk+yghOciP4R4YKjpzQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/optionator/-/optionator-0.9.4.tgz} + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} ora@8.2.0: @@ -11493,13 +11493,13 @@ packages: engines: {node: '>=18.12'} parse-path@7.1.0: - resolution: {integrity: sha1-QftRPLEigxgHpMeynIcnlHoJ2MY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/parse-path/-/parse-path-7.1.0.tgz} + resolution: {integrity: sha512-EuCycjZtfPcjWk7KTksnJ5xPMvWGA/6i4zrLYhRG0hGvC3GPU/jGUj3Cy+ZR0v30duV3e23R95T1lE2+lsndSw==} parse-semver@1.1.1: resolution: {integrity: sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==} parse-url@8.1.0: - resolution: {integrity: sha1-ly4IJ+1LV/yF8OprDYOfDYpXpX0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/parse-url/-/parse-url-8.1.0.tgz} + resolution: {integrity: sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==} parse5-htmlparser2-tree-adapter@7.1.0: resolution: {integrity: sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==} @@ -11518,7 +11518,7 @@ packages: engines: {node: '>= 0.8'} patch-console@1.0.0: - resolution: {integrity: sha1-GbnwKHE/64o8AjcCqMyMufdGb50=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/patch-console/-/patch-console-1.0.0.tgz} + resolution: {integrity: sha512-nxl9nrnLQmh64iTzMfyylSlRozL7kAXIaxw1fVcLYdyhNkJCRUzirRZTikXGJsg+hc4fqpneTK6iU2H1Q8THSA==} engines: {node: '>=10'} path-absolute@1.0.1: @@ -11701,7 +11701,7 @@ packages: engines: {node: '>=10'} prelude-ls@1.2.1: - resolution: {integrity: sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/prelude-ls/-/prelude-ls-1.2.1.tgz} + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} prettier-plugin-astro@0.14.1: @@ -11808,7 +11808,7 @@ packages: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} protocols@2.0.2: - resolution: {integrity: sha1-gi6Pzcs99TVlOLPpG/2JCwZ/0KQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/protocols/-/protocols-2.0.2.tgz} + resolution: {integrity: sha512-hHVTzba3wboROl0/aWRRG9dMytgH6ow//STBZh43l/wQgmMhYhOFi0EHWAPtoCz9IAUymsyP0TSBHkhgMEGNnQ==} proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} @@ -11850,7 +11850,7 @@ packages: engines: {node: '>=10'} qunit@2.26.0: - resolution: {integrity: sha1-G7UZ8MaZPy5AR0uPtWQSb6CL604=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/qunit/-/qunit-2.26.0.tgz} + resolution: {integrity: sha512-KSv16YomcYmiK90qTOJl3Bm5IvTf2upqQDdBQWCvSQWe94FWobnUgKOpvpvZdG7VkDt3TJSI8k8g9+GGGEd7Fw==} engines: {node: '>=10'} hasBin: true @@ -11873,7 +11873,7 @@ packages: hasBin: true react-devtools-core@4.28.5: - resolution: {integrity: sha1-yEQrkfBozfDImcVDkH9/J9ecJQg=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react-devtools-core/-/react-devtools-core-4.28.5.tgz} + resolution: {integrity: sha512-cq/o30z9W2Wb4rzBefjv5fBalHU0rJGZCHAkf/RHSBWSSYwh8PlQTqqOJmgIIbBtpj27T6FIPXeomIjZtCNVqA==} react-docgen-typescript@2.4.0: resolution: {integrity: sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg==} @@ -11910,7 +11910,7 @@ packages: react: '>=18' react-reconciler@0.26.2: - resolution: {integrity: sha1-u60OLRMJQj92zzwzCaxsluBenZE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react-reconciler/-/react-reconciler-0.26.2.tgz} + resolution: {integrity: sha512-nK6kgY28HwrMNwDnMui3dvm3rCFjZrcGiuwLc5COUipBK5hWHLOxMJhSnSomirqWwjPBJKV1QcbkI0VJr7Gl1Q==} engines: {node: '>=0.10.0'} peerDependencies: react: ^17.0.2 @@ -11920,7 +11920,7 @@ packages: engines: {node: '>=0.10.0'} react@17.0.2: - resolution: {integrity: sha1-0LXMUW0p6z7uOD91tihkz7aAADc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react/-/react-17.0.2.tgz} + resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==} engines: {node: '>=0.10.0'} react@19.2.7: @@ -11967,7 +11967,7 @@ packages: engines: {node: '>= 20.19.0'} readline-sync@1.4.9: - resolution: {integrity: sha1-PtqOZfI80qF+YTAbHwADOWr17No=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/readline-sync/-/readline-sync-1.4.9.tgz} + resolution: {integrity: sha512-mp5h1N39kuKbCRGebLPIKTBOhuDw55GaNg5S+K9TW9uDAS1wIHpGUc2YokdUMZJb8GqS49sWmWEDijaESYh0Hg==} engines: {node: '>= 0.8.0'} realpath-missing@1.1.0: @@ -12109,7 +12109,7 @@ packages: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} restore-cursor@3.1.0: - resolution: {integrity: sha1-OfZ8VLOnpYzqUjbZXPADQjljH34=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/restore-cursor/-/restore-cursor-3.1.0.tgz} + resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} restore-cursor@5.1.0: @@ -12177,7 +12177,7 @@ packages: optional: true rollup@4.62.2: - resolution: {integrity: sha1-2Q/Ey4EfBxMDyJC3eVlWNPNflUE=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/rollup/-/rollup-4.62.2.tgz} + resolution: {integrity: sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -12228,7 +12228,7 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} safe-execa@0.1.2: - resolution: {integrity: sha1-L7sKbxoAx6RexwM/gmWXV/kb6Mc=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/safe-execa/-/safe-execa-0.1.2.tgz} + resolution: {integrity: sha512-vdTshSQ2JsRCgT8eKZWNJIL26C6bVqy1SOmuCMlKHegVeo8KYRobRrefOdUq9OozSPUUiSxrylteeRmLOMFfWg==} engines: {node: '>=12'} safe-execa@0.1.4: @@ -12256,7 +12256,7 @@ packages: engines: {node: '>=v12.22.7'} scheduler@0.20.2: - resolution: {integrity: sha1-S67jlDbjSqk7SHS93L8P6Li1DpE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/scheduler/-/scheduler-0.20.2.tgz} + resolution: {integrity: sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==} scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -12317,7 +12317,7 @@ packages: engines: {node: '>=8'} sharp@0.34.5: - resolution: {integrity: sha1-tvFI5LjGHxeXveEanRz+u64sV7A=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/sharp/-/sharp-0.34.5.tgz} + resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} sharp@0.35.2: @@ -12470,7 +12470,7 @@ packages: resolution: {integrity: sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==} split2@4.2.0: - resolution: {integrity: sha1-ycWSCQTRSLqwufZxRfJFqGqtv6Q=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/split2/-/split2-4.2.0.tgz} + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} sprintf-js@1.0.3: @@ -12489,7 +12489,7 @@ packages: engines: {node: ^20.17.0 || >=22.9.0} stack-utils@2.0.6: - resolution: {integrity: sha1-qvB0gWnAL8M8gjKrzPkz9Uocw08=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/stack-utils/-/stack-utils-2.0.6.tgz} + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} stackback@0.0.2: @@ -12561,7 +12561,7 @@ packages: engines: {node: '>=8'} string-width@5.1.2: - resolution: {integrity: sha1-FPja7G2B5yIdKjV+Zoyrc728p5Q=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/string-width/-/string-width-5.1.2.tgz} + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} string-width@7.2.0: @@ -12605,7 +12605,7 @@ packages: resolution: {integrity: sha512-zwF4bmnyEjZwRhaak9jUWNxc0DoeKBJ7lwSN/LEc8dQXZcUFG6auaaTQJokQWXopLdM3iTx01nQT8E4aL29DAQ==} strip-final-newline@2.0.0: - resolution: {integrity: sha1-ibhS+y/L6Tb29LMYevsKEsGrWK0=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/strip-final-newline/-/strip-final-newline-2.0.0.tgz} + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} strip-final-newline@4.0.0: @@ -12721,7 +12721,7 @@ packages: engines: {node: '>=18'} tau-prolog@0.2.81: - resolution: {integrity: sha1-iYHeMY2HuOm9T6Rj8IZRrbyam+U=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/tau-prolog/-/tau-prolog-0.2.81.tgz} + resolution: {integrity: sha512-cHSdGumv+GfRweqE3Okd81+ZH1Ux6PoJ+WPjzoAFVar0SRoUxW93vPvWTbnTtlz++IpSEQ0yUPWlLBcTMQ8uOg==} teex@1.0.1: resolution: {integrity: sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==} @@ -12769,7 +12769,7 @@ packages: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} tiny-glob@0.2.9: - resolution: {integrity: sha1-IhLUQawXkoAzsRD4s2QGgxKdMeI=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/tiny-glob/-/tiny-glob-0.2.9.tgz} + resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} tiny-inflate@1.0.3: resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} @@ -12947,18 +12947,18 @@ packages: hasBin: true typanion@3.14.0: - resolution: {integrity: sha1-p2apGBDOglgDOXVzPoNsQ6KSm5Q=, tarball: https://ms-feed-2.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/typanion/-/typanion-3.14.0.tgz} + resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} type-check@0.4.0: - resolution: {integrity: sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-check/-/type-check-0.4.0.tgz} + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} type-fest@0.12.0: - resolution: {integrity: sha1-9Xonq4HGjRNqUf1xRn7/lBV/oe4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.12.0.tgz} + resolution: {integrity: sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg==} engines: {node: '>=10'} type-fest@0.15.1: - resolution: {integrity: sha1-0sTnPT5KU88akGOW3UYKHFF4ygA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.15.1.tgz} + resolution: {integrity: sha512-n+UXrN8i5ioo7kqT/nF8xsEzLaqFra7k32SEsSPwvXVGyAcRgV/FUQN/sgfptJTR1oRmmq7z4IXMFSM7im7C9A==} engines: {node: '>=10'} type-fest@0.16.0: @@ -12966,11 +12966,11 @@ packages: engines: {node: '>=10'} type-fest@0.20.2: - resolution: {integrity: sha1-G/IH9LKPkVg2ZstfvTJ4hzAc1fQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.20.2.tgz} + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} type-fest@0.21.3: - resolution: {integrity: sha1-0mCiSwGYQ24TP6JqUkptZfo7Ljc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/type-fest/-/type-fest-0.21.3.tgz} + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} type-fest@0.6.0: @@ -13257,7 +13257,7 @@ packages: browserslist: '>= 4.21.0' uri-js@4.4.1: - resolution: {integrity: sha1-mxpSWVIlhZ5V9mnZKPiMbFfyp34=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/uri-js/-/uri-js-4.4.1.tgz} + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} uri-template@2.0.0: resolution: {integrity: sha512-r/i44nPoo0ktEZDjx+hxp9PSjQuBBfsd6RgCRuuMqCP0FZEp+YE0SpihThI4UGc5ePqQEFsdyZc7UVlowp+LLw==} @@ -13634,12 +13634,12 @@ packages: hasBin: true which@4.0.0: - resolution: {integrity: sha1-zWC150UDo/vPv2zWtBOKi65kTBo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/which/-/which-4.0.0.tgz} + resolution: {integrity: sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==} engines: {node: ^16.13.0 || >=18.0.0} hasBin: true which@5.0.0: - resolution: {integrity: sha1-2T8tk/eYNNQ2PH0MI+ANB8RmyNY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/which/-/which-5.0.0.tgz} + resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==} engines: {node: ^18.17.0 || >=20.5.0} hasBin: true @@ -13659,11 +13659,11 @@ packages: hasBin: true widest-line@3.1.0: - resolution: {integrity: sha1-gpIzO79my0X/DeFgOxNreuFJbso=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/widest-line/-/widest-line-3.1.0.tgz} + resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} engines: {node: '>=8'} word-wrap@1.2.5: - resolution: {integrity: sha1-0sRcbdT7zmIaZvE2y+Mor9BBCzQ=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/word-wrap/-/word-wrap-1.2.5.tgz} + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} wordwrapjs@4.0.1: @@ -13674,7 +13674,7 @@ packages: resolution: {integrity: sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==} wrap-ansi@6.2.0: - resolution: {integrity: sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/wrap-ansi/-/wrap-ansi-6.2.0.tgz} + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} wrap-ansi@7.0.0: @@ -13682,7 +13682,7 @@ packages: engines: {node: '>=10'} wrap-ansi@8.1.0: - resolution: {integrity: sha1-VtwiNo7lcPrOG0mBmXXZuaXq0hQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/wrap-ansi/-/wrap-ansi-8.1.0.tgz} + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} wrap-ansi@9.0.2: @@ -13704,7 +13704,7 @@ packages: engines: {node: '>=16.14'} ws@7.5.11: - resolution: {integrity: sha1-lGDa8YEruBpCPFuerHRpQahjEPo=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ws/-/ws-7.5.11.tgz} + resolution: {integrity: sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==} engines: {node: '>=8.3.0'} peerDependencies: bufferutil: ^4.0.1 @@ -13828,7 +13828,7 @@ packages: engines: {node: '>=18'} yoga-layout-prebuilt@1.10.0: - resolution: {integrity: sha1-KTb7r0s2KO4LPjsd9Ek21sFG+qY=, tarball: https://ms-feed-12.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/yoga-layout-prebuilt/-/yoga-layout-prebuilt-1.10.0.tgz} + resolution: {integrity: sha512-YnOmtSbv4MTf7RGJMK0FvZ+KD8OEe/J5BNnR0GHhD8J/XcG/Qvxgszm0Un6FTHWW4uHlTgP0IztiXQnGyIR45g==} engines: {node: '>=8'} zod@3.25.76: From ae2ef77bc25a90ddf531ff21dc354945b8eb66b5 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Tue, 21 Jul 2026 08:41:56 -0400 Subject: [PATCH 041/249] fix(website): resolve typespec.io accessibility issues (#11292) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes six open **A11y_TypeSpec** website accessibility bugs (all Sev2, `meta:website`) filed against typespec.io. | Issue | WCAG | Fix | | ----- | ---- | --- | | #10789 | 2.4.1 Bypass Blocks | Added a visible-on-focus **"Skip to main content"** link + a focusable `
` landmark to the non-docs page layout. | | #10791 | 2.1.1 Keyboard | Made the OpenAPI page sample **carousel keyboard operable** — converted the `role="tab"` anchors (no `href`) to ` )) } @@ -100,15 +123,14 @@ const tabs = Object.keys(Astro.slots); +
-
+
{footer &&