Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/famous-planes-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ generate-protocol-tests:
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model/typescript-client-codegen/ ./private/my-local-model
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model-schema/typescript-client-codegen/ ./private/my-local-model-schema
node ./scripts/post-protocol-test-codegen
npx prettier --write ./private/smithy-rpcv2-cbor
npx prettier --write ./private/smithy-rpcv2-cbor-schema
npx prettier --write ./private/my-local-model
npx prettier --write ./private/my-local-model-schema
yarn
yarn turbo run build -F="./private/*" --only

Expand Down
23 changes: 17 additions & 6 deletions private/my-local-model-schema/src/XYZService.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
// smithy-typescript generated code
import { XYZServiceClient, XYZServiceClientConfig } from "./XYZServiceClient";
import { GetNumbersCommand, GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
GetNumbersCommand,
GetNumbersCommandInput,
GetNumbersCommandOutput,
} from "./commands/GetNumbersCommand";
import {
TradeEventStreamCommand,
TradeEventStreamCommandInput,
TradeEventStreamCommandOutput,
} from "./commands/TradeEventStreamCommand";
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
import { XYZServiceClient } from "./XYZServiceClient";

const commands = {
GetNumbersCommand,
Expand All @@ -19,8 +24,14 @@ export interface XYZService {
* @see {@link GetNumbersCommand}
*/
getNumbers(): Promise<GetNumbersCommandOutput>;
getNumbers(args: GetNumbersCommandInput, options?: __HttpHandlerOptions): Promise<GetNumbersCommandOutput>;
getNumbers(args: GetNumbersCommandInput, cb: (err: any, data?: GetNumbersCommandOutput) => void): void;
getNumbers(
args: GetNumbersCommandInput,
options?: __HttpHandlerOptions
): Promise<GetNumbersCommandOutput>;
getNumbers(
args: GetNumbersCommandInput,
cb: (err: any, data?: GetNumbersCommandOutput) => void
): void;
getNumbers(
args: GetNumbersCommandInput,
options: __HttpHandlerOptions,
Expand Down
87 changes: 50 additions & 37 deletions private/my-local-model-schema/src/XYZServiceClient.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
// smithy-typescript generated code
import {
HttpAuthSchemeInputConfig,
HttpAuthSchemeResolvedConfig,
defaultXYZServiceHttpAuthSchemeParametersProvider,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import { GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "./commands/TradeEventStreamCommand";
import {
ClientInputEndpointParameters,
ClientResolvedEndpointParameters,
EndpointParameters,
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import { RuntimeExtension, RuntimeExtensionsConfig, resolveRuntimeExtensions } from "./runtimeExtensions";
import {
DefaultIdentityProviderConfig,
getHttpAuthSchemeEndpointRuleSetPlugin,
Expand All @@ -35,7 +19,12 @@ import {
resolveEndpointConfig,
resolveEndpointRequiredConfig,
} from "@smithy/middleware-endpoint";
import { RetryInputConfig, RetryResolvedConfig, getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
import {
RetryInputConfig,
RetryResolvedConfig,
getRetryPlugin,
resolveRetryConfig,
} from "@smithy/middleware-retry";
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
import {
Client as __Client,
Expand All @@ -44,34 +33,59 @@ import {
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
} from "@smithy/smithy-client";
import {
ClientProtocol,
HttpRequest,
HttpResponse,
BodyLengthCalculator as __BodyLengthCalculator,
CheckOptionalClientConfig as __CheckOptionalClientConfig,
ChecksumConstructor as __ChecksumConstructor,
ClientProtocol,
Decoder as __Decoder,
Encoder as __Encoder,
EventStreamSerdeProvider as __EventStreamSerdeProvider,
HashConstructor as __HashConstructor,
HttpHandlerOptions as __HttpHandlerOptions,
HttpRequest,
HttpResponse,
Logger as __Logger,
Provider as __Provider,
StreamCollector as __StreamCollector,
UrlParser as __UrlParser,
} from "@smithy/types";

import {
HttpAuthSchemeInputConfig,
HttpAuthSchemeResolvedConfig,
defaultXYZServiceHttpAuthSchemeParametersProvider,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import { GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "./commands/TradeEventStreamCommand";
import {
ClientInputEndpointParameters,
ClientResolvedEndpointParameters,
EndpointParameters,
resolveClientEndpointParameters,
} from "./endpoint/EndpointParameters";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
import {
RuntimeExtension,
RuntimeExtensionsConfig,
resolveRuntimeExtensions,
} from "./runtimeExtensions";

export { __Client };

/**
* @public
*/
export type ServiceInputTypes = GetNumbersCommandInput | TradeEventStreamCommandInput;
export type ServiceInputTypes =
| GetNumbersCommandInput
| TradeEventStreamCommandInput;

/**
* @public
*/
export type ServiceOutputTypes = GetNumbersCommandOutput | TradeEventStreamCommandOutput;
export type ServiceOutputTypes =
| GetNumbersCommandOutput
| TradeEventStreamCommandOutput;

/**
* @public
Expand Down Expand Up @@ -184,8 +198,8 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
}

}
/**
* @public
*/
Expand Down Expand Up @@ -239,27 +253,26 @@ export class XYZServiceClient extends __Client<
readonly config: XYZServiceClientResolvedConfig;

constructor(...[configuration]: __CheckOptionalClientConfig<XYZServiceClientConfig>) {
let _config_0 = __getRuntimeConfig(configuration || {});
const _config_0 = __getRuntimeConfig(configuration || {});
super(_config_0 as any);
this.initConfig = _config_0;
let _config_1 = resolveClientEndpointParameters(_config_0);
let _config_2 = resolveRetryConfig(_config_1);
let _config_3 = resolveEndpointConfig(_config_2);
let _config_4 = resolveEndpointRequiredConfig(_config_3);
let _config_5 = resolveEventStreamSerdeConfig(_config_4);
let _config_6 = resolveHttpAuthSchemeConfig(_config_5);
let _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []);
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = resolveRetryConfig(_config_1);
const _config_3 = resolveEndpointConfig(_config_2);
const _config_4 = resolveEndpointRequiredConfig(_config_3);
const _config_5 = resolveEventStreamSerdeConfig(_config_4);
const _config_6 = resolveHttpAuthSchemeConfig(_config_5);
const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []);
this.config = _config_7;
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
this.middlewareStack.use(getRetryPlugin(this.config));
this.middlewareStack.use(getContentLengthPlugin(this.config));
this.middlewareStack.use(
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config,
{
httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>
new DefaultIdentityProviderConfig({}),
})
);
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) => new DefaultIdentityProviderConfig({}),
}
));
this.middlewareStack.use(getHttpSigningPlugin(this.config));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// smithy-typescript generated code
import { XYZServiceHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
import { HttpAuthScheme } from "@smithy/types";

import { XYZServiceHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";

/**
* @internal
*/
Expand All @@ -26,7 +27,7 @@ export type HttpAuthRuntimeConfig = Partial<{
export const getHttpAuthExtensionConfiguration = (
runtimeConfig: HttpAuthRuntimeConfig
): HttpAuthExtensionConfiguration => {
let _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;
return {
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// smithy-typescript generated code
import { XYZServiceClientResolvedConfig } from "../XYZServiceClient";
import {
HandlerExecutionContext,
HttpAuthOption,
Expand All @@ -11,6 +10,8 @@ import {
} from "@smithy/types";
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";

import { XYZServiceClientResolvedConfig } from "../XYZServiceClient";

/**
* @internal
*/
Expand Down Expand Up @@ -49,7 +50,8 @@ function createSmithyApiNoAuthHttpAuthOption(authParameters: XYZServiceHttpAuthS
/**
* @internal
*/
export interface XYZServiceHttpAuthSchemeProvider extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}
export interface XYZServiceHttpAuthSchemeProvider
extends HttpAuthSchemeProvider<XYZServiceHttpAuthSchemeParameters> {}

/**
* @internal
Expand Down
17 changes: 12 additions & 5 deletions private/my-local-model-schema/src/commands/GetNumbersCommand.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// smithy-typescript generated code
import { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { GetNumbersRequest, GetNumbersResponse } from "../models/models_0";
import { GetNumbers } from "../schemas/schemas_0";
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { GetNumbersRequest, GetNumbersResponse } from "../models/models_0";
import { GetNumbers } from "../schemas/schemas_0";
import {
ServiceInputTypes,
ServiceOutputTypes,
XYZServiceClientResolvedConfig,
} from "../XYZServiceClient";

/**
* @public
*/
Expand Down Expand Up @@ -82,7 +87,9 @@ export class GetNumbersCommand extends $Command
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
return [
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("XYZService", "GetNumbers", {})
.n("XYZServiceClient", "GetNumbersCommand")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// smithy-typescript generated code
import { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { TradeEventStreamRequest, TradeEventStreamResponse } from "../models/models_0";
import { TradeEventStream } from "../schemas/schemas_0";
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { TradeEventStreamRequest, TradeEventStreamResponse } from "../models/models_0";
import { TradeEventStream } from "../schemas/schemas_0";
import {
ServiceInputTypes,
ServiceOutputTypes,
XYZServiceClientResolvedConfig,
} from "../XYZServiceClient";

/**
* @public
*/
Expand Down Expand Up @@ -82,7 +87,9 @@ export class TradeEventStreamCommand extends $Command
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
return [
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("XYZService", "TradeEventStream", {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// smithy-typescript generated code
import { Endpoint, EndpointV2, Provider, EndpointParameters as __EndpointParameters } from "@smithy/types";
import {
Endpoint,
EndpointParameters as __EndpointParameters,
EndpointV2,
Provider,
} from "@smithy/types";

/**
* @public
Expand All @@ -8,10 +13,16 @@ export interface ClientInputEndpointParameters {
endpoint?: string | Provider<string> | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
}

/**
* @internal
*/
export type ClientResolvedEndpointParameters = Omit<ClientInputEndpointParameters, "endpoint"> & {
defaultSigningName: string;
};

/**
* @internal
*/
export const resolveClientEndpointParameters = <T>(
options: T & ClientInputEndpointParameters
): T & ClientResolvedEndpointParameters => {
Expand All @@ -20,6 +31,9 @@ export const resolveClientEndpointParameters = <T>(
});
};

/**
* @internal
*/
export const commonParams = {
endpoint: { type: "builtInParams", name: "endpoint" },
} as const;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
// smithy-typescript generated code
import { EndpointV2, Logger } from "@smithy/types";
import {
EndpointCache,
EndpointParams,
resolveEndpoint,
} from "@smithy/util-endpoints";

import { EndpointParameters } from "./EndpointParameters";
import { ruleSet } from "./ruleset";
import { EndpointV2, Logger } from "@smithy/types";
import { EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints";

const cache = new EndpointCache({
size: 50,
Expand Down
7 changes: 3 additions & 4 deletions private/my-local-model-schema/src/extensionConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// smithy-typescript generated code
import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";
import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
import { DefaultExtensionConfiguration } from "@smithy/types";

import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";

/**
* @internal
*/
export interface XYZServiceExtensionConfiguration
extends HttpHandlerExtensionConfiguration,
DefaultExtensionConfiguration,
HttpAuthExtensionConfiguration {}
extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, HttpAuthExtensionConfiguration {}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// smithy-typescript generated code
import {
ServiceException as __ServiceException,
ServiceExceptionOptions as __ServiceExceptionOptions,
} from "@smithy/smithy-client";
import { ServiceExceptionOptions as __ServiceExceptionOptions, ServiceException as __ServiceException } from "@smithy/smithy-client";

export type { __ServiceExceptionOptions };

Expand Down
Loading