Skip to content

Commit 54296a0

Browse files
committed
this is what our codegen output looks like without formatting
1 parent ca0ee3f commit 54296a0

File tree

99 files changed

+5702
-4299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5702
-4299
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ generate-protocol-tests:
1818
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model/typescript-client-codegen/ ./private/my-local-model
1919
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
2020
node ./scripts/post-protocol-test-codegen
21-
npx prettier --write ./private/smithy-rpcv2-cbor
22-
npx prettier --write ./private/smithy-rpcv2-cbor-schema
23-
npx prettier --write ./private/my-local-model
24-
npx prettier --write ./private/my-local-model-schema
21+
# npx prettier --write ./private/smithy-rpcv2-cbor
22+
# npx prettier --write ./private/smithy-rpcv2-cbor-schema
23+
# npx prettier --write ./private/my-local-model
24+
# npx prettier --write ./private/my-local-model-schema
2525
yarn
2626
(cd ./private/smithy-rpcv2-cbor && npm run build)
2727
(cd ./private/smithy-rpcv2-cbor-schema && npm run build)

private/my-local-model-schema/src/XYZService.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
// smithy-typescript generated code
2-
import { XYZServiceClient, XYZServiceClientConfig } from "./XYZServiceClient";
3-
import { GetNumbersCommand, GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
2+
import {
3+
XYZServiceClient,
4+
XYZServiceClientConfig,
5+
} from "./XYZServiceClient";
6+
import {
7+
GetNumbersCommand,
8+
GetNumbersCommandInput,
9+
GetNumbersCommandOutput,
10+
} from "./commands/GetNumbersCommand";
411
import {
512
TradeEventStreamCommand,
613
TradeEventStreamCommandInput,
@@ -12,15 +19,21 @@ import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
1219
const commands = {
1320
GetNumbersCommand,
1421
TradeEventStreamCommand,
15-
};
22+
}
1623

1724
export interface XYZService {
1825
/**
1926
* @see {@link GetNumbersCommand}
2027
*/
2128
getNumbers(): Promise<GetNumbersCommandOutput>;
22-
getNumbers(args: GetNumbersCommandInput, options?: __HttpHandlerOptions): Promise<GetNumbersCommandOutput>;
23-
getNumbers(args: GetNumbersCommandInput, cb: (err: any, data?: GetNumbersCommandOutput) => void): void;
29+
getNumbers(
30+
args: GetNumbersCommandInput,
31+
options?: __HttpHandlerOptions,
32+
): Promise<GetNumbersCommandOutput>;
33+
getNumbers(
34+
args: GetNumbersCommandInput,
35+
cb: (err: any, data?: GetNumbersCommandOutput) => void
36+
): void;
2437
getNumbers(
2538
args: GetNumbersCommandInput,
2639
options: __HttpHandlerOptions,
@@ -33,7 +46,7 @@ export interface XYZService {
3346
tradeEventStream(): Promise<TradeEventStreamCommandOutput>;
3447
tradeEventStream(
3548
args: TradeEventStreamCommandInput,
36-
options?: __HttpHandlerOptions
49+
options?: __HttpHandlerOptions,
3750
): Promise<TradeEventStreamCommandOutput>;
3851
tradeEventStream(
3952
args: TradeEventStreamCommandInput,
@@ -44,6 +57,7 @@ export interface XYZService {
4457
options: __HttpHandlerOptions,
4558
cb: (err: any, data?: TradeEventStreamCommandOutput) => void
4659
): void;
60+
4761
}
4862

4963
/**

private/my-local-model-schema/src/XYZServiceClient.ts

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,26 @@ import {
55
defaultXYZServiceHttpAuthSchemeParametersProvider,
66
resolveHttpAuthSchemeConfig,
77
} from "./auth/httpAuthSchemeProvider";
8-
import { GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
9-
import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "./commands/TradeEventStreamCommand";
8+
import {
9+
GetNumbersCommandInput,
10+
GetNumbersCommandOutput,
11+
} from "./commands/GetNumbersCommand";
12+
import {
13+
TradeEventStreamCommandInput,
14+
TradeEventStreamCommandOutput,
15+
} from "./commands/TradeEventStreamCommand";
1016
import {
1117
ClientInputEndpointParameters,
1218
ClientResolvedEndpointParameters,
1319
EndpointParameters,
1420
resolveClientEndpointParameters,
1521
} from "./endpoint/EndpointParameters";
1622
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
17-
import { RuntimeExtension, RuntimeExtensionsConfig, resolveRuntimeExtensions } from "./runtimeExtensions";
23+
import {
24+
RuntimeExtension,
25+
RuntimeExtensionsConfig,
26+
resolveRuntimeExtensions,
27+
} from "./runtimeExtensions";
1828
import {
1929
DefaultIdentityProviderConfig,
2030
getHttpAuthSchemeEndpointRuleSetPlugin,
@@ -35,7 +45,12 @@ import {
3545
resolveEndpointConfig,
3646
resolveEndpointRequiredConfig,
3747
} from "@smithy/middleware-endpoint";
38-
import { RetryInputConfig, RetryResolvedConfig, getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
48+
import {
49+
RetryInputConfig,
50+
RetryResolvedConfig,
51+
getRetryPlugin,
52+
resolveRetryConfig,
53+
} from "@smithy/middleware-retry";
3954
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
4055
import {
4156
Client as __Client,
@@ -61,22 +76,27 @@ import {
6176
UrlParser as __UrlParser,
6277
} from "@smithy/types";
6378

64-
export { __Client };
79+
export { __Client }
6580

6681
/**
6782
* @public
6883
*/
69-
export type ServiceInputTypes = GetNumbersCommandInput | TradeEventStreamCommandInput;
84+
export type ServiceInputTypes =
85+
| GetNumbersCommandInput
86+
| TradeEventStreamCommandInput;
7087

7188
/**
7289
* @public
7390
*/
74-
export type ServiceOutputTypes = GetNumbersCommandOutput | TradeEventStreamCommandOutput;
91+
export type ServiceOutputTypes =
92+
| GetNumbersCommandOutput
93+
| TradeEventStreamCommandOutput;
7594

7695
/**
7796
* @public
7897
*/
79-
export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {
98+
export interface ClientDefaults
99+
extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {
80100
/**
81101
* The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.
82102
*/
@@ -184,19 +204,20 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
184204
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
185205
*/
186206
defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
207+
187208
}
188209

189210
/**
190211
* @public
191212
*/
192-
export type XYZServiceClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
193-
ClientDefaults &
194-
RetryInputConfig &
195-
EndpointInputConfig<EndpointParameters> &
196-
EndpointRequiredInputConfig &
197-
EventStreamSerdeInputConfig &
198-
HttpAuthSchemeInputConfig &
199-
ClientInputEndpointParameters;
213+
export type XYZServiceClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>>
214+
& ClientDefaults
215+
& RetryInputConfig
216+
& EndpointInputConfig<EndpointParameters>
217+
& EndpointRequiredInputConfig
218+
& EventStreamSerdeInputConfig
219+
& HttpAuthSchemeInputConfig
220+
& ClientInputEndpointParameters
200221
/**
201222
* @public
202223
*
@@ -207,15 +228,15 @@ export interface XYZServiceClientConfig extends XYZServiceClientConfigType {}
207228
/**
208229
* @public
209230
*/
210-
export type XYZServiceClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
211-
Required<ClientDefaults> &
212-
RuntimeExtensionsConfig &
213-
RetryResolvedConfig &
214-
EndpointResolvedConfig<EndpointParameters> &
215-
EndpointRequiredResolvedConfig &
216-
EventStreamSerdeResolvedConfig &
217-
HttpAuthSchemeResolvedConfig &
218-
ClientResolvedEndpointParameters;
231+
export type XYZServiceClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions>
232+
& Required<ClientDefaults>
233+
& RuntimeExtensionsConfig
234+
& RetryResolvedConfig
235+
& EndpointResolvedConfig<EndpointParameters>
236+
& EndpointRequiredResolvedConfig
237+
& EventStreamSerdeResolvedConfig
238+
& HttpAuthSchemeResolvedConfig
239+
& ClientResolvedEndpointParameters
219240
/**
220241
* @public
221242
*
@@ -251,16 +272,17 @@ export class XYZServiceClient extends __Client<
251272
let _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []);
252273
this.config = _config_7;
253274
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
254-
this.middlewareStack.use(getRetryPlugin(this.config));
255-
this.middlewareStack.use(getContentLengthPlugin(this.config));
256-
this.middlewareStack.use(
257-
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
258-
httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,
259-
identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) =>
260-
new DefaultIdentityProviderConfig({}),
261-
})
262-
);
263-
this.middlewareStack.use(getHttpSigningPlugin(this.config));
275+
this.middlewareStack.use(getRetryPlugin(this.config
276+
));
277+
this.middlewareStack.use(getContentLengthPlugin(this.config
278+
));
279+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config
280+
, {
281+
httpAuthSchemeParametersProvider: defaultXYZServiceHttpAuthSchemeParametersProvider,identityProviderConfigProvider: async (config: XYZServiceClientResolvedConfig) => new DefaultIdentityProviderConfig({
282+
}), }
283+
));
284+
this.middlewareStack.use(getHttpSigningPlugin(this.config
285+
));
264286
}
265287

266288
/**

private/my-local-model-schema/src/auth/httpAuthExtensionConfiguration.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ export type HttpAuthRuntimeConfig = Partial<{
2323
/**
2424
* @internal
2525
*/
26-
export const getHttpAuthExtensionConfiguration = (
27-
runtimeConfig: HttpAuthRuntimeConfig
28-
): HttpAuthExtensionConfiguration => {
26+
export const getHttpAuthExtensionConfiguration = (runtimeConfig: HttpAuthRuntimeConfig): HttpAuthExtensionConfiguration => {
2927
let _httpAuthSchemes = runtimeConfig.httpAuthSchemes!;
3028
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider!;
3129
return {
3230
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void {
33-
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
31+
const index = _httpAuthSchemes.findIndex(scheme => scheme.schemeId === httpAuthScheme.schemeId);
3432
if (index === -1) {
3533
_httpAuthSchemes.push(httpAuthScheme);
3634
} else {
@@ -46,7 +44,7 @@ export const getHttpAuthExtensionConfiguration = (
4644
httpAuthSchemeProvider(): XYZServiceHttpAuthSchemeProvider {
4745
return _httpAuthSchemeProvider;
4846
},
49-
};
47+
}
5048
};
5149

5250
/**

private/my-local-model-schema/src/auth/httpAuthSchemeProvider.ts

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,26 @@ import {
99
HttpAuthSchemeProvider,
1010
Provider,
1111
} from "@smithy/types";
12-
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
12+
import {
13+
getSmithyContext,
14+
normalizeProvider,
15+
} from "@smithy/util-middleware";
1316

1417
/**
1518
* @internal
1619
*/
17-
export interface XYZServiceHttpAuthSchemeParameters extends HttpAuthSchemeParameters {}
20+
export interface XYZServiceHttpAuthSchemeParameters extends HttpAuthSchemeParameters {
21+
}
1822

1923
/**
2024
* @internal
2125
*/
22-
export interface XYZServiceHttpAuthSchemeParametersProvider
23-
extends HttpAuthSchemeParametersProvider<
24-
XYZServiceClientResolvedConfig,
25-
HandlerExecutionContext,
26-
XYZServiceHttpAuthSchemeParameters,
27-
object
28-
> {}
26+
export interface XYZServiceHttpAuthSchemeParametersProvider extends HttpAuthSchemeParametersProvider<XYZServiceClientResolvedConfig, HandlerExecutionContext, XYZServiceHttpAuthSchemeParameters, object> {}
2927

3028
/**
3129
* @internal
3230
*/
33-
export const defaultXYZServiceHttpAuthSchemeParametersProvider = async (
34-
config: XYZServiceClientResolvedConfig,
35-
context: HandlerExecutionContext,
36-
input: object
37-
): Promise<XYZServiceHttpAuthSchemeParameters> => {
31+
export const defaultXYZServiceHttpAuthSchemeParametersProvider = async (config: XYZServiceClientResolvedConfig, context: HandlerExecutionContext, input: object): Promise<XYZServiceHttpAuthSchemeParameters> => {
3832
return {
3933
operation: getSmithyContext(context).operation as string,
4034
};
@@ -44,7 +38,7 @@ function createSmithyApiNoAuthHttpAuthOption(authParameters: XYZServiceHttpAuthS
4438
return {
4539
schemeId: "smithy.api#noAuth",
4640
};
47-
}
41+
};
4842

4943
/**
5044
* @internal
@@ -59,8 +53,8 @@ export const defaultXYZServiceHttpAuthSchemeProvider: XYZServiceHttpAuthSchemePr
5953
switch (authParameters.operation) {
6054
default: {
6155
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
62-
}
63-
}
56+
};
57+
};
6458
return options;
6559
};
6660

@@ -87,6 +81,7 @@ export interface HttpAuthSchemeInputConfig {
8781
* @internal
8882
*/
8983
httpAuthSchemeProvider?: XYZServiceHttpAuthSchemeProvider;
84+
9085
}
9186

9287
/**
@@ -112,15 +107,15 @@ export interface HttpAuthSchemeResolvedConfig {
112107
* @internal
113108
*/
114109
readonly httpAuthSchemeProvider: XYZServiceHttpAuthSchemeProvider;
110+
115111
}
116112

117113
/**
118114
* @internal
119115
*/
120-
export const resolveHttpAuthSchemeConfig = <T>(
121-
config: T & HttpAuthSchemeInputConfig
122-
): T & HttpAuthSchemeResolvedConfig => {
123-
return Object.assign(config, {
116+
export const resolveHttpAuthSchemeConfig = <T>(config: T & HttpAuthSchemeInputConfig): T & HttpAuthSchemeResolvedConfig => {
117+
return Object.assign(
118+
config, {
124119
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
125120
}) as T & HttpAuthSchemeResolvedConfig;
126121
};

0 commit comments

Comments
 (0)