@@ -15,7 +15,7 @@ import {
1515 HandlerExecutionContext ,
1616 HttpHandlerOptions ,
1717 MetadataBearer ,
18- MiddlewareStack ,
18+ // MiddlewareStack,
1919 Provider ,
2020 RetryStrategy ,
2121 UserAgent ,
@@ -32,11 +32,11 @@ import { Client, SmithyResolvedConfiguration } from '@aws-sdk/smithy-client'
3232export type AwsClient = Client < HttpHandlerOptions , any , MetadataBearer , SmithyResolvedConfiguration < HttpHandlerOptions > >
3333export type AwsClientConstructor < C > = new ( o : AwsClientOptions ) => C
3434
35- interface AwsClient2 {
36- middlewareStack : AwsMiddlewareStack
35+ interface AwsClient2 < Input extends object , Output extends MetadataBearer > {
36+ middlewareStack : AwsMiddlewareStack < Input , Output >
3737}
3838
39- type AwsMiddlewareStack = any
39+ type AwsMiddlewareStack < Input extends object , Output extends object > = any
4040interface AwsConfigOptions {
4141 credentials : AwsCredentialIdentityProvider
4242 region : string | Provider < string >
@@ -48,17 +48,17 @@ interface AwsConfigOptions {
4848}
4949export type AwsClientOptions = AwsConfigOptions
5050
51- export interface AWSClientBuilderV3 {
52- createAwsService < C extends AwsClient2 > (
53- type : AwsClientConstructor < C > ,
54- options ?: Partial < AwsClientOptions > ,
55- region ?: string ,
56- userAgent ?: boolean ,
57- settings ?: DevSettings
58- ) : Promise < C >
59- }
60-
61- export class DefaultAWSClientBuilderV3 implements AWSClientBuilderV3 {
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+
61+ export class DefaultAWSClientBuilderV3 {
6262 public constructor ( private readonly context : AwsContext ) { }
6363
6464 private getShim ( ) : CredentialsShim {
@@ -69,7 +69,11 @@ export class DefaultAWSClientBuilderV3 implements AWSClientBuilderV3 {
6969 return shim
7070 }
7171
72- public async createAwsService < C extends AwsClient2 > (
72+ public async createAwsService <
73+ Input extends object ,
74+ Output extends MetadataBearer ,
75+ C extends AwsClient2 < Input , Output > ,
76+ > (
7377 type : AwsClientConstructor < C > ,
7478 options ?: Partial < AwsClientOptions > ,
7579 region ?: string ,
@@ -102,7 +106,7 @@ export class DefaultAWSClientBuilderV3 implements AWSClientBuilderV3 {
102106
103107 const service = new type ( opt )
104108 // TODO: add middleware for logging, telemetry, endpoints.
105- service . middlewareStack . add ( telemetryMiddleware , { step : 'deserialize' } as DeserializeHandlerOptions )
109+ service . middlewareStack . add ! ( telemetryMiddleware , { step : 'deserialize' } as DeserializeHandlerOptions )
106110 return service
107111 }
108112}
0 commit comments