From 0fd8f87868ab2f32e31c427c6418f0b559b296b7 Mon Sep 17 00:00:00 2001 From: George Fu Date: Fri, 12 Dec 2025 11:05:41 -0500 Subject: [PATCH 1/3] wip # Conflicts: # smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java --- .../src/commands/GetNumbersCommand.ts | 4 +- .../src/commands/TradeEventStreamCommand.ts | 4 +- .../src/schemas/schemas_0.ts | 46 ++--- .../test/index-objects.spec.mjs | 52 ++--- .../src/commands/EmptyInputOutputCommand.ts | 4 +- .../src/commands/Float16Command.ts | 4 +- .../src/commands/FractionalSecondsCommand.ts | 4 +- .../src/commands/GreetingWithErrorsCommand.ts | 4 +- .../src/commands/NoInputOutputCommand.ts | 4 +- .../commands/OperationWithDefaultsCommand.ts | 4 +- .../commands/OptionalInputOutputCommand.ts | 4 +- .../src/commands/RecursiveShapesCommand.ts | 4 +- .../src/commands/RpcV2CborDenseMapsCommand.ts | 4 +- .../src/commands/RpcV2CborListsCommand.ts | 4 +- .../commands/RpcV2CborSparseMapsCommand.ts | 4 +- .../commands/SimpleScalarPropertiesCommand.ts | 4 +- .../commands/SparseNullsOperationCommand.ts | 4 +- .../src/schemas/schemas_0.ts | 184 +++++++++--------- .../test/index-objects.spec.mjs | 148 +++++++------- .../codegen/knowledge/ServiceClosure.java | 15 +- .../codegen/schema/SchemaGenerator.java | 12 +- 21 files changed, 263 insertions(+), 254 deletions(-) diff --git a/private/my-local-model-schema/src/commands/GetNumbersCommand.ts b/private/my-local-model-schema/src/commands/GetNumbersCommand.ts index 9c1709ff5c9..46e2410cfab 100644 --- a/private/my-local-model-schema/src/commands/GetNumbersCommand.ts +++ b/private/my-local-model-schema/src/commands/GetNumbersCommand.ts @@ -5,7 +5,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { GetNumbersRequest, GetNumbersResponse } from "../models/models_0"; -import { GetNumbers$ } from "../schemas/schemas_0"; +import { getNumbers } from "../schemas/schemas_0"; import type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient"; /** @@ -89,7 +89,7 @@ export class GetNumbersCommand extends $Command }) .s("XYZService", "GetNumbers", {}) .n("XYZServiceClient", "GetNumbersCommand") - .sc(GetNumbers$) + .sc(getNumbers) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts b/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts index c46a5d8b04d..dac8f817441 100644 --- a/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts +++ b/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts @@ -5,7 +5,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { TradeEventStreamRequest, TradeEventStreamResponse } from "../models/models_0"; -import { TradeEventStream$ } from "../schemas/schemas_0"; +import { tradeEventStream } from "../schemas/schemas_0"; import type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient"; /** @@ -97,7 +97,7 @@ export class TradeEventStreamCommand extends $Command }, }) .n("XYZServiceClient", "TradeEventStreamCommand") - .sc(TradeEventStream$) + .sc(tradeEventStream) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/my-local-model-schema/src/schemas/schemas_0.ts b/private/my-local-model-schema/src/schemas/schemas_0.ts index 7d2b3240521..15ad3e23261 100644 --- a/private/my-local-model-schema/src/schemas/schemas_0.ts +++ b/private/my-local-model-schema/src/schemas/schemas_0.ts @@ -46,60 +46,60 @@ import { } from "../models/XYZServiceSyntheticServiceException"; /* eslint no-var: 0 */ -export var Alpha$: StaticStructureSchema = [3, n0, _A, +export var alpha: StaticStructureSchema = [3, n0, _A, 0, [_i, _t], [0, 4] ]; -export var CodedThrottlingError$: StaticErrorSchema = [-3, n0, _CTE, +export var codedThrottlingError: StaticErrorSchema = [-3, n0, _CTE, { [_e]: _c, [_hE]: 429 }, [], [] ]; -TypeRegistry.for(n0).registerError(CodedThrottlingError$, __CodedThrottlingError); -export var GetNumbersRequest$: StaticStructureSchema = [3, n0, _GNR, +TypeRegistry.for(n0).registerError(codedThrottlingError, __CodedThrottlingError); +export var getNumbersRequest: StaticStructureSchema = [3, n0, _GNR, 0, [_bD, _bI, _fWM, _fWMi], [17, 19, 0, 0] ]; -export var GetNumbersResponse$: StaticStructureSchema = [3, n0, _GNRe, +export var getNumbersResponse: StaticStructureSchema = [3, n0, _GNRe, 0, [_bD, _bI], [17, 19] ]; -export var HaltError$: StaticErrorSchema = [-3, n0, _HE, +export var haltError: StaticErrorSchema = [-3, n0, _HE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(HaltError$, __HaltError); -export var MainServiceLinkedError$: StaticErrorSchema = [-3, n0, _MSLE, +TypeRegistry.for(n0).registerError(haltError, __HaltError); +export var mainServiceLinkedError: StaticErrorSchema = [-3, n0, _MSLE, { [_e]: _c, [_hE]: 400 }, [], [] ]; -TypeRegistry.for(n0).registerError(MainServiceLinkedError$, __MainServiceLinkedError); -export var MysteryThrottlingError$: StaticErrorSchema = [-3, n0, _MTE, +TypeRegistry.for(n0).registerError(mainServiceLinkedError, __MainServiceLinkedError); +export var mysteryThrottlingError: StaticErrorSchema = [-3, n0, _MTE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(MysteryThrottlingError$, __MysteryThrottlingError); -export var RetryableError$: StaticErrorSchema = [-3, n0, _RE, +TypeRegistry.for(n0).registerError(mysteryThrottlingError, __MysteryThrottlingError); +export var retryableError: StaticErrorSchema = [-3, n0, _RE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(RetryableError$, __RetryableError); -export var TradeEventStreamRequest$: StaticStructureSchema = [3, n0, _TESR, +TypeRegistry.for(n0).registerError(retryableError, __RetryableError); +export var tradeEventStreamRequest: StaticStructureSchema = [3, n0, _TESR, 0, [_eS], - [[() => TradeEvents$, 0]] + [[() => tradeEvents, 0]] ]; -export var TradeEventStreamResponse$: StaticStructureSchema = [3, n0, _TESRr, +export var tradeEventStreamResponse: StaticStructureSchema = [3, n0, _TESRr, 0, [_eS], - [[() => TradeEvents$, 0]] + [[() => tradeEvents, 0]] ]; export var XYZServiceServiceException$: StaticErrorSchema = [-3, n0, _XYZSSE, { [_e]: _c }, @@ -110,14 +110,14 @@ TypeRegistry.for(n0).registerError(XYZServiceServiceException$, __XYZServiceServ var __Unit = "unit" as const; export var XYZServiceSyntheticServiceException: StaticErrorSchema = [-3, _s, "XYZServiceSyntheticServiceException", 0, [], []]; TypeRegistry.for(_s).registerError(XYZServiceSyntheticServiceException, __XYZServiceSyntheticServiceException); -export var TradeEvents$: StaticStructureSchema = [3, n0, _TE, +export var tradeEvents: StaticStructureSchema = [3, n0, _TE, { [_st]: 1 }, [_a, _b, _g], - [() => Alpha$, () => __Unit, () => __Unit] + [() => alpha, () => __Unit, () => __Unit] ]; -export var GetNumbers$: StaticOperationSchema = [9, n0, _GN, - 0, () => GetNumbersRequest$, () => GetNumbersResponse$ +export var getNumbers: StaticOperationSchema = [9, n0, _GN, + 0, () => getNumbersRequest, () => getNumbersResponse ]; -export var TradeEventStream$: StaticOperationSchema = [9, n0, _TES, - 0, () => TradeEventStreamRequest$, () => TradeEventStreamResponse$ +export var tradeEventStream: StaticOperationSchema = [9, n0, _TES, + 0, () => tradeEventStreamRequest, () => tradeEventStreamResponse ]; diff --git a/private/my-local-model-schema/test/index-objects.spec.mjs b/private/my-local-model-schema/test/index-objects.spec.mjs index 6f6d702e958..6eefc32c23f 100644 --- a/private/my-local-model-schema/test/index-objects.spec.mjs +++ b/private/my-local-model-schema/test/index-objects.spec.mjs @@ -1,29 +1,29 @@ import { - Alpha$, CodedThrottlingError, - CodedThrottlingError$, - GetNumbers$, GetNumbersCommand, - GetNumbersRequest$, - GetNumbersResponse$, HaltError, - HaltError$, MainServiceLinkedError, - MainServiceLinkedError$, MysteryThrottlingError, - MysteryThrottlingError$, RetryableError, - RetryableError$, - TradeEventStream$, TradeEventStreamCommand, - TradeEventStreamRequest$, - TradeEventStreamResponse$, - TradeEvents$, XYZService, XYZServiceClient, XYZServiceServiceException, XYZServiceServiceException$, XYZServiceSyntheticServiceException, + alpha, + codedThrottlingError, + getNumbers, + getNumbersRequest, + getNumbersResponse, + haltError, + mainServiceLinkedError, + mysteryThrottlingError, + retryableError, + tradeEventStream, + tradeEventStreamRequest, + tradeEventStreamResponse, + tradeEvents, } from "../dist-cjs/index.js"; import assert from "node:assert"; // clients @@ -31,27 +31,27 @@ assert(typeof XYZServiceClient === "function"); assert(typeof XYZService === "function"); // commands assert(typeof GetNumbersCommand === "function"); -assert(typeof GetNumbers$ === "object"); +assert(typeof getNumbers === "object"); assert(typeof TradeEventStreamCommand === "function"); -assert(typeof TradeEventStream$ === "object"); +assert(typeof tradeEventStream === "object"); // structural schemas -assert(typeof Alpha$ === "object"); -assert(typeof GetNumbersRequest$ === "object"); -assert(typeof GetNumbersResponse$ === "object"); -assert(typeof TradeEvents$ === "object"); -assert(typeof TradeEventStreamRequest$ === "object"); -assert(typeof TradeEventStreamResponse$ === "object"); +assert(typeof alpha === "object"); +assert(typeof getNumbersRequest === "object"); +assert(typeof getNumbersResponse === "object"); +assert(typeof tradeEvents === "object"); +assert(typeof tradeEventStreamRequest === "object"); +assert(typeof tradeEventStreamResponse === "object"); // errors assert(CodedThrottlingError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof CodedThrottlingError$ === "object"); +assert(typeof codedThrottlingError === "object"); assert(HaltError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof HaltError$ === "object"); +assert(typeof haltError === "object"); assert(MainServiceLinkedError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof MainServiceLinkedError$ === "object"); +assert(typeof mainServiceLinkedError === "object"); assert(MysteryThrottlingError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof MysteryThrottlingError$ === "object"); +assert(typeof mysteryThrottlingError === "object"); assert(RetryableError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof RetryableError$ === "object"); +assert(typeof retryableError === "object"); assert(XYZServiceServiceException.prototype instanceof XYZServiceSyntheticServiceException); assert(typeof XYZServiceServiceException$ === "object"); assert(XYZServiceSyntheticServiceException.prototype instanceof Error); diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts index ec64b20870f..058d2d11cc6 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { EmptyStructure } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { EmptyInputOutput$ } from "../schemas/schemas_0"; +import { emptyInputOutput } from "../schemas/schemas_0"; /** * @public @@ -69,7 +69,7 @@ export class EmptyInputOutputCommand extends $Command }) .s("RpcV2Protocol", "EmptyInputOutput", {}) .n("RpcV2ProtocolClient", "EmptyInputOutputCommand") - .sc(EmptyInputOutput$) + .sc(emptyInputOutput) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts b/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts index 22f995cf41b..e808c5343a1 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { Float16Output } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { Float16$ } from "../schemas/schemas_0"; +import { float16 } from "../schemas/schemas_0"; /** * @public @@ -71,7 +71,7 @@ export class Float16Command extends $Command }) .s("RpcV2Protocol", "Float16", {}) .n("RpcV2ProtocolClient", "Float16Command") - .sc(Float16$) + .sc(float16) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts index bb1517b8cd2..81c010f20bf 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { FractionalSecondsOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { FractionalSeconds$ } from "../schemas/schemas_0"; +import { fractionalSeconds } from "../schemas/schemas_0"; /** * @public @@ -71,7 +71,7 @@ export class FractionalSecondsCommand extends $Command }) .s("RpcV2Protocol", "FractionalSeconds", {}) .n("RpcV2ProtocolClient", "FractionalSecondsCommand") - .sc(FractionalSeconds$) + .sc(fractionalSeconds) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts index ca0d6c73dba..28d88cf05b5 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { GreetingWithErrorsOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { GreetingWithErrors$ } from "../schemas/schemas_0"; +import { greetingWithErrors } from "../schemas/schemas_0"; /** * @public @@ -84,7 +84,7 @@ export class GreetingWithErrorsCommand extends $Command }) .s("RpcV2Protocol", "GreetingWithErrors", {}) .n("RpcV2ProtocolClient", "GreetingWithErrorsCommand") - .sc(GreetingWithErrors$) + .sc(greetingWithErrors) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts index 694f1c80b9a..17d578f5ec8 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts @@ -5,7 +5,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { NoInputOutput$ } from "../schemas/schemas_0"; +import { noInputOutput } from "../schemas/schemas_0"; /** * @public @@ -68,7 +68,7 @@ export class NoInputOutputCommand extends $Command }) .s("RpcV2Protocol", "NoInputOutput", {}) .n("RpcV2ProtocolClient", "NoInputOutputCommand") - .sc(NoInputOutput$) + .sc(noInputOutput) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts index 59f097f15a5..ce9b8dbbef9 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { OperationWithDefaultsInput, OperationWithDefaultsOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { OperationWithDefaults$ } from "../schemas/schemas_0"; +import { operationWithDefaults } from "../schemas/schemas_0"; /** * @public @@ -137,7 +137,7 @@ export class OperationWithDefaultsCommand extends $Command }) .s("RpcV2Protocol", "OperationWithDefaults", {}) .n("RpcV2ProtocolClient", "OperationWithDefaultsCommand") - .sc(OperationWithDefaults$) + .sc(operationWithDefaults) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts index dcd5edb1a97..29ef7269d2b 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { SimpleStructure } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { OptionalInputOutput$ } from "../schemas/schemas_0"; +import { optionalInputOutput } from "../schemas/schemas_0"; /** * @public @@ -73,7 +73,7 @@ export class OptionalInputOutputCommand extends $Command }) .s("RpcV2Protocol", "OptionalInputOutput", {}) .n("RpcV2ProtocolClient", "OptionalInputOutputCommand") - .sc(OptionalInputOutput$) + .sc(optionalInputOutput) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts index 780ff588f3b..de6f1fe5ab4 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RecursiveShapesInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { RecursiveShapes$ } from "../schemas/schemas_0"; +import { recursiveShapes } from "../schemas/schemas_0"; /** * @public @@ -97,7 +97,7 @@ export class RecursiveShapesCommand extends $Command }) .s("RpcV2Protocol", "RecursiveShapes", {}) .n("RpcV2ProtocolClient", "RecursiveShapesCommand") - .sc(RecursiveShapes$) + .sc(recursiveShapes) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts index 728afcddf4e..7415f291ba6 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2CborDenseMapsInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { RpcV2CborDenseMaps$ } from "../schemas/schemas_0"; +import { rpcV2CborDenseMaps } from "../schemas/schemas_0"; /** * @public @@ -114,7 +114,7 @@ export class RpcV2CborDenseMapsCommand extends $Command }) .s("RpcV2Protocol", "RpcV2CborDenseMaps", {}) .n("RpcV2ProtocolClient", "RpcV2CborDenseMapsCommand") - .sc(RpcV2CborDenseMaps$) + .sc(rpcV2CborDenseMaps) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts index f402bf2b507..0d4afe1094d 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2CborListInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { RpcV2CborLists$ } from "../schemas/schemas_0"; +import { rpcV2CborLists } from "../schemas/schemas_0"; /** * @public @@ -152,7 +152,7 @@ export class RpcV2CborListsCommand extends $Command }) .s("RpcV2Protocol", "RpcV2CborLists", {}) .n("RpcV2ProtocolClient", "RpcV2CborListsCommand") - .sc(RpcV2CborLists$) + .sc(rpcV2CborLists) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts index bac0cb04524..0959599e85b 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2CborSparseMapsInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { RpcV2CborSparseMaps$ } from "../schemas/schemas_0"; +import { rpcV2CborSparseMaps } from "../schemas/schemas_0"; /** * @public @@ -114,7 +114,7 @@ export class RpcV2CborSparseMapsCommand extends $Command }) .s("RpcV2Protocol", "RpcV2CborSparseMaps", {}) .n("RpcV2ProtocolClient", "RpcV2CborSparseMapsCommand") - .sc(RpcV2CborSparseMaps$) + .sc(rpcV2CborSparseMaps) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts index 3d45275e01c..8a2c5238f39 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { SimpleScalarStructure } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { SimpleScalarProperties$ } from "../schemas/schemas_0"; +import { simpleScalarProperties } from "../schemas/schemas_0"; /** * @public @@ -91,7 +91,7 @@ export class SimpleScalarPropertiesCommand extends $Command }) .s("RpcV2Protocol", "SimpleScalarProperties", {}) .n("RpcV2ProtocolClient", "SimpleScalarPropertiesCommand") - .sc(SimpleScalarProperties$) + .sc(simpleScalarProperties) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts index 05082ecaa74..5ed98abb9e3 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { SparseNullsOperationInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { SparseNullsOperation$ } from "../schemas/schemas_0"; +import { sparseNullsOperation } from "../schemas/schemas_0"; /** * @public @@ -83,7 +83,7 @@ export class SparseNullsOperationCommand extends $Command }) .s("RpcV2Protocol", "SparseNullsOperation", {}) .n("RpcV2ProtocolClient", "SparseNullsOperationCommand") - .sc(SparseNullsOperation$) + .sc(sparseNullsOperation) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts b/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts index 1452b5e64b4..e3afab334e1 100644 --- a/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts +++ b/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts @@ -151,213 +151,213 @@ import { /* eslint no-var: 0 */ var __Unit = "unit" as const; -export var ValidationException$: StaticErrorSchema = [-3, n0, _VE, +export var validationException: StaticErrorSchema = [-3, n0, _VE, { [_e]: _c }, [_m, _fL], - [0, () => ValidationExceptionFieldList$] + [0, () => validationExceptionFieldList] ]; -TypeRegistry.for(n0).registerError(ValidationException$, __ValidationException); -export var ValidationExceptionField$: StaticStructureSchema = [3, n0, _VEF, +TypeRegistry.for(n0).registerError(validationException, __ValidationException); +export var validationExceptionField: StaticStructureSchema = [3, n0, _VEF, 0, [_p, _m], [0, 0] ]; -export var ClientOptionalDefaults$: StaticStructureSchema = [3, n1, _COD, +export var clientOptionalDefaults: StaticStructureSchema = [3, n1, _COD, 0, [_me], [1] ]; -export var ComplexError$: StaticErrorSchema = [-3, n1, _CE, +export var complexError: StaticErrorSchema = [-3, n1, _CE, { [_e]: _c }, [_TL, _N], - [0, () => ComplexNestedErrorData$] + [0, () => complexNestedErrorData] ]; -TypeRegistry.for(n1).registerError(ComplexError$, __ComplexError); -export var ComplexNestedErrorData$: StaticStructureSchema = [3, n1, _CNED, +TypeRegistry.for(n1).registerError(complexError, __ComplexError); +export var complexNestedErrorData: StaticStructureSchema = [3, n1, _CNED, 0, [_F], [0] ]; -export var Defaults$: StaticStructureSchema = [3, n1, _D, +export var defaults: StaticStructureSchema = [3, n1, _D, 0, [_dS, _dB, _dL, _dT, _dBe, _dBef, _dSe, _dI, _dLe, _dF, _dD, _dM, _dE, _dIE, _eS, _fB, _eB, _zB, _zS, _zI, _zL, _zF, _zD], [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] ]; -export var EmptyStructure$: StaticStructureSchema = [3, n1, _ES, +export var emptyStructure: StaticStructureSchema = [3, n1, _ES, 0, [], [] ]; -export var Float16Output$: StaticStructureSchema = [3, n1, _FO, +export var float16Output: StaticStructureSchema = [3, n1, _FO, 0, [_v], [1] ]; -export var FractionalSecondsOutput$: StaticStructureSchema = [3, n1, _FSO, +export var fractionalSecondsOutput: StaticStructureSchema = [3, n1, _FSO, 0, [_d], [5] ]; -export var GreetingWithErrorsOutput$: StaticStructureSchema = [3, n1, _GWEO, +export var greetingWithErrorsOutput: StaticStructureSchema = [3, n1, _GWEO, 0, [_g], [0] ]; -export var InvalidGreeting$: StaticErrorSchema = [-3, n1, _IG, +export var invalidGreeting: StaticErrorSchema = [-3, n1, _IG, { [_e]: _c }, [_M], [0] ]; -TypeRegistry.for(n1).registerError(InvalidGreeting$, __InvalidGreeting); -export var OperationWithDefaultsInput$: StaticStructureSchema = [3, n1, _OWDI, +TypeRegistry.for(n1).registerError(invalidGreeting, __InvalidGreeting); +export var operationWithDefaultsInput: StaticStructureSchema = [3, n1, _OWDI, 0, [_de, _cOD, _tLD, _oTLD], - [() => Defaults$, () => ClientOptionalDefaults$, 0, 1] + [() => defaults, () => clientOptionalDefaults, 0, 1] ]; -export var OperationWithDefaultsOutput$: StaticStructureSchema = [3, n1, _OWDO, +export var operationWithDefaultsOutput: StaticStructureSchema = [3, n1, _OWDO, 0, [_dS, _dB, _dL, _dT, _dBe, _dBef, _dSe, _dI, _dLe, _dF, _dD, _dM, _dE, _dIE, _eS, _fB, _eB, _zB, _zS, _zI, _zL, _zF, _zD], [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] ]; -export var RecursiveShapesInputOutput$: StaticStructureSchema = [3, n1, _RSIO, +export var recursiveShapesInputOutput: StaticStructureSchema = [3, n1, _RSIO, 0, [_n], - [() => RecursiveShapesInputOutputNested1$] + [() => recursiveShapesInputOutputNested1] ]; -export var RecursiveShapesInputOutputNested1$: StaticStructureSchema = [3, n1, _RSION, +export var recursiveShapesInputOutputNested1: StaticStructureSchema = [3, n1, _RSION, 0, [_f, _n], - [0, () => RecursiveShapesInputOutputNested2$] + [0, () => recursiveShapesInputOutputNested2] ]; -export var RecursiveShapesInputOutputNested2$: StaticStructureSchema = [3, n1, _RSIONe, +export var recursiveShapesInputOutputNested2: StaticStructureSchema = [3, n1, _RSIONe, 0, [_b, _rM], - [0, () => RecursiveShapesInputOutputNested1$] + [0, () => recursiveShapesInputOutputNested1] ]; -export var RpcV2CborDenseMapsInputOutput$: StaticStructureSchema = [3, n1, _RVCDMIO, +export var rpcV2CborDenseMapsInputOutput: StaticStructureSchema = [3, n1, _RVCDMIO, 0, [_dSM, _dNM, _dBM, _dSMe, _dSMen], - [() => DenseStructMap$, 128 | 1, 128 | 2, 128 | 0, [2, n1, _DSM, 0, 0, 64 | 0]] + [() => denseStructMap, 128 | 1, 128 | 2, 128 | 0, [2, n1, _DSM, 0, 0, 64 | 0]] ]; -export var RpcV2CborListInputOutput$: StaticStructureSchema = [3, n1, _RVCLIO, +export var rpcV2CborListInputOutput: StaticStructureSchema = [3, n1, _RVCLIO, 0, [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _sLt, _bLl], - [64 | 0, 64 | 0, 64 | 1, 64 | 2, 64 | 4, 64 | 0, 64 | 1, [1, n2, _NSL, 0, 64 | 0], () => StructureList$, 64 | 21] + [64 | 0, 64 | 0, 64 | 1, 64 | 2, 64 | 4, 64 | 0, 64 | 1, [1, n2, _NSL, 0, 64 | 0], () => structureList, 64 | 21] ]; -export var RpcV2CborSparseMapsInputOutput$: StaticStructureSchema = [3, n1, _RVCSMIO, +export var rpcV2CborSparseMapsInputOutput: StaticStructureSchema = [3, n1, _RVCSMIO, 0, [_sSM, _sNM, _sBM, _sSMp, _sSMpa], - [[() => SparseStructMap$, 0], [() => SparseNumberMap$, 0], [() => SparseBooleanMap$, 0], [() => SparseStringMap$, 0], [() => SparseSetMap$, 0]] + [[() => sparseStructMap, 0], [() => sparseNumberMap, 0], [() => sparseBooleanMap, 0], [() => sparseStringMap, 0], [() => sparseSetMap, 0]] ]; -export var SimpleScalarStructure$: StaticStructureSchema = [3, n1, _SSS, +export var simpleScalarStructure: StaticStructureSchema = [3, n1, _SSS, 0, [_tBV, _fBV, _bV, _dV, _fV, _iV, _lV, _sV, _sVt, _bVl], [2, 2, 1, 1, 1, 1, 1, 1, 0, 21] ]; -export var SimpleStructure$: StaticStructureSchema = [3, n1, _SS, +export var simpleStructure: StaticStructureSchema = [3, n1, _SS, 0, [_v], [0] ]; -export var SparseNullsOperationInputOutput$: StaticStructureSchema = [3, n1, _SNOIO, +export var sparseNullsOperationInputOutput: StaticStructureSchema = [3, n1, _SNOIO, 0, [_sSL, _sSMp], - [[() => SparseStringList$, 0], [() => SparseStringMap$, 0]] + [[() => sparseStringList, 0], [() => sparseStringMap, 0]] ]; -export var StructureListMember$: StaticStructureSchema = [3, n1, _SLM, +export var structureListMember: StaticStructureSchema = [3, n1, _SLM, 0, [_a, _b_], [0, 0] ]; -export var GreetingStruct$: StaticStructureSchema = [3, n2, _GS, +export var greetingStruct: StaticStructureSchema = [3, n2, _GS, 0, [_h], [0] ]; export var RpcV2ProtocolServiceException: StaticErrorSchema = [-3, _sC, "RpcV2ProtocolServiceException", 0, [], []]; TypeRegistry.for(_sC).registerError(RpcV2ProtocolServiceException, __RpcV2ProtocolServiceException); -var ValidationExceptionFieldList$: StaticListSchema = [1, n0, _VEFL, - 0, () => ValidationExceptionField$ -]; -var StructureList$: StaticListSchema = [1, n1, _SL, - 0, () => StructureListMember$ -]; -var TestStringList$ = 64 | 0; -var BlobList$ = 64 | 21; -var BooleanList$ = 64 | 2; -var FooEnumList$ = 64 | 0; -var IntegerEnumList$ = 64 | 1; -var IntegerList$ = 64 | 1; -var NestedStringList$: StaticListSchema = [1, n2, _NSL, +var validationExceptionFieldList: StaticListSchema = [1, n0, _VEFL, + 0, () => validationExceptionField +]; +var structureList: StaticListSchema = [1, n1, _SL, + 0, () => structureListMember +]; +var testStringList = 64 | 0; +var blobList = 64 | 21; +var booleanList = 64 | 2; +var fooEnumList = 64 | 0; +var integerEnumList = 64 | 1; +var integerList = 64 | 1; +var nestedStringList: StaticListSchema = [1, n2, _NSL, 0, 64 | 0 ]; -var SparseStringList$: StaticListSchema = [1, n2, _SSL, +var sparseStringList: StaticListSchema = [1, n2, _SSL, { [_s]: 1 }, 0 ]; -var StringList$ = 64 | 0; -var StringSet$ = 64 | 0; -var TimestampList$ = 64 | 4; -var DenseBooleanMap$ = 128 | 2; -var DenseNumberMap$ = 128 | 1; -var DenseSetMap$: StaticMapSchema = [2, n1, _DSM, +var stringList = 64 | 0; +var stringSet = 64 | 0; +var timestampList = 64 | 4; +var denseBooleanMap = 128 | 2; +var denseNumberMap = 128 | 1; +var denseSetMap: StaticMapSchema = [2, n1, _DSM, 0, 0, 64 | 0 ]; -var DenseStringMap$ = 128 | 0; -var DenseStructMap$: StaticMapSchema = [2, n1, _DSMe, - 0, 0, () => GreetingStruct$ +var denseStringMap = 128 | 0; +var denseStructMap: StaticMapSchema = [2, n1, _DSMe, + 0, 0, () => greetingStruct ]; -var SparseBooleanMap$: StaticMapSchema = [2, n1, _SBM, +var sparseBooleanMap: StaticMapSchema = [2, n1, _SBM, { [_s]: 1 }, 0, 2 ]; -var SparseNumberMap$: StaticMapSchema = [2, n1, _SNM, +var sparseNumberMap: StaticMapSchema = [2, n1, _SNM, { [_s]: 1 }, 0, 1 ]; -var SparseSetMap$: StaticMapSchema = [2, n1, _SSM, +var sparseSetMap: StaticMapSchema = [2, n1, _SSM, { [_s]: 1 }, 0, 64 | 0 ]; -var SparseStructMap$: StaticMapSchema = [2, n1, _SSMp, - { [_s]: 1 }, 0, () => GreetingStruct$ +var sparseStructMap: StaticMapSchema = [2, n1, _SSMp, + { [_s]: 1 }, 0, () => greetingStruct ]; -var TestStringMap$ = 128 | 0; -var SparseStringMap$: StaticMapSchema = [2, n2, _SSMpa, +var testStringMap = 128 | 0; +var sparseStringMap: StaticMapSchema = [2, n2, _SSMpa, { [_s]: 1 }, 0, 0 ]; -export var EmptyInputOutput$: StaticOperationSchema = [9, n1, _EIO, - 0, () => EmptyStructure$, () => EmptyStructure$ +export var emptyInputOutput: StaticOperationSchema = [9, n1, _EIO, + 0, () => emptyStructure, () => emptyStructure ]; -export var Float16$: StaticOperationSchema = [9, n1, _Fl, - 0, () => __Unit, () => Float16Output$ +export var float16: StaticOperationSchema = [9, n1, _Fl, + 0, () => __Unit, () => float16Output ]; -export var FractionalSeconds$: StaticOperationSchema = [9, n1, _FS, - 0, () => __Unit, () => FractionalSecondsOutput$ +export var fractionalSeconds: StaticOperationSchema = [9, n1, _FS, + 0, () => __Unit, () => fractionalSecondsOutput ]; -export var GreetingWithErrors$: StaticOperationSchema = [9, n1, _GWE, - 2, () => __Unit, () => GreetingWithErrorsOutput$ +export var greetingWithErrors: StaticOperationSchema = [9, n1, _GWE, + 2, () => __Unit, () => greetingWithErrorsOutput ]; -export var NoInputOutput$: StaticOperationSchema = [9, n1, _NIO, +export var noInputOutput: StaticOperationSchema = [9, n1, _NIO, 0, () => __Unit, () => __Unit ]; -export var OperationWithDefaults$: StaticOperationSchema = [9, n1, _OWD, - 0, () => OperationWithDefaultsInput$, () => OperationWithDefaultsOutput$ +export var operationWithDefaults: StaticOperationSchema = [9, n1, _OWD, + 0, () => operationWithDefaultsInput, () => operationWithDefaultsOutput ]; -export var OptionalInputOutput$: StaticOperationSchema = [9, n1, _OIO, - 0, () => SimpleStructure$, () => SimpleStructure$ +export var optionalInputOutput: StaticOperationSchema = [9, n1, _OIO, + 0, () => simpleStructure, () => simpleStructure ]; -export var RecursiveShapes$: StaticOperationSchema = [9, n1, _RS, - 0, () => RecursiveShapesInputOutput$, () => RecursiveShapesInputOutput$ +export var recursiveShapes: StaticOperationSchema = [9, n1, _RS, + 0, () => recursiveShapesInputOutput, () => recursiveShapesInputOutput ]; -export var RpcV2CborDenseMaps$: StaticOperationSchema = [9, n1, _RVCDM, - 0, () => RpcV2CborDenseMapsInputOutput$, () => RpcV2CborDenseMapsInputOutput$ +export var rpcV2CborDenseMaps: StaticOperationSchema = [9, n1, _RVCDM, + 0, () => rpcV2CborDenseMapsInputOutput, () => rpcV2CborDenseMapsInputOutput ]; -export var RpcV2CborLists$: StaticOperationSchema = [9, n1, _RVCL, - 2, () => RpcV2CborListInputOutput$, () => RpcV2CborListInputOutput$ +export var rpcV2CborLists: StaticOperationSchema = [9, n1, _RVCL, + 2, () => rpcV2CborListInputOutput, () => rpcV2CborListInputOutput ]; -export var RpcV2CborSparseMaps$: StaticOperationSchema = [9, n1, _RVCSM, - 0, () => RpcV2CborSparseMapsInputOutput$, () => RpcV2CborSparseMapsInputOutput$ +export var rpcV2CborSparseMaps: StaticOperationSchema = [9, n1, _RVCSM, + 0, () => rpcV2CborSparseMapsInputOutput, () => rpcV2CborSparseMapsInputOutput ]; -export var SimpleScalarProperties$: StaticOperationSchema = [9, n1, _SSP, - 0, () => SimpleScalarStructure$, () => SimpleScalarStructure$ +export var simpleScalarProperties: StaticOperationSchema = [9, n1, _SSP, + 0, () => simpleScalarStructure, () => simpleScalarStructure ]; -export var SparseNullsOperation$: StaticOperationSchema = [9, n1, _SNO, - 0, () => SparseNullsOperationInputOutput$, () => SparseNullsOperationInputOutput$ +export var sparseNullsOperation: StaticOperationSchema = [9, n1, _SNO, + 0, () => sparseNullsOperationInputOutput, () => sparseNullsOperationInputOutput ]; diff --git a/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs b/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs index ffcc8116fc4..f2555ccb421 100644 --- a/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs +++ b/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs @@ -1,64 +1,64 @@ import { - ClientOptionalDefaults$, ComplexError, - ComplexError$, - ComplexNestedErrorData$, - Defaults$, - EmptyInputOutput$, EmptyInputOutputCommand, - EmptyStructure$, - Float16$, Float16Command, - Float16Output$, FooEnum, - FractionalSeconds$, FractionalSecondsCommand, - FractionalSecondsOutput$, - GreetingStruct$, - GreetingWithErrors$, GreetingWithErrorsCommand, - GreetingWithErrorsOutput$, IntegerEnum, InvalidGreeting, - InvalidGreeting$, - NoInputOutput$, NoInputOutputCommand, - OperationWithDefaults$, OperationWithDefaultsCommand, - OperationWithDefaultsInput$, - OperationWithDefaultsOutput$, - OptionalInputOutput$, OptionalInputOutputCommand, - RecursiveShapes$, RecursiveShapesCommand, - RecursiveShapesInputOutput$, - RecursiveShapesInputOutputNested1$, - RecursiveShapesInputOutputNested2$, - RpcV2CborDenseMaps$, RpcV2CborDenseMapsCommand, - RpcV2CborDenseMapsInputOutput$, - RpcV2CborListInputOutput$, - RpcV2CborLists$, RpcV2CborListsCommand, - RpcV2CborSparseMaps$, RpcV2CborSparseMapsCommand, - RpcV2CborSparseMapsInputOutput$, RpcV2Protocol, RpcV2ProtocolClient, RpcV2ProtocolServiceException, - SimpleScalarProperties$, SimpleScalarPropertiesCommand, - SimpleScalarStructure$, - SimpleStructure$, - SparseNullsOperation$, SparseNullsOperationCommand, - SparseNullsOperationInputOutput$, - StructureListMember$, TestEnum, TestIntEnum, ValidationException, - ValidationException$, - ValidationExceptionField$, + clientOptionalDefaults, + complexError, + complexNestedErrorData, + defaults, + emptyInputOutput, + emptyStructure, + float16, + float16Output, + fractionalSeconds, + fractionalSecondsOutput, + greetingStruct, + greetingWithErrors, + greetingWithErrorsOutput, + invalidGreeting, + noInputOutput, + operationWithDefaults, + operationWithDefaultsInput, + operationWithDefaultsOutput, + optionalInputOutput, + recursiveShapes, + recursiveShapesInputOutput, + recursiveShapesInputOutputNested1, + recursiveShapesInputOutputNested2, + rpcV2CborDenseMaps, + rpcV2CborDenseMapsInputOutput, + rpcV2CborListInputOutput, + rpcV2CborLists, + rpcV2CborSparseMaps, + rpcV2CborSparseMapsInputOutput, + simpleScalarProperties, + simpleScalarStructure, + simpleStructure, + sparseNullsOperation, + sparseNullsOperationInputOutput, + structureListMember, + validationException, + validationExceptionField, } from "../dist-cjs/index.js"; import assert from "node:assert"; // clients @@ -66,53 +66,53 @@ assert(typeof RpcV2ProtocolClient === "function"); assert(typeof RpcV2Protocol === "function"); // commands assert(typeof EmptyInputOutputCommand === "function"); -assert(typeof EmptyInputOutput$ === "object"); +assert(typeof emptyInputOutput === "object"); assert(typeof Float16Command === "function"); -assert(typeof Float16$ === "object"); +assert(typeof float16 === "object"); assert(typeof FractionalSecondsCommand === "function"); -assert(typeof FractionalSeconds$ === "object"); +assert(typeof fractionalSeconds === "object"); assert(typeof GreetingWithErrorsCommand === "function"); -assert(typeof GreetingWithErrors$ === "object"); +assert(typeof greetingWithErrors === "object"); assert(typeof NoInputOutputCommand === "function"); -assert(typeof NoInputOutput$ === "object"); +assert(typeof noInputOutput === "object"); assert(typeof OperationWithDefaultsCommand === "function"); -assert(typeof OperationWithDefaults$ === "object"); +assert(typeof operationWithDefaults === "object"); assert(typeof OptionalInputOutputCommand === "function"); -assert(typeof OptionalInputOutput$ === "object"); +assert(typeof optionalInputOutput === "object"); assert(typeof RecursiveShapesCommand === "function"); -assert(typeof RecursiveShapes$ === "object"); +assert(typeof recursiveShapes === "object"); assert(typeof RpcV2CborDenseMapsCommand === "function"); -assert(typeof RpcV2CborDenseMaps$ === "object"); +assert(typeof rpcV2CborDenseMaps === "object"); assert(typeof RpcV2CborListsCommand === "function"); -assert(typeof RpcV2CborLists$ === "object"); +assert(typeof rpcV2CborLists === "object"); assert(typeof RpcV2CborSparseMapsCommand === "function"); -assert(typeof RpcV2CborSparseMaps$ === "object"); +assert(typeof rpcV2CborSparseMaps === "object"); assert(typeof SimpleScalarPropertiesCommand === "function"); -assert(typeof SimpleScalarProperties$ === "object"); +assert(typeof simpleScalarProperties === "object"); assert(typeof SparseNullsOperationCommand === "function"); -assert(typeof SparseNullsOperation$ === "object"); +assert(typeof sparseNullsOperation === "object"); // structural schemas -assert(typeof ValidationExceptionField$ === "object"); -assert(typeof ClientOptionalDefaults$ === "object"); -assert(typeof ComplexNestedErrorData$ === "object"); -assert(typeof Defaults$ === "object"); -assert(typeof EmptyStructure$ === "object"); -assert(typeof Float16Output$ === "object"); -assert(typeof FractionalSecondsOutput$ === "object"); -assert(typeof GreetingWithErrorsOutput$ === "object"); -assert(typeof OperationWithDefaultsInput$ === "object"); -assert(typeof OperationWithDefaultsOutput$ === "object"); -assert(typeof RecursiveShapesInputOutput$ === "object"); -assert(typeof RecursiveShapesInputOutputNested1$ === "object"); -assert(typeof RecursiveShapesInputOutputNested2$ === "object"); -assert(typeof RpcV2CborDenseMapsInputOutput$ === "object"); -assert(typeof RpcV2CborListInputOutput$ === "object"); -assert(typeof RpcV2CborSparseMapsInputOutput$ === "object"); -assert(typeof SimpleScalarStructure$ === "object"); -assert(typeof SimpleStructure$ === "object"); -assert(typeof SparseNullsOperationInputOutput$ === "object"); -assert(typeof StructureListMember$ === "object"); -assert(typeof GreetingStruct$ === "object"); +assert(typeof validationExceptionField === "object"); +assert(typeof clientOptionalDefaults === "object"); +assert(typeof complexNestedErrorData === "object"); +assert(typeof defaults === "object"); +assert(typeof emptyStructure === "object"); +assert(typeof float16Output === "object"); +assert(typeof fractionalSecondsOutput === "object"); +assert(typeof greetingWithErrorsOutput === "object"); +assert(typeof operationWithDefaultsInput === "object"); +assert(typeof operationWithDefaultsOutput === "object"); +assert(typeof recursiveShapesInputOutput === "object"); +assert(typeof recursiveShapesInputOutputNested1 === "object"); +assert(typeof recursiveShapesInputOutputNested2 === "object"); +assert(typeof rpcV2CborDenseMapsInputOutput === "object"); +assert(typeof rpcV2CborListInputOutput === "object"); +assert(typeof rpcV2CborSparseMapsInputOutput === "object"); +assert(typeof simpleScalarStructure === "object"); +assert(typeof simpleStructure === "object"); +assert(typeof sparseNullsOperationInputOutput === "object"); +assert(typeof structureListMember === "object"); +assert(typeof greetingStruct === "object"); // enums assert(typeof TestEnum === "object"); assert(typeof TestIntEnum === "object"); @@ -120,10 +120,10 @@ assert(typeof FooEnum === "object"); assert(typeof IntegerEnum === "object"); // errors assert(ValidationException.prototype instanceof RpcV2ProtocolServiceException); -assert(typeof ValidationException$ === "object"); +assert(typeof validationException === "object"); assert(ComplexError.prototype instanceof RpcV2ProtocolServiceException); -assert(typeof ComplexError$ === "object"); +assert(typeof complexError === "object"); assert(InvalidGreeting.prototype instanceof RpcV2ProtocolServiceException); -assert(typeof InvalidGreeting$ === "object"); +assert(typeof invalidGreeting === "object"); assert(RpcV2ProtocolServiceException.prototype instanceof Error); console.log(`RpcV2Protocol index test passed.`); diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java index 5052113f0c8..802640b305c 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java @@ -209,11 +209,18 @@ public String getShapeSchemaVariableName(Shape shape, StringStore store) { symbolName += "_" + store.var(shape.getId().getNamespace(), "n"); } /* - * The schema suffix allows what would otherwise conflict with the - * shape's interface symbol name to be exported at the top level of the same package. + * Although exporting a type and value with the same name is allowed by TS, we + * do not want to do this because the structure's interface is not that + * of the schema object. + * + * The name transform deconflicts the interface and structure variable names. + * for export at the top level of the same package. */ - String schemaSuffix = "$"; - return symbolName + schemaSuffix; + if (Character.isUpperCase(symbolName.charAt(0)) && !Character.isUpperCase(symbolName.charAt(1))) { + return Character.toLowerCase(symbolName.charAt(0)) + symbolName.substring(1); + } + String conflictingSchemaSuffix = "$"; + return symbolName + conflictingSchemaSuffix; } /** diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java index 868fad250f9..4c653ab8569 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java @@ -167,15 +167,17 @@ private void writeStructureSchema(StructureShape shape) { */ private void writeBaseError() { String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider); - String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model); + String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName( + serviceName, model + ); + String schemaSymbolName = serviceExceptionName + "$"; String namespace = settings.getService(model).getId().getNamespace(); - String exceptionCtorSymbolName = "__" + serviceExceptionName; writer.addTypeImport("StaticErrorSchema", null, TypeScriptDependency.SMITHY_TYPES); writer.addRelativeImport( serviceExceptionName, - exceptionCtorSymbolName, + null, Paths.get("..", "models", serviceExceptionName) ); @@ -192,8 +194,8 @@ private void writeBaseError() { """ TypeRegistry.for($L).registerError($L, $L);""", syntheticNamespace, - serviceExceptionName, - exceptionCtorSymbolName + schemaSymbolName, + serviceExceptionName ); } From 656eedd5ac2b1eb697f2b328a28e8328c6f3bcbc Mon Sep 17 00:00:00 2001 From: George Fu Date: Fri, 12 Dec 2025 12:05:59 -0500 Subject: [PATCH 2/3] rename schema exports with schema suffix # Conflicts: # smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java # smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java --- .../src/commands/GetNumbersCommand.ts | 4 +- .../src/commands/TradeEventStreamCommand.ts | 4 +- .../src/schemas/schemas_0.ts | 70 +++---- .../test/index-objects.spec.mjs | 56 ++--- .../src/commands/EmptyInputOutputCommand.ts | 4 +- .../src/commands/Float16Command.ts | 4 +- .../src/commands/FractionalSecondsCommand.ts | 4 +- .../src/commands/GreetingWithErrorsCommand.ts | 4 +- .../src/commands/NoInputOutputCommand.ts | 4 +- .../commands/OperationWithDefaultsCommand.ts | 4 +- .../commands/OptionalInputOutputCommand.ts | 4 +- .../src/commands/RecursiveShapesCommand.ts | 4 +- .../src/commands/RpcV2CborDenseMapsCommand.ts | 4 +- .../src/commands/RpcV2CborListsCommand.ts | 4 +- .../commands/RpcV2CborSparseMapsCommand.ts | 4 +- .../commands/SimpleScalarPropertiesCommand.ts | 4 +- .../commands/SparseNullsOperationCommand.ts | 4 +- .../src/schemas/schemas_0.ts | 198 +++++++++--------- .../test/index-objects.spec.mjs | 148 ++++++------- .../codegen/knowledge/ServiceClosure.java | 8 +- .../codegen/schema/SchemaGenerator.java | 34 ++- 21 files changed, 279 insertions(+), 295 deletions(-) diff --git a/private/my-local-model-schema/src/commands/GetNumbersCommand.ts b/private/my-local-model-schema/src/commands/GetNumbersCommand.ts index 46e2410cfab..6baac55a339 100644 --- a/private/my-local-model-schema/src/commands/GetNumbersCommand.ts +++ b/private/my-local-model-schema/src/commands/GetNumbersCommand.ts @@ -5,7 +5,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { GetNumbersRequest, GetNumbersResponse } from "../models/models_0"; -import { getNumbers } from "../schemas/schemas_0"; +import { GetNumbersSchema } from "../schemas/schemas_0"; import type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient"; /** @@ -89,7 +89,7 @@ export class GetNumbersCommand extends $Command }) .s("XYZService", "GetNumbers", {}) .n("XYZServiceClient", "GetNumbersCommand") - .sc(getNumbers) + .sc(GetNumbersSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts b/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts index dac8f817441..beb60563ce2 100644 --- a/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts +++ b/private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts @@ -5,7 +5,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { TradeEventStreamRequest, TradeEventStreamResponse } from "../models/models_0"; -import { tradeEventStream } from "../schemas/schemas_0"; +import { TradeEventStreamSchema } from "../schemas/schemas_0"; import type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient"; /** @@ -97,7 +97,7 @@ export class TradeEventStreamCommand extends $Command }, }) .n("XYZServiceClient", "TradeEventStreamCommand") - .sc(tradeEventStream) + .sc(TradeEventStreamSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/my-local-model-schema/src/schemas/schemas_0.ts b/private/my-local-model-schema/src/schemas/schemas_0.ts index 15ad3e23261..c5722aad012 100644 --- a/private/my-local-model-schema/src/schemas/schemas_0.ts +++ b/private/my-local-model-schema/src/schemas/schemas_0.ts @@ -34,90 +34,88 @@ import { TypeRegistry } from "@smithy/core/schema"; import type { StaticErrorSchema, StaticOperationSchema, StaticStructureSchema } from "@smithy/types"; import { - CodedThrottlingError as __CodedThrottlingError, - HaltError as __HaltError, - MainServiceLinkedError as __MainServiceLinkedError, - MysteryThrottlingError as __MysteryThrottlingError, - RetryableError as __RetryableError, - XYZServiceServiceException as __XYZServiceServiceException, + CodedThrottlingError, + HaltError, + MainServiceLinkedError, + MysteryThrottlingError, + RetryableError, + XYZServiceServiceException, } from "../models/errors"; -import { - XYZServiceSyntheticServiceException as __XYZServiceSyntheticServiceException, -} from "../models/XYZServiceSyntheticServiceException"; +import { XYZServiceSyntheticServiceException } from "../models/XYZServiceSyntheticServiceException"; /* eslint no-var: 0 */ -export var alpha: StaticStructureSchema = [3, n0, _A, +export var AlphaSchema: StaticStructureSchema = [3, n0, _A, 0, [_i, _t], [0, 4] ]; -export var codedThrottlingError: StaticErrorSchema = [-3, n0, _CTE, +export var CodedThrottlingErrorSchema: StaticErrorSchema = [-3, n0, _CTE, { [_e]: _c, [_hE]: 429 }, [], [] ]; -TypeRegistry.for(n0).registerError(codedThrottlingError, __CodedThrottlingError); -export var getNumbersRequest: StaticStructureSchema = [3, n0, _GNR, +TypeRegistry.for(n0).registerError(CodedThrottlingErrorSchema, CodedThrottlingError); +export var GetNumbersRequestSchema: StaticStructureSchema = [3, n0, _GNR, 0, [_bD, _bI, _fWM, _fWMi], [17, 19, 0, 0] ]; -export var getNumbersResponse: StaticStructureSchema = [3, n0, _GNRe, +export var GetNumbersResponseSchema: StaticStructureSchema = [3, n0, _GNRe, 0, [_bD, _bI], [17, 19] ]; -export var haltError: StaticErrorSchema = [-3, n0, _HE, +export var HaltErrorSchema: StaticErrorSchema = [-3, n0, _HE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(haltError, __HaltError); -export var mainServiceLinkedError: StaticErrorSchema = [-3, n0, _MSLE, +TypeRegistry.for(n0).registerError(HaltErrorSchema, HaltError); +export var MainServiceLinkedErrorSchema: StaticErrorSchema = [-3, n0, _MSLE, { [_e]: _c, [_hE]: 400 }, [], [] ]; -TypeRegistry.for(n0).registerError(mainServiceLinkedError, __MainServiceLinkedError); -export var mysteryThrottlingError: StaticErrorSchema = [-3, n0, _MTE, +TypeRegistry.for(n0).registerError(MainServiceLinkedErrorSchema, MainServiceLinkedError); +export var MysteryThrottlingErrorSchema: StaticErrorSchema = [-3, n0, _MTE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(mysteryThrottlingError, __MysteryThrottlingError); -export var retryableError: StaticErrorSchema = [-3, n0, _RE, +TypeRegistry.for(n0).registerError(MysteryThrottlingErrorSchema, MysteryThrottlingError); +export var RetryableErrorSchema: StaticErrorSchema = [-3, n0, _RE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(retryableError, __RetryableError); -export var tradeEventStreamRequest: StaticStructureSchema = [3, n0, _TESR, +TypeRegistry.for(n0).registerError(RetryableErrorSchema, RetryableError); +export var TradeEventStreamRequestSchema: StaticStructureSchema = [3, n0, _TESR, 0, [_eS], - [[() => tradeEvents, 0]] + [[() => TradeEventsSchema, 0]] ]; -export var tradeEventStreamResponse: StaticStructureSchema = [3, n0, _TESRr, +export var TradeEventStreamResponseSchema: StaticStructureSchema = [3, n0, _TESRr, 0, [_eS], - [[() => tradeEvents, 0]] + [[() => TradeEventsSchema, 0]] ]; -export var XYZServiceServiceException$: StaticErrorSchema = [-3, n0, _XYZSSE, +export var XYZServiceServiceExceptionSchema: StaticErrorSchema = [-3, n0, _XYZSSE, { [_e]: _c }, [], [] ]; -TypeRegistry.for(n0).registerError(XYZServiceServiceException$, __XYZServiceServiceException); +TypeRegistry.for(n0).registerError(XYZServiceServiceExceptionSchema, XYZServiceServiceException); var __Unit = "unit" as const; -export var XYZServiceSyntheticServiceException: StaticErrorSchema = [-3, _s, "XYZServiceSyntheticServiceException", 0, [], []]; -TypeRegistry.for(_s).registerError(XYZServiceSyntheticServiceException, __XYZServiceSyntheticServiceException); -export var tradeEvents: StaticStructureSchema = [3, n0, _TE, +export var XYZServiceSyntheticServiceException$: StaticErrorSchema = [-3, _s, "XYZServiceSyntheticServiceException", 0, [], []]; +TypeRegistry.for(_s).registerError(XYZServiceSyntheticServiceException$, XYZServiceSyntheticServiceException); +export var TradeEventsSchema: StaticStructureSchema = [3, n0, _TE, { [_st]: 1 }, [_a, _b, _g], - [() => alpha, () => __Unit, () => __Unit] + [() => AlphaSchema, () => __Unit, () => __Unit] ]; -export var getNumbers: StaticOperationSchema = [9, n0, _GN, - 0, () => getNumbersRequest, () => getNumbersResponse +export var GetNumbersSchema: StaticOperationSchema = [9, n0, _GN, + 0, () => GetNumbersRequestSchema, () => GetNumbersResponseSchema ]; -export var tradeEventStream: StaticOperationSchema = [9, n0, _TES, - 0, () => tradeEventStreamRequest, () => tradeEventStreamResponse +export var TradeEventStreamSchema: StaticOperationSchema = [9, n0, _TES, + 0, () => TradeEventStreamRequestSchema, () => TradeEventStreamResponseSchema ]; diff --git a/private/my-local-model-schema/test/index-objects.spec.mjs b/private/my-local-model-schema/test/index-objects.spec.mjs index 6eefc32c23f..ce502cadd2e 100644 --- a/private/my-local-model-schema/test/index-objects.spec.mjs +++ b/private/my-local-model-schema/test/index-objects.spec.mjs @@ -1,29 +1,29 @@ import { + AlphaSchema, CodedThrottlingError, + CodedThrottlingErrorSchema, GetNumbersCommand, + GetNumbersRequestSchema, + GetNumbersResponseSchema, + GetNumbersSchema, HaltError, + HaltErrorSchema, MainServiceLinkedError, + MainServiceLinkedErrorSchema, MysteryThrottlingError, + MysteryThrottlingErrorSchema, RetryableError, + RetryableErrorSchema, TradeEventStreamCommand, + TradeEventStreamRequestSchema, + TradeEventStreamResponseSchema, + TradeEventStreamSchema, + TradeEventsSchema, XYZService, XYZServiceClient, XYZServiceServiceException, - XYZServiceServiceException$, + XYZServiceServiceExceptionSchema, XYZServiceSyntheticServiceException, - alpha, - codedThrottlingError, - getNumbers, - getNumbersRequest, - getNumbersResponse, - haltError, - mainServiceLinkedError, - mysteryThrottlingError, - retryableError, - tradeEventStream, - tradeEventStreamRequest, - tradeEventStreamResponse, - tradeEvents, } from "../dist-cjs/index.js"; import assert from "node:assert"; // clients @@ -31,28 +31,28 @@ assert(typeof XYZServiceClient === "function"); assert(typeof XYZService === "function"); // commands assert(typeof GetNumbersCommand === "function"); -assert(typeof getNumbers === "object"); +assert(typeof GetNumbersSchema === "object"); assert(typeof TradeEventStreamCommand === "function"); -assert(typeof tradeEventStream === "object"); +assert(typeof TradeEventStreamSchema === "object"); // structural schemas -assert(typeof alpha === "object"); -assert(typeof getNumbersRequest === "object"); -assert(typeof getNumbersResponse === "object"); -assert(typeof tradeEvents === "object"); -assert(typeof tradeEventStreamRequest === "object"); -assert(typeof tradeEventStreamResponse === "object"); +assert(typeof AlphaSchema === "object"); +assert(typeof GetNumbersRequestSchema === "object"); +assert(typeof GetNumbersResponseSchema === "object"); +assert(typeof TradeEventsSchema === "object"); +assert(typeof TradeEventStreamRequestSchema === "object"); +assert(typeof TradeEventStreamResponseSchema === "object"); // errors assert(CodedThrottlingError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof codedThrottlingError === "object"); +assert(typeof CodedThrottlingErrorSchema === "object"); assert(HaltError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof haltError === "object"); +assert(typeof HaltErrorSchema === "object"); assert(MainServiceLinkedError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof mainServiceLinkedError === "object"); +assert(typeof MainServiceLinkedErrorSchema === "object"); assert(MysteryThrottlingError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof mysteryThrottlingError === "object"); +assert(typeof MysteryThrottlingErrorSchema === "object"); assert(RetryableError.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof retryableError === "object"); +assert(typeof RetryableErrorSchema === "object"); assert(XYZServiceServiceException.prototype instanceof XYZServiceSyntheticServiceException); -assert(typeof XYZServiceServiceException$ === "object"); +assert(typeof XYZServiceServiceExceptionSchema === "object"); assert(XYZServiceSyntheticServiceException.prototype instanceof Error); console.log(`XYZService index test passed.`); diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts index 058d2d11cc6..d2faeb04841 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/EmptyInputOutputCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { EmptyStructure } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { emptyInputOutput } from "../schemas/schemas_0"; +import { EmptyInputOutputSchema } from "../schemas/schemas_0"; /** * @public @@ -69,7 +69,7 @@ export class EmptyInputOutputCommand extends $Command }) .s("RpcV2Protocol", "EmptyInputOutput", {}) .n("RpcV2ProtocolClient", "EmptyInputOutputCommand") - .sc(emptyInputOutput) + .sc(EmptyInputOutputSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts b/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts index e808c5343a1..685b2d3d430 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/Float16Command.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { Float16Output } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { float16 } from "../schemas/schemas_0"; +import { Float16Schema } from "../schemas/schemas_0"; /** * @public @@ -71,7 +71,7 @@ export class Float16Command extends $Command }) .s("RpcV2Protocol", "Float16", {}) .n("RpcV2ProtocolClient", "Float16Command") - .sc(float16) + .sc(Float16Schema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts index 81c010f20bf..5b8bb9786c2 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/FractionalSecondsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { FractionalSecondsOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { fractionalSeconds } from "../schemas/schemas_0"; +import { FractionalSecondsSchema } from "../schemas/schemas_0"; /** * @public @@ -71,7 +71,7 @@ export class FractionalSecondsCommand extends $Command }) .s("RpcV2Protocol", "FractionalSeconds", {}) .n("RpcV2ProtocolClient", "FractionalSecondsCommand") - .sc(fractionalSeconds) + .sc(FractionalSecondsSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts index 28d88cf05b5..0fa24da0a74 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/GreetingWithErrorsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { GreetingWithErrorsOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { greetingWithErrors } from "../schemas/schemas_0"; +import { GreetingWithErrorsSchema } from "../schemas/schemas_0"; /** * @public @@ -84,7 +84,7 @@ export class GreetingWithErrorsCommand extends $Command }) .s("RpcV2Protocol", "GreetingWithErrors", {}) .n("RpcV2ProtocolClient", "GreetingWithErrorsCommand") - .sc(greetingWithErrors) + .sc(GreetingWithErrorsSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts index 17d578f5ec8..bea8fec6a67 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/NoInputOutputCommand.ts @@ -5,7 +5,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { noInputOutput } from "../schemas/schemas_0"; +import { NoInputOutputSchema } from "../schemas/schemas_0"; /** * @public @@ -68,7 +68,7 @@ export class NoInputOutputCommand extends $Command }) .s("RpcV2Protocol", "NoInputOutput", {}) .n("RpcV2ProtocolClient", "NoInputOutputCommand") - .sc(noInputOutput) + .sc(NoInputOutputSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts index ce9b8dbbef9..3effef0e3cf 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/OperationWithDefaultsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { OperationWithDefaultsInput, OperationWithDefaultsOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { operationWithDefaults } from "../schemas/schemas_0"; +import { OperationWithDefaultsSchema } from "../schemas/schemas_0"; /** * @public @@ -137,7 +137,7 @@ export class OperationWithDefaultsCommand extends $Command }) .s("RpcV2Protocol", "OperationWithDefaults", {}) .n("RpcV2ProtocolClient", "OperationWithDefaultsCommand") - .sc(operationWithDefaults) + .sc(OperationWithDefaultsSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts index 29ef7269d2b..c3709be0c1f 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/OptionalInputOutputCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { SimpleStructure } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { optionalInputOutput } from "../schemas/schemas_0"; +import { OptionalInputOutputSchema } from "../schemas/schemas_0"; /** * @public @@ -73,7 +73,7 @@ export class OptionalInputOutputCommand extends $Command }) .s("RpcV2Protocol", "OptionalInputOutput", {}) .n("RpcV2ProtocolClient", "OptionalInputOutputCommand") - .sc(optionalInputOutput) + .sc(OptionalInputOutputSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts index de6f1fe5ab4..d4bf127c926 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RecursiveShapesCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RecursiveShapesInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { recursiveShapes } from "../schemas/schemas_0"; +import { RecursiveShapesSchema } from "../schemas/schemas_0"; /** * @public @@ -97,7 +97,7 @@ export class RecursiveShapesCommand extends $Command }) .s("RpcV2Protocol", "RecursiveShapes", {}) .n("RpcV2ProtocolClient", "RecursiveShapesCommand") - .sc(recursiveShapes) + .sc(RecursiveShapesSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts index 7415f291ba6..2f44c9bbad1 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborDenseMapsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2CborDenseMapsInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { rpcV2CborDenseMaps } from "../schemas/schemas_0"; +import { RpcV2CborDenseMapsSchema } from "../schemas/schemas_0"; /** * @public @@ -114,7 +114,7 @@ export class RpcV2CborDenseMapsCommand extends $Command }) .s("RpcV2Protocol", "RpcV2CborDenseMaps", {}) .n("RpcV2ProtocolClient", "RpcV2CborDenseMapsCommand") - .sc(rpcV2CborDenseMaps) + .sc(RpcV2CborDenseMapsSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts index 0d4afe1094d..250f2733e85 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborListsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2CborListInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { rpcV2CborLists } from "../schemas/schemas_0"; +import { RpcV2CborListsSchema } from "../schemas/schemas_0"; /** * @public @@ -152,7 +152,7 @@ export class RpcV2CborListsCommand extends $Command }) .s("RpcV2Protocol", "RpcV2CborLists", {}) .n("RpcV2ProtocolClient", "RpcV2CborListsCommand") - .sc(rpcV2CborLists) + .sc(RpcV2CborListsSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts index 0959599e85b..a5380882091 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/RpcV2CborSparseMapsCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { RpcV2CborSparseMapsInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { rpcV2CborSparseMaps } from "../schemas/schemas_0"; +import { RpcV2CborSparseMapsSchema } from "../schemas/schemas_0"; /** * @public @@ -114,7 +114,7 @@ export class RpcV2CborSparseMapsCommand extends $Command }) .s("RpcV2Protocol", "RpcV2CborSparseMaps", {}) .n("RpcV2ProtocolClient", "RpcV2CborSparseMapsCommand") - .sc(rpcV2CborSparseMaps) + .sc(RpcV2CborSparseMapsSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts index 8a2c5238f39..f4ea1151cc9 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/SimpleScalarPropertiesCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { SimpleScalarStructure } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { simpleScalarProperties } from "../schemas/schemas_0"; +import { SimpleScalarPropertiesSchema } from "../schemas/schemas_0"; /** * @public @@ -91,7 +91,7 @@ export class SimpleScalarPropertiesCommand extends $Command }) .s("RpcV2Protocol", "SimpleScalarProperties", {}) .n("RpcV2ProtocolClient", "SimpleScalarPropertiesCommand") - .sc(simpleScalarProperties) + .sc(SimpleScalarPropertiesSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts b/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts index 5ed98abb9e3..7ec26f621f3 100644 --- a/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts +++ b/private/smithy-rpcv2-cbor-schema/src/commands/SparseNullsOperationCommand.ts @@ -6,7 +6,7 @@ import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { commonParams } from "../endpoint/EndpointParameters"; import type { SparseNullsOperationInputOutput } from "../models/models_0"; import type { RpcV2ProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RpcV2ProtocolClient"; -import { sparseNullsOperation } from "../schemas/schemas_0"; +import { SparseNullsOperationSchema } from "../schemas/schemas_0"; /** * @public @@ -83,7 +83,7 @@ export class SparseNullsOperationCommand extends $Command }) .s("RpcV2Protocol", "SparseNullsOperation", {}) .n("RpcV2ProtocolClient", "SparseNullsOperationCommand") - .sc(sparseNullsOperation) + .sc(SparseNullsOperationSchema) .build() { /** @internal type navigation helper, not in runtime. */ protected declare static __types: { diff --git a/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts b/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts index e3afab334e1..a4b1318ca31 100644 --- a/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts +++ b/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts @@ -140,224 +140,218 @@ import type { StaticStructureSchema, } from "@smithy/types"; -import { - ComplexError as __ComplexError, - InvalidGreeting as __InvalidGreeting, - ValidationException as __ValidationException, -} from "../models/errors"; -import { - RpcV2ProtocolServiceException as __RpcV2ProtocolServiceException, -} from "../models/RpcV2ProtocolServiceException"; +import { ComplexError, InvalidGreeting, ValidationException } from "../models/errors"; +import { RpcV2ProtocolServiceException } from "../models/RpcV2ProtocolServiceException"; /* eslint no-var: 0 */ var __Unit = "unit" as const; -export var validationException: StaticErrorSchema = [-3, n0, _VE, +export var ValidationExceptionSchema: StaticErrorSchema = [-3, n0, _VE, { [_e]: _c }, [_m, _fL], - [0, () => validationExceptionFieldList] + [0, () => ValidationExceptionFieldList] ]; -TypeRegistry.for(n0).registerError(validationException, __ValidationException); -export var validationExceptionField: StaticStructureSchema = [3, n0, _VEF, +TypeRegistry.for(n0).registerError(ValidationExceptionSchema, ValidationException); +export var ValidationExceptionFieldSchema: StaticStructureSchema = [3, n0, _VEF, 0, [_p, _m], [0, 0] ]; -export var clientOptionalDefaults: StaticStructureSchema = [3, n1, _COD, +export var ClientOptionalDefaultsSchema: StaticStructureSchema = [3, n1, _COD, 0, [_me], [1] ]; -export var complexError: StaticErrorSchema = [-3, n1, _CE, +export var ComplexErrorSchema: StaticErrorSchema = [-3, n1, _CE, { [_e]: _c }, [_TL, _N], - [0, () => complexNestedErrorData] + [0, () => ComplexNestedErrorDataSchema] ]; -TypeRegistry.for(n1).registerError(complexError, __ComplexError); -export var complexNestedErrorData: StaticStructureSchema = [3, n1, _CNED, +TypeRegistry.for(n1).registerError(ComplexErrorSchema, ComplexError); +export var ComplexNestedErrorDataSchema: StaticStructureSchema = [3, n1, _CNED, 0, [_F], [0] ]; -export var defaults: StaticStructureSchema = [3, n1, _D, +export var DefaultsSchema: StaticStructureSchema = [3, n1, _D, 0, [_dS, _dB, _dL, _dT, _dBe, _dBef, _dSe, _dI, _dLe, _dF, _dD, _dM, _dE, _dIE, _eS, _fB, _eB, _zB, _zS, _zI, _zL, _zF, _zD], [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] ]; -export var emptyStructure: StaticStructureSchema = [3, n1, _ES, +export var EmptyStructureSchema: StaticStructureSchema = [3, n1, _ES, 0, [], [] ]; -export var float16Output: StaticStructureSchema = [3, n1, _FO, +export var Float16OutputSchema: StaticStructureSchema = [3, n1, _FO, 0, [_v], [1] ]; -export var fractionalSecondsOutput: StaticStructureSchema = [3, n1, _FSO, +export var FractionalSecondsOutputSchema: StaticStructureSchema = [3, n1, _FSO, 0, [_d], [5] ]; -export var greetingWithErrorsOutput: StaticStructureSchema = [3, n1, _GWEO, +export var GreetingWithErrorsOutputSchema: StaticStructureSchema = [3, n1, _GWEO, 0, [_g], [0] ]; -export var invalidGreeting: StaticErrorSchema = [-3, n1, _IG, +export var InvalidGreetingSchema: StaticErrorSchema = [-3, n1, _IG, { [_e]: _c }, [_M], [0] ]; -TypeRegistry.for(n1).registerError(invalidGreeting, __InvalidGreeting); -export var operationWithDefaultsInput: StaticStructureSchema = [3, n1, _OWDI, +TypeRegistry.for(n1).registerError(InvalidGreetingSchema, InvalidGreeting); +export var OperationWithDefaultsInputSchema: StaticStructureSchema = [3, n1, _OWDI, 0, [_de, _cOD, _tLD, _oTLD], - [() => defaults, () => clientOptionalDefaults, 0, 1] + [() => DefaultsSchema, () => ClientOptionalDefaultsSchema, 0, 1] ]; -export var operationWithDefaultsOutput: StaticStructureSchema = [3, n1, _OWDO, +export var OperationWithDefaultsOutputSchema: StaticStructureSchema = [3, n1, _OWDO, 0, [_dS, _dB, _dL, _dT, _dBe, _dBef, _dSe, _dI, _dLe, _dF, _dD, _dM, _dE, _dIE, _eS, _fB, _eB, _zB, _zS, _zI, _zL, _zF, _zD], [0, 2, 64 | 0, 4, 21, 1, 1, 1, 1, 1, 1, 128 | 0, 0, 1, 0, 2, 21, 1, 1, 1, 1, 1, 1] ]; -export var recursiveShapesInputOutput: StaticStructureSchema = [3, n1, _RSIO, +export var RecursiveShapesInputOutputSchema: StaticStructureSchema = [3, n1, _RSIO, 0, [_n], - [() => recursiveShapesInputOutputNested1] + [() => RecursiveShapesInputOutputNested1Schema] ]; -export var recursiveShapesInputOutputNested1: StaticStructureSchema = [3, n1, _RSION, +export var RecursiveShapesInputOutputNested1Schema: StaticStructureSchema = [3, n1, _RSION, 0, [_f, _n], - [0, () => recursiveShapesInputOutputNested2] + [0, () => RecursiveShapesInputOutputNested2Schema] ]; -export var recursiveShapesInputOutputNested2: StaticStructureSchema = [3, n1, _RSIONe, +export var RecursiveShapesInputOutputNested2Schema: StaticStructureSchema = [3, n1, _RSIONe, 0, [_b, _rM], - [0, () => recursiveShapesInputOutputNested1] + [0, () => RecursiveShapesInputOutputNested1Schema] ]; -export var rpcV2CborDenseMapsInputOutput: StaticStructureSchema = [3, n1, _RVCDMIO, +export var RpcV2CborDenseMapsInputOutputSchema: StaticStructureSchema = [3, n1, _RVCDMIO, 0, [_dSM, _dNM, _dBM, _dSMe, _dSMen], - [() => denseStructMap, 128 | 1, 128 | 2, 128 | 0, [2, n1, _DSM, 0, 0, 64 | 0]] + [() => DenseStructMap, 128 | 1, 128 | 2, 128 | 0, [2, n1, _DSM, 0, 0, 64 | 0]] ]; -export var rpcV2CborListInputOutput: StaticStructureSchema = [3, n1, _RVCLIO, +export var RpcV2CborListInputOutputSchema: StaticStructureSchema = [3, n1, _RVCLIO, 0, [_sL, _sS, _iL, _bL, _tL, _eL, _iEL, _nSL, _sLt, _bLl], - [64 | 0, 64 | 0, 64 | 1, 64 | 2, 64 | 4, 64 | 0, 64 | 1, [1, n2, _NSL, 0, 64 | 0], () => structureList, 64 | 21] + [64 | 0, 64 | 0, 64 | 1, 64 | 2, 64 | 4, 64 | 0, 64 | 1, [1, n2, _NSL, 0, 64 | 0], () => StructureList, 64 | 21] ]; -export var rpcV2CborSparseMapsInputOutput: StaticStructureSchema = [3, n1, _RVCSMIO, +export var RpcV2CborSparseMapsInputOutputSchema: StaticStructureSchema = [3, n1, _RVCSMIO, 0, [_sSM, _sNM, _sBM, _sSMp, _sSMpa], - [[() => sparseStructMap, 0], [() => sparseNumberMap, 0], [() => sparseBooleanMap, 0], [() => sparseStringMap, 0], [() => sparseSetMap, 0]] + [[() => SparseStructMap, 0], [() => SparseNumberMap, 0], [() => SparseBooleanMap, 0], [() => SparseStringMap, 0], [() => SparseSetMap, 0]] ]; -export var simpleScalarStructure: StaticStructureSchema = [3, n1, _SSS, +export var SimpleScalarStructureSchema: StaticStructureSchema = [3, n1, _SSS, 0, [_tBV, _fBV, _bV, _dV, _fV, _iV, _lV, _sV, _sVt, _bVl], [2, 2, 1, 1, 1, 1, 1, 1, 0, 21] ]; -export var simpleStructure: StaticStructureSchema = [3, n1, _SS, +export var SimpleStructureSchema: StaticStructureSchema = [3, n1, _SS, 0, [_v], [0] ]; -export var sparseNullsOperationInputOutput: StaticStructureSchema = [3, n1, _SNOIO, +export var SparseNullsOperationInputOutputSchema: StaticStructureSchema = [3, n1, _SNOIO, 0, [_sSL, _sSMp], - [[() => sparseStringList, 0], [() => sparseStringMap, 0]] + [[() => SparseStringList, 0], [() => SparseStringMap, 0]] ]; -export var structureListMember: StaticStructureSchema = [3, n1, _SLM, +export var StructureListMemberSchema: StaticStructureSchema = [3, n1, _SLM, 0, [_a, _b_], [0, 0] ]; -export var greetingStruct: StaticStructureSchema = [3, n2, _GS, +export var GreetingStructSchema: StaticStructureSchema = [3, n2, _GS, 0, [_h], [0] ]; -export var RpcV2ProtocolServiceException: StaticErrorSchema = [-3, _sC, "RpcV2ProtocolServiceException", 0, [], []]; -TypeRegistry.for(_sC).registerError(RpcV2ProtocolServiceException, __RpcV2ProtocolServiceException); -var validationExceptionFieldList: StaticListSchema = [1, n0, _VEFL, - 0, () => validationExceptionField -]; -var structureList: StaticListSchema = [1, n1, _SL, - 0, () => structureListMember -]; -var testStringList = 64 | 0; -var blobList = 64 | 21; -var booleanList = 64 | 2; -var fooEnumList = 64 | 0; -var integerEnumList = 64 | 1; -var integerList = 64 | 1; -var nestedStringList: StaticListSchema = [1, n2, _NSL, +export var RpcV2ProtocolServiceException$: StaticErrorSchema = [-3, _sC, "RpcV2ProtocolServiceException", 0, [], []]; +TypeRegistry.for(_sC).registerError(RpcV2ProtocolServiceException$, RpcV2ProtocolServiceException); +var ValidationExceptionFieldList: StaticListSchema = [1, n0, _VEFL, + 0, () => ValidationExceptionFieldSchema +]; +var StructureList: StaticListSchema = [1, n1, _SL, + 0, () => StructureListMemberSchema +]; +var TestStringList = 64 | 0; +var BlobList = 64 | 21; +var BooleanList = 64 | 2; +var FooEnumList = 64 | 0; +var IntegerEnumList = 64 | 1; +var IntegerList = 64 | 1; +var NestedStringList: StaticListSchema = [1, n2, _NSL, 0, 64 | 0 ]; -var sparseStringList: StaticListSchema = [1, n2, _SSL, +var SparseStringList: StaticListSchema = [1, n2, _SSL, { [_s]: 1 }, 0 ]; -var stringList = 64 | 0; -var stringSet = 64 | 0; -var timestampList = 64 | 4; -var denseBooleanMap = 128 | 2; -var denseNumberMap = 128 | 1; -var denseSetMap: StaticMapSchema = [2, n1, _DSM, +var StringList = 64 | 0; +var StringSet = 64 | 0; +var TimestampList = 64 | 4; +var DenseBooleanMap = 128 | 2; +var DenseNumberMap = 128 | 1; +var DenseSetMap: StaticMapSchema = [2, n1, _DSM, 0, 0, 64 | 0 ]; -var denseStringMap = 128 | 0; -var denseStructMap: StaticMapSchema = [2, n1, _DSMe, - 0, 0, () => greetingStruct +var DenseStringMap = 128 | 0; +var DenseStructMap: StaticMapSchema = [2, n1, _DSMe, + 0, 0, () => GreetingStructSchema ]; -var sparseBooleanMap: StaticMapSchema = [2, n1, _SBM, +var SparseBooleanMap: StaticMapSchema = [2, n1, _SBM, { [_s]: 1 }, 0, 2 ]; -var sparseNumberMap: StaticMapSchema = [2, n1, _SNM, +var SparseNumberMap: StaticMapSchema = [2, n1, _SNM, { [_s]: 1 }, 0, 1 ]; -var sparseSetMap: StaticMapSchema = [2, n1, _SSM, +var SparseSetMap: StaticMapSchema = [2, n1, _SSM, { [_s]: 1 }, 0, 64 | 0 ]; -var sparseStructMap: StaticMapSchema = [2, n1, _SSMp, - { [_s]: 1 }, 0, () => greetingStruct +var SparseStructMap: StaticMapSchema = [2, n1, _SSMp, + { [_s]: 1 }, 0, () => GreetingStructSchema ]; -var testStringMap = 128 | 0; -var sparseStringMap: StaticMapSchema = [2, n2, _SSMpa, +var TestStringMap = 128 | 0; +var SparseStringMap: StaticMapSchema = [2, n2, _SSMpa, { [_s]: 1 }, 0, 0 ]; -export var emptyInputOutput: StaticOperationSchema = [9, n1, _EIO, - 0, () => emptyStructure, () => emptyStructure +export var EmptyInputOutputSchema: StaticOperationSchema = [9, n1, _EIO, + 0, () => EmptyStructureSchema, () => EmptyStructureSchema ]; -export var float16: StaticOperationSchema = [9, n1, _Fl, - 0, () => __Unit, () => float16Output +export var Float16Schema: StaticOperationSchema = [9, n1, _Fl, + 0, () => __Unit, () => Float16OutputSchema ]; -export var fractionalSeconds: StaticOperationSchema = [9, n1, _FS, - 0, () => __Unit, () => fractionalSecondsOutput +export var FractionalSecondsSchema: StaticOperationSchema = [9, n1, _FS, + 0, () => __Unit, () => FractionalSecondsOutputSchema ]; -export var greetingWithErrors: StaticOperationSchema = [9, n1, _GWE, - 2, () => __Unit, () => greetingWithErrorsOutput +export var GreetingWithErrorsSchema: StaticOperationSchema = [9, n1, _GWE, + 2, () => __Unit, () => GreetingWithErrorsOutputSchema ]; -export var noInputOutput: StaticOperationSchema = [9, n1, _NIO, +export var NoInputOutputSchema: StaticOperationSchema = [9, n1, _NIO, 0, () => __Unit, () => __Unit ]; -export var operationWithDefaults: StaticOperationSchema = [9, n1, _OWD, - 0, () => operationWithDefaultsInput, () => operationWithDefaultsOutput +export var OperationWithDefaultsSchema: StaticOperationSchema = [9, n1, _OWD, + 0, () => OperationWithDefaultsInputSchema, () => OperationWithDefaultsOutputSchema ]; -export var optionalInputOutput: StaticOperationSchema = [9, n1, _OIO, - 0, () => simpleStructure, () => simpleStructure +export var OptionalInputOutputSchema: StaticOperationSchema = [9, n1, _OIO, + 0, () => SimpleStructureSchema, () => SimpleStructureSchema ]; -export var recursiveShapes: StaticOperationSchema = [9, n1, _RS, - 0, () => recursiveShapesInputOutput, () => recursiveShapesInputOutput +export var RecursiveShapesSchema: StaticOperationSchema = [9, n1, _RS, + 0, () => RecursiveShapesInputOutputSchema, () => RecursiveShapesInputOutputSchema ]; -export var rpcV2CborDenseMaps: StaticOperationSchema = [9, n1, _RVCDM, - 0, () => rpcV2CborDenseMapsInputOutput, () => rpcV2CborDenseMapsInputOutput +export var RpcV2CborDenseMapsSchema: StaticOperationSchema = [9, n1, _RVCDM, + 0, () => RpcV2CborDenseMapsInputOutputSchema, () => RpcV2CborDenseMapsInputOutputSchema ]; -export var rpcV2CborLists: StaticOperationSchema = [9, n1, _RVCL, - 2, () => rpcV2CborListInputOutput, () => rpcV2CborListInputOutput +export var RpcV2CborListsSchema: StaticOperationSchema = [9, n1, _RVCL, + 2, () => RpcV2CborListInputOutputSchema, () => RpcV2CborListInputOutputSchema ]; -export var rpcV2CborSparseMaps: StaticOperationSchema = [9, n1, _RVCSM, - 0, () => rpcV2CborSparseMapsInputOutput, () => rpcV2CborSparseMapsInputOutput +export var RpcV2CborSparseMapsSchema: StaticOperationSchema = [9, n1, _RVCSM, + 0, () => RpcV2CborSparseMapsInputOutputSchema, () => RpcV2CborSparseMapsInputOutputSchema ]; -export var simpleScalarProperties: StaticOperationSchema = [9, n1, _SSP, - 0, () => simpleScalarStructure, () => simpleScalarStructure +export var SimpleScalarPropertiesSchema: StaticOperationSchema = [9, n1, _SSP, + 0, () => SimpleScalarStructureSchema, () => SimpleScalarStructureSchema ]; -export var sparseNullsOperation: StaticOperationSchema = [9, n1, _SNO, - 0, () => sparseNullsOperationInputOutput, () => sparseNullsOperationInputOutput +export var SparseNullsOperationSchema: StaticOperationSchema = [9, n1, _SNO, + 0, () => SparseNullsOperationInputOutputSchema, () => SparseNullsOperationInputOutputSchema ]; diff --git a/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs b/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs index f2555ccb421..c494a025fbf 100644 --- a/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs +++ b/private/smithy-rpcv2-cbor-schema/test/index-objects.spec.mjs @@ -1,64 +1,64 @@ import { + ClientOptionalDefaultsSchema, ComplexError, + ComplexErrorSchema, + ComplexNestedErrorDataSchema, + DefaultsSchema, EmptyInputOutputCommand, + EmptyInputOutputSchema, + EmptyStructureSchema, Float16Command, + Float16OutputSchema, + Float16Schema, FooEnum, FractionalSecondsCommand, + FractionalSecondsOutputSchema, + FractionalSecondsSchema, + GreetingStructSchema, GreetingWithErrorsCommand, + GreetingWithErrorsOutputSchema, + GreetingWithErrorsSchema, IntegerEnum, InvalidGreeting, + InvalidGreetingSchema, NoInputOutputCommand, + NoInputOutputSchema, OperationWithDefaultsCommand, + OperationWithDefaultsInputSchema, + OperationWithDefaultsOutputSchema, + OperationWithDefaultsSchema, OptionalInputOutputCommand, + OptionalInputOutputSchema, RecursiveShapesCommand, + RecursiveShapesInputOutputNested1Schema, + RecursiveShapesInputOutputNested2Schema, + RecursiveShapesInputOutputSchema, + RecursiveShapesSchema, RpcV2CborDenseMapsCommand, + RpcV2CborDenseMapsInputOutputSchema, + RpcV2CborDenseMapsSchema, + RpcV2CborListInputOutputSchema, RpcV2CborListsCommand, + RpcV2CborListsSchema, RpcV2CborSparseMapsCommand, + RpcV2CborSparseMapsInputOutputSchema, + RpcV2CborSparseMapsSchema, RpcV2Protocol, RpcV2ProtocolClient, RpcV2ProtocolServiceException, SimpleScalarPropertiesCommand, + SimpleScalarPropertiesSchema, + SimpleScalarStructureSchema, + SimpleStructureSchema, SparseNullsOperationCommand, + SparseNullsOperationInputOutputSchema, + SparseNullsOperationSchema, + StructureListMemberSchema, TestEnum, TestIntEnum, ValidationException, - clientOptionalDefaults, - complexError, - complexNestedErrorData, - defaults, - emptyInputOutput, - emptyStructure, - float16, - float16Output, - fractionalSeconds, - fractionalSecondsOutput, - greetingStruct, - greetingWithErrors, - greetingWithErrorsOutput, - invalidGreeting, - noInputOutput, - operationWithDefaults, - operationWithDefaultsInput, - operationWithDefaultsOutput, - optionalInputOutput, - recursiveShapes, - recursiveShapesInputOutput, - recursiveShapesInputOutputNested1, - recursiveShapesInputOutputNested2, - rpcV2CborDenseMaps, - rpcV2CborDenseMapsInputOutput, - rpcV2CborListInputOutput, - rpcV2CborLists, - rpcV2CborSparseMaps, - rpcV2CborSparseMapsInputOutput, - simpleScalarProperties, - simpleScalarStructure, - simpleStructure, - sparseNullsOperation, - sparseNullsOperationInputOutput, - structureListMember, - validationException, - validationExceptionField, + ValidationExceptionFieldSchema, + ValidationExceptionSchema, } from "../dist-cjs/index.js"; import assert from "node:assert"; // clients @@ -66,53 +66,53 @@ assert(typeof RpcV2ProtocolClient === "function"); assert(typeof RpcV2Protocol === "function"); // commands assert(typeof EmptyInputOutputCommand === "function"); -assert(typeof emptyInputOutput === "object"); +assert(typeof EmptyInputOutputSchema === "object"); assert(typeof Float16Command === "function"); -assert(typeof float16 === "object"); +assert(typeof Float16Schema === "object"); assert(typeof FractionalSecondsCommand === "function"); -assert(typeof fractionalSeconds === "object"); +assert(typeof FractionalSecondsSchema === "object"); assert(typeof GreetingWithErrorsCommand === "function"); -assert(typeof greetingWithErrors === "object"); +assert(typeof GreetingWithErrorsSchema === "object"); assert(typeof NoInputOutputCommand === "function"); -assert(typeof noInputOutput === "object"); +assert(typeof NoInputOutputSchema === "object"); assert(typeof OperationWithDefaultsCommand === "function"); -assert(typeof operationWithDefaults === "object"); +assert(typeof OperationWithDefaultsSchema === "object"); assert(typeof OptionalInputOutputCommand === "function"); -assert(typeof optionalInputOutput === "object"); +assert(typeof OptionalInputOutputSchema === "object"); assert(typeof RecursiveShapesCommand === "function"); -assert(typeof recursiveShapes === "object"); +assert(typeof RecursiveShapesSchema === "object"); assert(typeof RpcV2CborDenseMapsCommand === "function"); -assert(typeof rpcV2CborDenseMaps === "object"); +assert(typeof RpcV2CborDenseMapsSchema === "object"); assert(typeof RpcV2CborListsCommand === "function"); -assert(typeof rpcV2CborLists === "object"); +assert(typeof RpcV2CborListsSchema === "object"); assert(typeof RpcV2CborSparseMapsCommand === "function"); -assert(typeof rpcV2CborSparseMaps === "object"); +assert(typeof RpcV2CborSparseMapsSchema === "object"); assert(typeof SimpleScalarPropertiesCommand === "function"); -assert(typeof simpleScalarProperties === "object"); +assert(typeof SimpleScalarPropertiesSchema === "object"); assert(typeof SparseNullsOperationCommand === "function"); -assert(typeof sparseNullsOperation === "object"); +assert(typeof SparseNullsOperationSchema === "object"); // structural schemas -assert(typeof validationExceptionField === "object"); -assert(typeof clientOptionalDefaults === "object"); -assert(typeof complexNestedErrorData === "object"); -assert(typeof defaults === "object"); -assert(typeof emptyStructure === "object"); -assert(typeof float16Output === "object"); -assert(typeof fractionalSecondsOutput === "object"); -assert(typeof greetingWithErrorsOutput === "object"); -assert(typeof operationWithDefaultsInput === "object"); -assert(typeof operationWithDefaultsOutput === "object"); -assert(typeof recursiveShapesInputOutput === "object"); -assert(typeof recursiveShapesInputOutputNested1 === "object"); -assert(typeof recursiveShapesInputOutputNested2 === "object"); -assert(typeof rpcV2CborDenseMapsInputOutput === "object"); -assert(typeof rpcV2CborListInputOutput === "object"); -assert(typeof rpcV2CborSparseMapsInputOutput === "object"); -assert(typeof simpleScalarStructure === "object"); -assert(typeof simpleStructure === "object"); -assert(typeof sparseNullsOperationInputOutput === "object"); -assert(typeof structureListMember === "object"); -assert(typeof greetingStruct === "object"); +assert(typeof ValidationExceptionFieldSchema === "object"); +assert(typeof ClientOptionalDefaultsSchema === "object"); +assert(typeof ComplexNestedErrorDataSchema === "object"); +assert(typeof DefaultsSchema === "object"); +assert(typeof EmptyStructureSchema === "object"); +assert(typeof Float16OutputSchema === "object"); +assert(typeof FractionalSecondsOutputSchema === "object"); +assert(typeof GreetingWithErrorsOutputSchema === "object"); +assert(typeof OperationWithDefaultsInputSchema === "object"); +assert(typeof OperationWithDefaultsOutputSchema === "object"); +assert(typeof RecursiveShapesInputOutputSchema === "object"); +assert(typeof RecursiveShapesInputOutputNested1Schema === "object"); +assert(typeof RecursiveShapesInputOutputNested2Schema === "object"); +assert(typeof RpcV2CborDenseMapsInputOutputSchema === "object"); +assert(typeof RpcV2CborListInputOutputSchema === "object"); +assert(typeof RpcV2CborSparseMapsInputOutputSchema === "object"); +assert(typeof SimpleScalarStructureSchema === "object"); +assert(typeof SimpleStructureSchema === "object"); +assert(typeof SparseNullsOperationInputOutputSchema === "object"); +assert(typeof StructureListMemberSchema === "object"); +assert(typeof GreetingStructSchema === "object"); // enums assert(typeof TestEnum === "object"); assert(typeof TestIntEnum === "object"); @@ -120,10 +120,10 @@ assert(typeof FooEnum === "object"); assert(typeof IntegerEnum === "object"); // errors assert(ValidationException.prototype instanceof RpcV2ProtocolServiceException); -assert(typeof validationException === "object"); +assert(typeof ValidationExceptionSchema === "object"); assert(ComplexError.prototype instanceof RpcV2ProtocolServiceException); -assert(typeof complexError === "object"); +assert(typeof ComplexErrorSchema === "object"); assert(InvalidGreeting.prototype instanceof RpcV2ProtocolServiceException); -assert(typeof invalidGreeting === "object"); +assert(typeof InvalidGreetingSchema === "object"); assert(RpcV2ProtocolServiceException.prototype instanceof Error); console.log(`RpcV2Protocol index test passed.`); diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java index 802640b305c..c107ef59364 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/knowledge/ServiceClosure.java @@ -216,11 +216,11 @@ public String getShapeSchemaVariableName(Shape shape, StringStore store) { * The name transform deconflicts the interface and structure variable names. * for export at the top level of the same package. */ - if (Character.isUpperCase(symbolName.charAt(0)) && !Character.isUpperCase(symbolName.charAt(1))) { - return Character.toLowerCase(symbolName.charAt(0)) + symbolName.substring(1); + String suffix = ""; + if (shape.isStructureShape() || shape.isUnionShape() || shape.isOperationShape()) { + suffix = "Schema"; } - String conflictingSchemaSuffix = "$"; - return symbolName + conflictingSchemaSuffix; + return symbolName + suffix; } /** diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java index 4c653ab8569..263ec471adf 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java @@ -125,20 +125,14 @@ private void writeSimpleSchema(Shape shape) { private void writeStructureSchema(StructureShape shape) { checkedWriteSchema(shape, () -> { - String symbolName = ServiceClosure.RESERVED_WORDS.escape(shape.getId().getName()); + String exceptionCtorSymbolName = ServiceClosure.RESERVED_WORDS.escape(shape.getId().getName()); if (shape.hasTrait(ErrorTrait.class)) { - String exceptionCtorSymbolName = "__" + symbolName; writer.addTypeImport("StaticErrorSchema", null, TypeScriptDependency.SMITHY_TYPES); - writer.addRelativeImport(symbolName, exceptionCtorSymbolName, Paths.get("..", "models", "errors")); - writer.openBlock( - """ - export var $L: StaticErrorSchema = [-3, $L, $L,""", - "];", + writer.addRelativeImport(exceptionCtorSymbolName, null, Paths.get("..", "models", "errors")); + writer.openBlock(""" + export var $L: StaticErrorSchema = [-3, $L, $L,""", "];", getShapeVariableName(shape), - store.var(shape.getId().getNamespace(), "n"), - store.var(shape.getId().getName()), - () -> doWithMembers(shape) - ); + store.var(shape.getId().getNamespace(), "n"), store.var(shape.getId().getName()), () -> doWithMembers(shape)); writer.addImportSubmodule("TypeRegistry", null, TypeScriptDependency.SMITHY_CORE, "/schema"); writer.write( """ @@ -167,35 +161,33 @@ private void writeStructureSchema(StructureShape shape) { */ private void writeBaseError() { String serviceName = CodegenUtils.getServiceName(settings, model, symbolProvider); - String serviceExceptionName = CodegenUtils.getSyntheticBaseExceptionName( - serviceName, model - ); - String schemaSymbolName = serviceExceptionName + "$"; + String syntheticBaseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(serviceName, model); + String schemaSymbolName = syntheticBaseExceptionName + "$"; String namespace = settings.getService(model).getId().getNamespace(); writer.addTypeImport("StaticErrorSchema", null, TypeScriptDependency.SMITHY_TYPES); writer.addRelativeImport( - serviceExceptionName, + syntheticBaseExceptionName, null, - Paths.get("..", "models", serviceExceptionName) + Paths.get("..", "models", syntheticBaseExceptionName) ); String syntheticNamespace = store.var("smithy.ts.sdk.synthetic." + namespace); writer.write( """ export var $L: StaticErrorSchema = [-3, $L, $S, 0, [], []];""", - serviceExceptionName, + schemaSymbolName, syntheticNamespace, - serviceExceptionName + syntheticBaseExceptionName ); writer.addImportSubmodule("TypeRegistry", null, TypeScriptDependency.SMITHY_CORE, "/schema"); writer.write( """ TypeRegistry.for($L).registerError($L, $L);""", syntheticNamespace, - schemaSymbolName, - serviceExceptionName + schemaSymbolName, + syntheticBaseExceptionName ); } From 158c2b8713c617e8ed8b289df77705b8f65149bd Mon Sep 17 00:00:00 2001 From: George Fu Date: Fri, 12 Dec 2025 12:09:41 -0500 Subject: [PATCH 3/3] rename schema exports with schema suffix --- .../typescript/codegen/schema/SchemaGenerator.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java index 263ec471adf..5ee6a8685bc 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/schema/SchemaGenerator.java @@ -129,10 +129,15 @@ private void writeStructureSchema(StructureShape shape) { if (shape.hasTrait(ErrorTrait.class)) { writer.addTypeImport("StaticErrorSchema", null, TypeScriptDependency.SMITHY_TYPES); writer.addRelativeImport(exceptionCtorSymbolName, null, Paths.get("..", "models", "errors")); - writer.openBlock(""" - export var $L: StaticErrorSchema = [-3, $L, $L,""", "];", + writer.openBlock( + """ + export var $L: StaticErrorSchema = [-3, $L, $L,""", + "];", getShapeVariableName(shape), - store.var(shape.getId().getNamespace(), "n"), store.var(shape.getId().getName()), () -> doWithMembers(shape)); + store.var(shape.getId().getNamespace(), "n"), + store.var(shape.getId().getName()), + () -> doWithMembers(shape) + ); writer.addImportSubmodule("TypeRegistry", null, TypeScriptDependency.SMITHY_CORE, "/schema"); writer.write( """