@@ -15,7 +15,6 @@ import {
1515 HandlerExecutionContext ,
1616 HttpHandlerOptions ,
1717 MetadataBearer ,
18- //MiddlewareStack,
1918 Provider ,
2019 RetryStrategy ,
2120 UserAgent ,
@@ -32,11 +31,10 @@ import { Client, SmithyResolvedConfiguration } from '@aws-sdk/smithy-client'
3231export type AwsClient = Client < HttpHandlerOptions , any , MetadataBearer , SmithyResolvedConfiguration < HttpHandlerOptions > >
3332export type AwsClientConstructor < C > = new ( o : AwsClientOptions ) => C
3433
35- interface AwsClient2 < Input extends object , Output extends MetadataBearer > {
36- middlewareStack : AwsMiddlewareStack < Input , Output >
34+ interface AwsClient2 {
35+ middlewareStack : any // Ideally this would extends MiddlewareStack <Input, Output>, but this causes issues on client construction.
3736}
3837
39- type AwsMiddlewareStack < Input extends object , Output extends object > = any
4038interface AwsConfigOptions {
4139 credentials : AwsCredentialIdentityProvider
4240 region : string | Provider < string >
@@ -48,16 +46,6 @@ interface AwsConfigOptions {
4846}
4947export type AwsClientOptions = AwsConfigOptions
5048
51- // export interface AWSClientBuilderV3 {
52- // createAwsService<Input extends object, Output extends MetadataBearer, C extends AwsClient2<Input, Output>>(
53- // type: AwsClientConstructor<C>,
54- // options?: Partial<AwsClientOptions>,
55- // region?: string,
56- // userAgent?: boolean,
57- // settings?: DevSettings
58- // ): Promise<C>
59- // }
60-
6149export class DefaultAWSClientBuilderV3 {
6250 public constructor ( private readonly context : AwsContext ) { }
6351
@@ -69,11 +57,7 @@ export class DefaultAWSClientBuilderV3 {
6957 return shim
7058 }
7159
72- public async createAwsService <
73- Input extends object ,
74- Output extends MetadataBearer ,
75- C extends AwsClient2 < Input , Output > ,
76- > (
60+ public async createAwsService < C extends AwsClient2 > (
7761 type : AwsClientConstructor < C > ,
7862 options ?: Partial < AwsClientOptions > ,
7963 region ?: string ,
@@ -106,7 +90,7 @@ export class DefaultAWSClientBuilderV3 {
10690
10791 const service = new type ( opt )
10892 // TODO: add middleware for logging, telemetry, endpoints.
109- service . middlewareStack . add ! ( telemetryMiddleware , { step : 'deserialize' } as DeserializeHandlerOptions )
93+ service . middlewareStack . add ( telemetryMiddleware , { step : 'deserialize' } as DeserializeHandlerOptions )
11094 return service
11195 }
11296}
0 commit comments