diff --git a/Makefile b/Makefile index 365833b258c..df201dfa707 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ generate-protocol-tests: npx prettier --write ./private/smithy-rpcv2-cbor-schema npx prettier --write ./private/my-local-model yarn + (cd ./private/smithy-rpcv2-cbor && npm run build) + (cd ./private/smithy-rpcv2-cbor-schema && npm run build) + (cd ./private/my-local-model && npm run build) test-protocols: (cd ./private/smithy-rpcv2-cbor && npx vitest run --globals) diff --git a/private/my-local-model/src/index.ts b/private/my-local-model/src/index.ts index 05a8a6f53f1..93c77a3b62c 100644 --- a/private/my-local-model/src/index.ts +++ b/private/my-local-model/src/index.ts @@ -11,6 +11,15 @@ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; export type { RuntimeExtension } from "./runtimeExtensions"; export type { XYZServiceExtensionConfiguration } from "./extensionConfiguration"; export * from "./commands"; -export * from "./models"; + +export * from "./models/errors"; +export type { + Alpha, + GetNumbersRequest, + GetNumbersResponse, + TradeEventStreamRequest, + TradeEventStreamResponse, + Unit, +} from "./models/models_0"; export { XYZServiceSyntheticServiceException } from "./models/XYZServiceSyntheticServiceException"; diff --git a/private/my-local-model/src/models/errors.ts b/private/my-local-model/src/models/errors.ts new file mode 100644 index 00000000000..e100057ce44 --- /dev/null +++ b/private/my-local-model/src/models/errors.ts @@ -0,0 +1,105 @@ +// smithy-typescript generated code +import { XYZServiceSyntheticServiceException as __BaseException } from "./XYZServiceSyntheticServiceException"; +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +/** + * @public + */ +export class CodedThrottlingError extends __BaseException { + readonly name = "CodedThrottlingError" as const; + readonly $fault = "client" as const; + $retryable = { + throttling: true, + }; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "CodedThrottlingError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, CodedThrottlingError.prototype); + } +} + +/** + * @public + */ +export class HaltError extends __BaseException { + readonly name = "HaltError" as const; + readonly $fault = "client" as const; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "HaltError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, HaltError.prototype); + } +} + +/** + * @public + */ +export class MysteryThrottlingError extends __BaseException { + readonly name = "MysteryThrottlingError" as const; + readonly $fault = "client" as const; + $retryable = { + throttling: true, + }; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "MysteryThrottlingError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, MysteryThrottlingError.prototype); + } +} + +/** + * @public + */ +export class RetryableError extends __BaseException { + readonly name = "RetryableError" as const; + readonly $fault = "client" as const; + $retryable = {}; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "RetryableError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, RetryableError.prototype); + } +} + +/** + * @public + */ +export class XYZServiceServiceException extends __BaseException { + readonly name = "XYZServiceServiceException" as const; + readonly $fault = "client" as const; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "XYZServiceServiceException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, XYZServiceServiceException.prototype); + } +} diff --git a/private/my-local-model/src/models/index.ts b/private/my-local-model/src/models/index.ts deleted file mode 100644 index 9eaceb12865..00000000000 --- a/private/my-local-model/src/models/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// smithy-typescript generated code -export * from "./models_0"; diff --git a/private/my-local-model/src/models/models_0.ts b/private/my-local-model/src/models/models_0.ts index f223d6eab1b..9896213618c 100644 --- a/private/my-local-model/src/models/models_0.ts +++ b/private/my-local-model/src/models/models_0.ts @@ -1,7 +1,5 @@ // smithy-typescript generated code -import { XYZServiceSyntheticServiceException as __BaseException } from "./XYZServiceSyntheticServiceException"; import { NumericValue } from "@smithy/core/serde"; -import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; /** * @public @@ -11,28 +9,6 @@ export interface Alpha { timestamp?: Date | undefined; } -/** - * @public - */ -export class CodedThrottlingError extends __BaseException { - readonly name: "CodedThrottlingError" = "CodedThrottlingError"; - readonly $fault: "client" = "client"; - $retryable = { - throttling: true, - }; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "CodedThrottlingError", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, CodedThrottlingError.prototype); - } -} - /** * @public */ @@ -64,86 +40,6 @@ export interface GetNumbersResponse { bigInteger?: bigint | undefined; } -/** - * @public - */ -export class HaltError extends __BaseException { - readonly name: "HaltError" = "HaltError"; - readonly $fault: "client" = "client"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "HaltError", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, HaltError.prototype); - } -} - -/** - * @public - */ -export class MysteryThrottlingError extends __BaseException { - readonly name: "MysteryThrottlingError" = "MysteryThrottlingError"; - readonly $fault: "client" = "client"; - $retryable = { - throttling: true, - }; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "MysteryThrottlingError", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, MysteryThrottlingError.prototype); - } -} - -/** - * @public - */ -export class RetryableError extends __BaseException { - readonly name: "RetryableError" = "RetryableError"; - readonly $fault: "client" = "client"; - $retryable = {}; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "RetryableError", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, RetryableError.prototype); - } -} - -/** - * @public - */ -export class XYZServiceServiceException extends __BaseException { - readonly name: "XYZServiceServiceException" = "XYZServiceServiceException"; - readonly $fault: "client" = "client"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "XYZServiceServiceException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, XYZServiceServiceException.prototype); - } -} - /** * @public */ diff --git a/private/my-local-model/src/protocols/Rpcv2cbor.ts b/private/my-local-model/src/protocols/Rpcv2cbor.ts index f9ac97b3795..ad782b8ad87 100644 --- a/private/my-local-model/src/protocols/Rpcv2cbor.ts +++ b/private/my-local-model/src/protocols/Rpcv2cbor.ts @@ -3,17 +3,13 @@ import { GetNumbersCommandInput, GetNumbersCommandOutput } from "../commands/Get import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "../commands/TradeEventStreamCommand"; import { XYZServiceSyntheticServiceException as __BaseException } from "../models/XYZServiceSyntheticServiceException"; import { - Alpha, CodedThrottlingError, - GetNumbersRequest, - GetNumbersResponse, HaltError, MysteryThrottlingError, RetryableError, - TradeEvents, - Unit, XYZServiceServiceException, -} from "../models/models_0"; +} from "../models/errors"; +import { Alpha, GetNumbersRequest, GetNumbersResponse, TradeEvents, Unit } from "../models/models_0"; import { dateToTag as __dateToTag, buildHttpRpcRequest, diff --git a/private/smithy-rpcv2-cbor-schema/src/index.ts b/private/smithy-rpcv2-cbor-schema/src/index.ts index 8a7113aa6bd..406aa4f9bba 100644 --- a/private/smithy-rpcv2-cbor-schema/src/index.ts +++ b/private/smithy-rpcv2-cbor-schema/src/index.ts @@ -6,6 +6,31 @@ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; export type { RuntimeExtension } from "./runtimeExtensions"; export type { RpcV2ProtocolExtensionConfiguration } from "./extensionConfiguration"; export * from "./commands"; -export * from "./models"; + +export * from "./models/enums"; +export * from "./models/errors"; +export type { + ClientOptionalDefaults, + ComplexNestedErrorData, + Defaults, + EmptyStructure, + Float16Output, + FractionalSecondsOutput, + GreetingStruct, + GreetingWithErrorsOutput, + OperationWithDefaultsInput, + OperationWithDefaultsOutput, + RecursiveShapesInputOutput, + RecursiveShapesInputOutputNested1, + RecursiveShapesInputOutputNested2, + RpcV2CborDenseMapsInputOutput, + RpcV2CborListInputOutput, + RpcV2CborSparseMapsInputOutput, + SimpleScalarStructure, + SimpleStructure, + SparseNullsOperationInputOutput, + StructureListMember, + ValidationExceptionField, +} from "./models/models_0"; export { RpcV2ProtocolServiceException } from "./models/RpcV2ProtocolServiceException"; diff --git a/private/smithy-rpcv2-cbor-schema/src/models/enums.ts b/private/smithy-rpcv2-cbor-schema/src/models/enums.ts new file mode 100644 index 00000000000..da44d387315 --- /dev/null +++ b/private/smithy-rpcv2-cbor-schema/src/models/enums.ts @@ -0,0 +1,41 @@ +// smithy-typescript generated code +/** + * @public + * @enum + */ +export const TestEnum = { + BAR: "BAR", + BAZ: "BAZ", + FOO: "FOO", +} as const; +/** + * @public + */ +export type TestEnum = (typeof TestEnum)[keyof typeof TestEnum]; + +export enum TestIntEnum { + ONE = 1, + TWO = 2, +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} diff --git a/private/smithy-rpcv2-cbor-schema/src/models/errors.ts b/private/smithy-rpcv2-cbor-schema/src/models/errors.ts new file mode 100644 index 00000000000..cae36af1f34 --- /dev/null +++ b/private/smithy-rpcv2-cbor-schema/src/models/errors.ts @@ -0,0 +1,80 @@ +// smithy-typescript generated code +import { RpcV2ProtocolServiceException as __BaseException } from "./RpcV2ProtocolServiceException"; +import { ComplexNestedErrorData, ValidationExceptionField } from "./models_0"; +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +/** + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * @public + */ +export class ValidationException extends __BaseException { + readonly name = "ValidationException" as const; + readonly $fault = "client" as const; + /** + * A list of specific failures encountered while validating the input. + * A member can appear in this list more than once if it failed to satisfy multiple constraints. + * @public + */ + fieldList?: ValidationExceptionField[] | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.fieldList = opts.fieldList; + } +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name = "ComplexError" as const; + readonly $fault = "client" as const; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name = "InvalidGreeting" as const; + readonly $fault = "client" as const; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} diff --git a/private/smithy-rpcv2-cbor-schema/src/models/index.ts b/private/smithy-rpcv2-cbor-schema/src/models/index.ts deleted file mode 100644 index 9eaceb12865..00000000000 --- a/private/smithy-rpcv2-cbor-schema/src/models/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// smithy-typescript generated code -export * from "./models_0"; diff --git a/private/smithy-rpcv2-cbor-schema/src/models/models_0.ts b/private/smithy-rpcv2-cbor-schema/src/models/models_0.ts index caf9a41e11e..334dbcef5f7 100644 --- a/private/smithy-rpcv2-cbor-schema/src/models/models_0.ts +++ b/private/smithy-rpcv2-cbor-schema/src/models/models_0.ts @@ -1,6 +1,5 @@ // smithy-typescript generated code -import { RpcV2ProtocolServiceException as __BaseException } from "./RpcV2ProtocolServiceException"; -import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; +import { FooEnum, IntegerEnum, TestEnum, TestIntEnum } from "./enums"; /** * Describes one specific validation failure for an input member. @@ -20,36 +19,6 @@ export interface ValidationExceptionField { message: string | undefined; } -/** - * A standard error for input validation failures. - * This should be thrown by services when a member of the input structure - * falls outside of the modeled or documented constraints. - * @public - */ -export class ValidationException extends __BaseException { - readonly name: "ValidationException" = "ValidationException"; - readonly $fault: "client" = "client"; - /** - * A list of specific failures encountered while validating the input. - * A member can appear in this list more than once if it failed to satisfy multiple constraints. - * @public - */ - fieldList?: ValidationExceptionField[] | undefined; - - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ValidationException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ValidationException.prototype); - this.fieldList = opts.fieldList; - } -} - /** * @public */ @@ -64,49 +33,6 @@ export interface ComplexNestedErrorData { Foo?: string | undefined; } -/** - * This error is thrown when a request is invalid. - * @public - */ -export class ComplexError extends __BaseException { - readonly name: "ComplexError" = "ComplexError"; - readonly $fault: "client" = "client"; - TopLevel?: string | undefined; - Nested?: ComplexNestedErrorData | undefined; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ComplexError", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ComplexError.prototype); - this.TopLevel = opts.TopLevel; - this.Nested = opts.Nested; - } -} - -/** - * @public - * @enum - */ -export const TestEnum = { - BAR: "BAR", - BAZ: "BAZ", - FOO: "FOO", -} as const; -/** - * @public - */ -export type TestEnum = (typeof TestEnum)[keyof typeof TestEnum]; - -export enum TestIntEnum { - ONE = 1, - TWO = 2, -} - /** * @public */ @@ -169,28 +95,6 @@ export interface GreetingWithErrorsOutput { greeting?: string | undefined; } -/** - * This error is thrown when an invalid greeting value is provided. - * @public - */ -export class InvalidGreeting extends __BaseException { - readonly name: "InvalidGreeting" = "InvalidGreeting"; - readonly $fault: "client" = "client"; - Message?: string | undefined; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InvalidGreeting", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidGreeting.prototype); - this.Message = opts.Message; - } -} - /** * @public */ @@ -248,28 +152,6 @@ export interface RpcV2CborDenseMapsInputOutput { denseSetMap?: Record | undefined; } -/** - * @public - * @enum - */ -export const FooEnum = { - BAR: "Bar", - BAZ: "Baz", - FOO: "Foo", - ONE: "1", - ZERO: "0", -} as const; -/** - * @public - */ -export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; - -export enum IntegerEnum { - A = 1, - B = 2, - C = 3, -} - /** * @public */ 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 4bd8aaf6590..6acd25c002c 100644 --- a/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts +++ b/private/smithy-rpcv2-cbor-schema/src/schemas/schemas_0.ts @@ -136,7 +136,7 @@ import { ComplexError as __ComplexError, InvalidGreeting as __InvalidGreeting, ValidationException as __ValidationException, -} from "../models/index"; +} from "../models/errors"; import { TypeRegistry } from "@smithy/core/schema"; import { StaticErrorSchema, diff --git a/private/smithy-rpcv2-cbor/src/index.ts b/private/smithy-rpcv2-cbor/src/index.ts index 8a7113aa6bd..406aa4f9bba 100644 --- a/private/smithy-rpcv2-cbor/src/index.ts +++ b/private/smithy-rpcv2-cbor/src/index.ts @@ -6,6 +6,31 @@ export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; export type { RuntimeExtension } from "./runtimeExtensions"; export type { RpcV2ProtocolExtensionConfiguration } from "./extensionConfiguration"; export * from "./commands"; -export * from "./models"; + +export * from "./models/enums"; +export * from "./models/errors"; +export type { + ClientOptionalDefaults, + ComplexNestedErrorData, + Defaults, + EmptyStructure, + Float16Output, + FractionalSecondsOutput, + GreetingStruct, + GreetingWithErrorsOutput, + OperationWithDefaultsInput, + OperationWithDefaultsOutput, + RecursiveShapesInputOutput, + RecursiveShapesInputOutputNested1, + RecursiveShapesInputOutputNested2, + RpcV2CborDenseMapsInputOutput, + RpcV2CborListInputOutput, + RpcV2CborSparseMapsInputOutput, + SimpleScalarStructure, + SimpleStructure, + SparseNullsOperationInputOutput, + StructureListMember, + ValidationExceptionField, +} from "./models/models_0"; export { RpcV2ProtocolServiceException } from "./models/RpcV2ProtocolServiceException"; diff --git a/private/smithy-rpcv2-cbor/src/models/enums.ts b/private/smithy-rpcv2-cbor/src/models/enums.ts new file mode 100644 index 00000000000..da44d387315 --- /dev/null +++ b/private/smithy-rpcv2-cbor/src/models/enums.ts @@ -0,0 +1,41 @@ +// smithy-typescript generated code +/** + * @public + * @enum + */ +export const TestEnum = { + BAR: "BAR", + BAZ: "BAZ", + FOO: "FOO", +} as const; +/** + * @public + */ +export type TestEnum = (typeof TestEnum)[keyof typeof TestEnum]; + +export enum TestIntEnum { + ONE = 1, + TWO = 2, +} + +/** + * @public + * @enum + */ +export const FooEnum = { + BAR: "Bar", + BAZ: "Baz", + FOO: "Foo", + ONE: "1", + ZERO: "0", +} as const; +/** + * @public + */ +export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; + +export enum IntegerEnum { + A = 1, + B = 2, + C = 3, +} diff --git a/private/smithy-rpcv2-cbor/src/models/errors.ts b/private/smithy-rpcv2-cbor/src/models/errors.ts new file mode 100644 index 00000000000..cae36af1f34 --- /dev/null +++ b/private/smithy-rpcv2-cbor/src/models/errors.ts @@ -0,0 +1,80 @@ +// smithy-typescript generated code +import { RpcV2ProtocolServiceException as __BaseException } from "./RpcV2ProtocolServiceException"; +import { ComplexNestedErrorData, ValidationExceptionField } from "./models_0"; +import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; + +/** + * A standard error for input validation failures. + * This should be thrown by services when a member of the input structure + * falls outside of the modeled or documented constraints. + * @public + */ +export class ValidationException extends __BaseException { + readonly name = "ValidationException" as const; + readonly $fault = "client" as const; + /** + * A list of specific failures encountered while validating the input. + * A member can appear in this list more than once if it failed to satisfy multiple constraints. + * @public + */ + fieldList?: ValidationExceptionField[] | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + this.fieldList = opts.fieldList; + } +} + +/** + * This error is thrown when a request is invalid. + * @public + */ +export class ComplexError extends __BaseException { + readonly name = "ComplexError" as const; + readonly $fault = "client" as const; + TopLevel?: string | undefined; + Nested?: ComplexNestedErrorData | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ComplexError", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ComplexError.prototype); + this.TopLevel = opts.TopLevel; + this.Nested = opts.Nested; + } +} + +/** + * This error is thrown when an invalid greeting value is provided. + * @public + */ +export class InvalidGreeting extends __BaseException { + readonly name = "InvalidGreeting" as const; + readonly $fault = "client" as const; + Message?: string | undefined; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidGreeting", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidGreeting.prototype); + this.Message = opts.Message; + } +} diff --git a/private/smithy-rpcv2-cbor/src/models/index.ts b/private/smithy-rpcv2-cbor/src/models/index.ts deleted file mode 100644 index 9eaceb12865..00000000000 --- a/private/smithy-rpcv2-cbor/src/models/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -// smithy-typescript generated code -export * from "./models_0"; diff --git a/private/smithy-rpcv2-cbor/src/models/models_0.ts b/private/smithy-rpcv2-cbor/src/models/models_0.ts index caf9a41e11e..334dbcef5f7 100644 --- a/private/smithy-rpcv2-cbor/src/models/models_0.ts +++ b/private/smithy-rpcv2-cbor/src/models/models_0.ts @@ -1,6 +1,5 @@ // smithy-typescript generated code -import { RpcV2ProtocolServiceException as __BaseException } from "./RpcV2ProtocolServiceException"; -import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; +import { FooEnum, IntegerEnum, TestEnum, TestIntEnum } from "./enums"; /** * Describes one specific validation failure for an input member. @@ -20,36 +19,6 @@ export interface ValidationExceptionField { message: string | undefined; } -/** - * A standard error for input validation failures. - * This should be thrown by services when a member of the input structure - * falls outside of the modeled or documented constraints. - * @public - */ -export class ValidationException extends __BaseException { - readonly name: "ValidationException" = "ValidationException"; - readonly $fault: "client" = "client"; - /** - * A list of specific failures encountered while validating the input. - * A member can appear in this list more than once if it failed to satisfy multiple constraints. - * @public - */ - fieldList?: ValidationExceptionField[] | undefined; - - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ValidationException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ValidationException.prototype); - this.fieldList = opts.fieldList; - } -} - /** * @public */ @@ -64,49 +33,6 @@ export interface ComplexNestedErrorData { Foo?: string | undefined; } -/** - * This error is thrown when a request is invalid. - * @public - */ -export class ComplexError extends __BaseException { - readonly name: "ComplexError" = "ComplexError"; - readonly $fault: "client" = "client"; - TopLevel?: string | undefined; - Nested?: ComplexNestedErrorData | undefined; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ComplexError", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ComplexError.prototype); - this.TopLevel = opts.TopLevel; - this.Nested = opts.Nested; - } -} - -/** - * @public - * @enum - */ -export const TestEnum = { - BAR: "BAR", - BAZ: "BAZ", - FOO: "FOO", -} as const; -/** - * @public - */ -export type TestEnum = (typeof TestEnum)[keyof typeof TestEnum]; - -export enum TestIntEnum { - ONE = 1, - TWO = 2, -} - /** * @public */ @@ -169,28 +95,6 @@ export interface GreetingWithErrorsOutput { greeting?: string | undefined; } -/** - * This error is thrown when an invalid greeting value is provided. - * @public - */ -export class InvalidGreeting extends __BaseException { - readonly name: "InvalidGreeting" = "InvalidGreeting"; - readonly $fault: "client" = "client"; - Message?: string | undefined; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InvalidGreeting", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidGreeting.prototype); - this.Message = opts.Message; - } -} - /** * @public */ @@ -248,28 +152,6 @@ export interface RpcV2CborDenseMapsInputOutput { denseSetMap?: Record | undefined; } -/** - * @public - * @enum - */ -export const FooEnum = { - BAR: "Bar", - BAZ: "Baz", - FOO: "Foo", - ONE: "1", - ZERO: "0", -} as const; -/** - * @public - */ -export type FooEnum = (typeof FooEnum)[keyof typeof FooEnum]; - -export enum IntegerEnum { - A = 1, - B = 2, - C = 3, -} - /** * @public */ diff --git a/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts b/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts index f587c35593c..51db653f0e9 100644 --- a/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts +++ b/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts @@ -28,17 +28,15 @@ import { SparseNullsOperationCommandOutput, } from "../commands/SparseNullsOperationCommand"; import { RpcV2ProtocolServiceException as __BaseException } from "../models/RpcV2ProtocolServiceException"; +import { FooEnum, IntegerEnum } from "../models/enums"; +import { ComplexError, InvalidGreeting, ValidationException } from "../models/errors"; import { ClientOptionalDefaults, - ComplexError, Defaults, EmptyStructure, Float16Output, - FooEnum, FractionalSecondsOutput, GreetingStruct, - IntegerEnum, - InvalidGreeting, OperationWithDefaultsInput, OperationWithDefaultsOutput, RecursiveShapesInputOutput, @@ -51,7 +49,6 @@ import { SimpleStructure, SparseNullsOperationInputOutput, StructureListMember, - ValidationException, } from "../models/models_0"; import { dateToTag as __dateToTag, diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/DirectedTypeScriptCodegen.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/DirectedTypeScriptCodegen.java index 66dceb458e8..58546db6bda 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/DirectedTypeScriptCodegen.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/DirectedTypeScriptCodegen.java @@ -449,8 +449,10 @@ public void customizeBeforeIntegrations( directive.fileManifest().writeFile(from, getClass(), to); }); - SymbolVisitor.writeModelIndex(directive.connectedShapes().values(), directive.symbolProvider(), - directive.fileManifest()); + TypeScriptWriter modelIndexer = SymbolVisitor.modelIndexer( + directive.connectedShapes().values(), + directive.symbolProvider() + ); // Generate the client Node and Browser configuration files. These // files are switched between in package.json based on the targeted @@ -497,17 +499,19 @@ public void customizeBeforeIntegrations( directive.model(), directive.symbolProvider(), directive.context().protocolGenerator(), - writer + writer, + modelIndexer ); }); if (directive.settings().generateServerSdk()) { // Generate index for server IndexGenerator.writeServerIndex( - directive.settings(), - directive.model(), - directive.symbolProvider(), - directive.fileManifest()); + directive.settings(), + directive.model(), + directive.symbolProvider(), + directive.fileManifest() + ); } // Generate protocol tests IFF found in the model. diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/IndexGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/IndexGenerator.java index bffbc382ed9..f07bc9d0d56 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/IndexGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/IndexGenerator.java @@ -45,7 +45,8 @@ static void writeIndex( Model model, SymbolProvider symbolProvider, ProtocolGenerator protocolGenerator, - TypeScriptWriter writer + TypeScriptWriter writer, + TypeScriptWriter modelIndexer ) { writer.write("/* eslint-disable */"); @@ -63,7 +64,10 @@ static void writeIndex( } // write export statement for models - writer.write("export * from \"./models\";"); + writer.write( + // the header comment is already present in the upper writer. + modelIndexer.toString().replace("// smithy-typescript generated code", "") + ); } private static void writeProtocolExports(ProtocolGenerator protocolGenerator, TypeScriptWriter writer) { @@ -72,10 +76,10 @@ private static void writeProtocolExports(ProtocolGenerator protocolGenerator, Ty } static void writeServerIndex( - TypeScriptSettings settings, - Model model, - SymbolProvider symbolProvider, - FileManifest fileManifest + TypeScriptSettings settings, + Model model, + SymbolProvider symbolProvider, + FileManifest fileManifest ) { TypeScriptWriter writer = new TypeScriptWriter(""); ServiceShape service = settings.getService(model); @@ -91,10 +95,10 @@ static void writeServerIndex( } private static void writeClientExports( - TypeScriptSettings settings, - Model model, - SymbolProvider symbolProvider, - TypeScriptWriter writer + TypeScriptSettings settings, + Model model, + SymbolProvider symbolProvider, + TypeScriptWriter writer ) { ServiceShape service = settings.getService(model); Symbol symbol = symbolProvider.toSymbol(service); diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructureGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructureGenerator.java index e69a5ada0da..96b5d0b47d0 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructureGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructureGenerator.java @@ -279,8 +279,8 @@ private void renderErrorStructure() { writer.writeShapeDocs(shape); boolean isServerSdk = this.includeValidation; writer.openBlock("export class $T extends $L {", symbol, "__BaseException"); - writer.write("readonly name: $1S = $1S;", shape.getId().getName()); - writer.write("readonly $$fault: $1S = $1S;", errorTrait.getValue()); + writer.write("readonly name = $1S as const;", shape.getId().getName()); + writer.write("readonly $$fault = $1S as const;", errorTrait.getValue()); if (!isServerSdk) { HttpProtocolGeneratorUtils.writeRetryableTrait(writer, shape, ";"); } diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SymbolVisitor.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SymbolVisitor.java index 4179e85c5d9..a43a87286f1 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SymbolVisitor.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/SymbolVisitor.java @@ -17,7 +17,6 @@ import static java.lang.String.format; -import java.nio.file.Paths; import java.util.Collection; import java.util.Comparator; import java.util.HashMap; @@ -26,9 +25,10 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; import java.util.logging.Logger; import java.util.regex.Matcher; -import software.amazon.smithy.build.FileManifest; import software.amazon.smithy.codegen.core.CodegenException; import software.amazon.smithy.codegen.core.ReservedWordSymbolProvider; import software.amazon.smithy.codegen.core.ReservedWords; @@ -66,6 +66,7 @@ import software.amazon.smithy.model.shapes.ToShapeId; import software.amazon.smithy.model.shapes.UnionShape; import software.amazon.smithy.model.traits.EnumTrait; +import software.amazon.smithy.model.traits.ErrorTrait; import software.amazon.smithy.model.traits.MediaTypeTrait; import software.amazon.smithy.model.traits.StreamingTrait; import software.amazon.smithy.model.traits.UnitTypeTrait; @@ -123,8 +124,8 @@ final class SymbolVisitor implements SymbolProvider, ShapeVisitor { moduleNameDelegator = new ModuleNameDelegator(shapeChunkSize); } - static void writeModelIndex(Collection shapes, SymbolProvider symbolProvider, FileManifest fileManifest) { - ModuleNameDelegator.writeModelIndex(shapes, symbolProvider, fileManifest); + static TypeScriptWriter modelIndexer(Collection shapes, SymbolProvider symbolProvider) { + return ModuleNameDelegator.modelIndexer(shapes, symbolProvider); } @Override @@ -478,9 +479,13 @@ public String formatModuleName(Shape shape, String name) { } else if (visitedModels.containsKey(shape)) { return visitedModels.get(shape); } - // Add models into buckets no bigger than chunk size. + String path; - if (shape.getId().equals(UnitTypeTrait.UNIT) || shape.isResourceShape()) { + if (shape.isEnumShape() || shape.isIntEnumShape()) { + path = String.join("/", ".", SHAPE_NAMESPACE_PREFIX, "enums"); + } else if (shape.isStructureShape() && shape.hasTrait(ErrorTrait.class)) { + path = String.join("/", ".", SHAPE_NAMESPACE_PREFIX, "errors"); + } else if (shape.getId().equals(UnitTypeTrait.UNIT) || shape.isResourceShape()) { // Unit or Resource shapes should only be put in the zero bucket, since they do not // generate anything. They also do not contribute to bucket size. path = String.join("/", ".", SHAPE_NAMESPACE_PREFIX, "models_0"); @@ -496,8 +501,10 @@ public String formatModuleName(Shape shape, String name) { return path; } - static void writeModelIndex(Collection shapes, SymbolProvider symbolProvider, - FileManifest fileManifest) { + static TypeScriptWriter modelIndexer( + Collection shapes, + SymbolProvider symbolProvider + ) { TypeScriptWriter writer = new TypeScriptWriter(""); String modelPrefix = String.join("/", ".", CodegenUtils.SOURCE_FOLDER, SHAPE_NAMESPACE_PREFIX); List collectedModelNamespaces = shapes.stream() @@ -505,21 +512,51 @@ static void writeModelIndex(Collection shapes, SymbolProvider symbolProvi .filter(namespace -> namespace.startsWith(modelPrefix)) .distinct() .sorted(Comparator.naturalOrder()) - .map(namespace -> namespace.replaceFirst(Matcher.quoteReplacement(modelPrefix), ".")) + .map(namespace -> namespace.replaceFirst( + Matcher.quoteReplacement(modelPrefix), + String.join("/", ".", SHAPE_NAMESPACE_PREFIX) + )) .toList(); - // Export empty model index if no models_* files are present + // Export empty model index if no other files are present. if (collectedModelNamespaces.isEmpty()) { writer.write("export {};"); } else { for (String namespace : collectedModelNamespaces) { - writer.write("export * from $S;", namespace); + boolean typesOnly = namespace.contains("models_"); + if (!typesOnly) { + writer.write("export * from $S;", namespace); + } + } + } + + // export types by name only + Map> namespaceToShapes = new TreeMap<>(); + + for (Shape shape : shapes) { + if (shape.isStructureShape() && !shape.hasTrait(ErrorTrait.class)) { + Symbol symbol = symbolProvider.toSymbol(shape); + String namespace = symbol.getNamespace() + .replaceFirst(Matcher.quoteReplacement( + String.join("/", ".", CodegenUtils.SOURCE_FOLDER) + ), + "." + ); + namespaceToShapes.computeIfAbsent(namespace, k -> new TreeSet<>()); + namespaceToShapes.get(namespace).add(symbol.getName()); } } - fileManifest.writeFile( - Paths.get(CodegenUtils.SOURCE_FOLDER, SHAPE_NAMESPACE_PREFIX, "index.ts").toString(), - writer.toString()); + for (Map.Entry> entry : namespaceToShapes.entrySet()) { + String namespace = entry.getKey(); + TreeSet types = entry.getValue(); + String symbols = String.join(", ", types); + writer.write(""" + export type { $L } from $S; + """, symbols, namespace); + } + + return writer; } } 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 d8abc010959..9d7dfbaa584 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 @@ -299,7 +299,7 @@ private void writeStructureSchema(StructureShape shape) { writer.addRelativeImport( symbolName, exceptionCtorSymbolName, - Paths.get("..", "models", "index") + Paths.get("..", "models", "errors") ); writer.openBlock(""" export var $L: StaticErrorSchema = [-3, $L, $L,""", diff --git a/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/IndexGeneratorTest.java b/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/IndexGeneratorTest.java index 719f71ffec1..f39d2ce4ba2 100644 --- a/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/IndexGeneratorTest.java +++ b/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/IndexGeneratorTest.java @@ -21,12 +21,11 @@ public void writesIndex() { SymbolProvider symbolProvider = new SymbolVisitor(model, settings); TypeScriptWriter writer = new TypeScriptWriter(""); - IndexGenerator.writeIndex(settings, model, symbolProvider, null, writer); + IndexGenerator.writeIndex(settings, model, symbolProvider, null, writer, writer); String contents = writer.toString(); assertThat(contents, containsString("export * from \"./Example\";")); assertThat(contents, containsString("export * from \"./ExampleClient\";")); assertThat(contents, containsString("export * from \"./commands\";")); - assertThat(contents, containsString("export * from \"./models\";")); } } diff --git a/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/StructureGeneratorTest.java b/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/StructureGeneratorTest.java index 6a0da01c9b2..e070170cba2 100644 --- a/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/StructureGeneratorTest.java +++ b/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/StructureGeneratorTest.java @@ -19,8 +19,8 @@ public class StructureGeneratorTest { public void properlyGeneratesEmptyMessageMemberOfException() { testErrorStructureCodegen("error-test-empty.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " /**\n" + " * @internal\n" + " */\n" @@ -39,8 +39,8 @@ public void properlyGeneratesEmptyMessageMemberOfException() { public void properlyGeneratesOptionalMessageMemberOfException() { testErrorStructureCodegen("error-test-optional-message.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " /**\n" + " * @internal\n" + " */\n" @@ -59,8 +59,8 @@ public void properlyGeneratesOptionalMessageMemberOfException() { public void properlyGeneratesRequiredMessageMemberOfException() { testErrorStructureCodegen("error-test-required-message.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " /**\n" + " * @internal\n" + " */\n" @@ -79,8 +79,8 @@ public void properlyGeneratesRequiredMessageMemberOfException() { public void properlyGeneratesOptionalNonMessageMemberOfException() { testErrorStructureCodegen("error-test-optional-member-no-message.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " foo?: string | undefined;\n" + " /**\n" + " * @internal\n" @@ -101,8 +101,8 @@ public void properlyGeneratesOptionalNonMessageMemberOfException() { public void properlyGeneratesRequiredNonMessageMemberOfException() { testErrorStructureCodegen("error-test-required-member-no-message.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " foo: string | undefined;\n" + " /**\n" + " * @internal\n" @@ -123,8 +123,8 @@ public void properlyGeneratesRequiredNonMessageMemberOfException() { public void generatesEmptyRetryableTrait() { testErrorStructureCodegen("error-test-retryable.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " $retryable = {\n" + " };\n" + " /**\n" @@ -145,8 +145,8 @@ public void generatesEmptyRetryableTrait() { public void generatesRetryableTraitWithThrottling() { testErrorStructureCodegen("error-test-retryable-throttling.smithy", "export class Err extends __BaseException {\n" - + " readonly name: \"Err\" = \"Err\";\n" - + " readonly $fault: \"client\" = \"client\";\n" + + " readonly name = \"Err\" as const;\n" + + " readonly $fault = \"client\" as const;\n" + " $retryable = {\n" + " throttling: true,\n" + " };\n" @@ -203,7 +203,10 @@ private String testStructureCodegenBase( .build(); new TypeScriptCodegenPlugin().execute(context); - String contents = manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "//models/models_0.ts").get(); + String contents = ""; + contents += manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "//models/models_0.ts").orElse(""); + contents += manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "//models/enums.ts").orElse(""); + contents += manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "//models/errors.ts").orElse(""); if (assertContains) { assertThat(contents, containsString(testString)); diff --git a/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/SymbolProviderTest.java b/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/SymbolProviderTest.java index 4d2cc5f5395..db4885c418d 100644 --- a/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/SymbolProviderTest.java +++ b/smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/SymbolProviderTest.java @@ -1,12 +1,10 @@ package software.amazon.smithy.typescript.codegen; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import java.util.Arrays; import org.junit.jupiter.api.Test; -import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.model.Model; @@ -61,8 +59,7 @@ public void createsSymbolsIntoTargetNamespace() { SymbolProvider provider = new SymbolVisitor(model, settings); Symbol symbol1 = provider.toSymbol(shape1); Symbol symbol2 = provider.toSymbol(shape2); - MockManifest manifest = new MockManifest(); - SymbolVisitor.writeModelIndex(Arrays.asList(shape1, shape2), provider, manifest); + SymbolVisitor.modelIndexer(Arrays.asList(shape1, shape2), provider); assertThat(symbol1.getName(), equalTo("Hello")); assertThat(symbol1.getNamespace(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0")); @@ -73,8 +70,6 @@ public void createsSymbolsIntoTargetNamespace() { assertThat(symbol2.getNamespace(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0")); assertThat(symbol2.getNamespaceDelimiter(), equalTo("/")); assertThat(symbol2.getDefinitionFile(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0.ts")); - assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/models/index.ts").get(), - containsString("export * from \"./models_0\";")); } @Test @@ -266,14 +261,11 @@ public void placesResourceShapeIntoInitialBucket() { SymbolProvider provider = new SymbolVisitor(model, settings, 1); Symbol symbol1 = provider.toSymbol(shape1); Symbol symbol2 = provider.toSymbol(shape2); - MockManifest manifest = new MockManifest(); - SymbolVisitor.writeModelIndex(Arrays.asList(shape1, shape2), provider, manifest); + SymbolVisitor.modelIndexer(Arrays.asList(shape1, shape2), provider); assertThat(symbol1.getNamespace(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0")); assertThat(symbol1.getDefinitionFile(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0.ts")); assertThat(symbol2.getNamespace(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0")); assertThat(symbol2.getDefinitionFile(), equalTo("./" + CodegenUtils.SOURCE_FOLDER + "/models/models_0.ts")); - assertThat(manifest.getFileString(CodegenUtils.SOURCE_FOLDER + "/models/index.ts").get(), - containsString("export * from \"./models_0\";")); } }