@aws-sdk/types 1.0.0-rc.8 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +1 -1
- package/dist/cjs/middleware.js +1 -1
- package/dist/cjs/pagination.js +1 -1
- package/dist/cjs/response.js +1 -1
- package/dist/cjs/util.js +1 -1
- package/dist/es/middleware.js +1 -1
- package/dist/es/pagination.js +1 -1
- package/dist/es/response.js +1 -1
- package/dist/es/util.js +1 -1
- package/package.json +10 -2
- package/src/middleware.ts +15 -0
- package/src/pagination.ts +1 -1
- package/src/response.ts +0 -7
- package/src/util.ts +22 -1
- package/tsconfig.cjs.json +1 -0
- package/tsconfig.es.json +1 -0
- package/{dist/cjs → types}/abort.d.ts +0 -0
- package/{dist/cjs → types}/client.d.ts +0 -0
- package/{dist/cjs → types}/command.d.ts +0 -0
- package/{dist/cjs → types}/credentials.d.ts +0 -0
- package/{dist/cjs → types}/crypto.d.ts +0 -0
- package/{dist/cjs → types}/eventStream.d.ts +0 -0
- package/{dist/cjs → types}/http.d.ts +0 -0
- package/{dist/cjs → types}/index.d.ts +0 -0
- package/{dist/cjs → types}/logger.d.ts +0 -0
- package/{dist/cjs → types}/middleware.d.ts +13 -0
- package/{dist/cjs → types}/pagination.d.ts +1 -1
- package/{dist/cjs → types}/response.d.ts +0 -5
- package/{dist/cjs → types}/serde.d.ts +0 -0
- package/{dist/cjs → types}/signature.d.ts +0 -0
- package/{dist/cjs → types}/transfer.d.ts +0 -0
- package/{dist/es → types/ts3.4}/abort.d.ts +42 -42
- package/{dist/es → types/ts3.4}/client.d.ts +23 -23
- package/{dist/es → types/ts3.4}/command.d.ts +7 -7
- package/{dist/es → types/ts3.4}/credentials.d.ts +24 -24
- package/{dist/es → types/ts3.4}/crypto.d.ts +47 -47
- package/{dist/es → types/ts3.4}/eventStream.d.ts +84 -84
- package/{dist/es → types/ts3.4}/http.d.ts +92 -92
- package/{dist/es → types/ts3.4}/index.d.ts +15 -15
- package/{dist/es → types/ts3.4}/logger.d.ts +26 -26
- package/{dist/es → types/ts3.4}/middleware.d.ts +338 -325
- package/{dist/es → types/ts3.4}/pagination.d.ts +14 -14
- package/{dist/es → types/ts3.4}/response.d.ts +34 -39
- package/{dist/es → types/ts3.4}/serde.d.ts +49 -49
- package/{dist/es → types/ts3.4}/signature.d.ts +100 -100
- package/{dist/es → types/ts3.4}/transfer.d.ts +16 -16
- package/{dist/es → types/ts3.4}/util.d.ts +100 -83
- package/{dist/cjs → types}/util.d.ts +14 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Client } from "./client";
|
|
2
|
-
/**
|
|
3
|
-
* Expected type definition of a paginator.
|
|
4
|
-
*/
|
|
5
|
-
export declare type Paginator<T> = AsyncGenerator<T, T, unknown>;
|
|
6
|
-
/**
|
|
7
|
-
* Expected paginator configuration passed to an operation. Services will extend
|
|
8
|
-
* this interface definition and may type client further.
|
|
9
|
-
*/
|
|
10
|
-
export interface PaginationConfiguration {
|
|
11
|
-
client: Client<any, any, any>;
|
|
12
|
-
pageSize?: number;
|
|
13
|
-
startingToken?:
|
|
14
|
-
}
|
|
1
|
+
import { Client } from "./client";
|
|
2
|
+
/**
|
|
3
|
+
* Expected type definition of a paginator.
|
|
4
|
+
*/
|
|
5
|
+
export declare type Paginator<T> = AsyncGenerator<T, T, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Expected paginator configuration passed to an operation. Services will extend
|
|
8
|
+
* this interface definition and may type client further.
|
|
9
|
+
*/
|
|
10
|
+
export interface PaginationConfiguration {
|
|
11
|
+
client: Client<any, any, any>;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
startingToken?: any;
|
|
14
|
+
}
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Metadata pertaining to this request.
|
|
37
|
-
*/
|
|
38
|
-
$metadata: ResponseMetadata;
|
|
39
|
-
}
|
|
1
|
+
export interface ResponseMetadata {
|
|
2
|
+
/**
|
|
3
|
+
* The status code of the last HTTP response received for this operation.
|
|
4
|
+
*/
|
|
5
|
+
httpStatusCode?: number;
|
|
6
|
+
/**
|
|
7
|
+
* A unique identifier for the last request sent for this operation. Often
|
|
8
|
+
* requested by AWS service teams to aid in debugging.
|
|
9
|
+
*/
|
|
10
|
+
requestId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* A secondary identifier for the last request sent. Used for debugging.
|
|
13
|
+
*/
|
|
14
|
+
extendedRequestId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A tertiary identifier for the last request sent. Used for debugging.
|
|
17
|
+
*/
|
|
18
|
+
cfId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The number of times this operation was attempted.
|
|
21
|
+
*/
|
|
22
|
+
attempts?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The total amount of time (in milliseconds) that was spent waiting between
|
|
25
|
+
* retry attempts.
|
|
26
|
+
*/
|
|
27
|
+
totalRetryDelay?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface MetadataBearer {
|
|
30
|
+
/**
|
|
31
|
+
* Metadata pertaining to this request.
|
|
32
|
+
*/
|
|
33
|
+
$metadata: ResponseMetadata;
|
|
34
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { Endpoint } from "./http";
|
|
2
|
-
import { RequestHandler } from "./transfer";
|
|
3
|
-
import { Decoder, Encoder, Provider } from "./util";
|
|
4
|
-
/**
|
|
5
|
-
* Interface for object requires an Endpoint set.
|
|
6
|
-
*/
|
|
7
|
-
export interface EndpointBearer {
|
|
8
|
-
endpoint: Provider<Endpoint>;
|
|
9
|
-
}
|
|
10
|
-
export interface StreamCollector {
|
|
11
|
-
/**
|
|
12
|
-
* A function that converts a stream into an array of bytes.
|
|
13
|
-
*
|
|
14
|
-
* @param stream The low-level native stream from browser or Nodejs runtime
|
|
15
|
-
*/
|
|
16
|
-
(stream: any): Promise<Uint8Array>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Request and Response serde util functions and settings for AWS services
|
|
20
|
-
*/
|
|
21
|
-
export interface SerdeContext extends EndpointBearer {
|
|
22
|
-
base64Encoder: Encoder;
|
|
23
|
-
base64Decoder: Decoder;
|
|
24
|
-
utf8Encoder: Encoder;
|
|
25
|
-
utf8Decoder: Decoder;
|
|
26
|
-
streamCollector: StreamCollector;
|
|
27
|
-
requestHandler: RequestHandler<any, any>;
|
|
28
|
-
disableHostPrefix: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface RequestSerializer<Request, Context extends EndpointBearer = any> {
|
|
31
|
-
/**
|
|
32
|
-
* Converts the provided `input` into a request object
|
|
33
|
-
*
|
|
34
|
-
* @param input The user input to serialize.
|
|
35
|
-
*
|
|
36
|
-
* @param context Context containing runtime-specific util functions.
|
|
37
|
-
*/
|
|
38
|
-
(input: any, context: Context): Promise<Request>;
|
|
39
|
-
}
|
|
40
|
-
export interface ResponseDeserializer<OutputType, ResponseType = any, Context = any> {
|
|
41
|
-
/**
|
|
42
|
-
* Converts the output of an operation into JavaScript types.
|
|
43
|
-
*
|
|
44
|
-
* @param output The HTTP response received from the service
|
|
45
|
-
*
|
|
46
|
-
* @param context context containing runtime-specific util functions.
|
|
47
|
-
*/
|
|
48
|
-
(output: ResponseType, context: Context): Promise<OutputType>;
|
|
49
|
-
}
|
|
1
|
+
import { Endpoint } from "./http";
|
|
2
|
+
import { RequestHandler } from "./transfer";
|
|
3
|
+
import { Decoder, Encoder, Provider } from "./util";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for object requires an Endpoint set.
|
|
6
|
+
*/
|
|
7
|
+
export interface EndpointBearer {
|
|
8
|
+
endpoint: Provider<Endpoint>;
|
|
9
|
+
}
|
|
10
|
+
export interface StreamCollector {
|
|
11
|
+
/**
|
|
12
|
+
* A function that converts a stream into an array of bytes.
|
|
13
|
+
*
|
|
14
|
+
* @param stream The low-level native stream from browser or Nodejs runtime
|
|
15
|
+
*/
|
|
16
|
+
(stream: any): Promise<Uint8Array>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Request and Response serde util functions and settings for AWS services
|
|
20
|
+
*/
|
|
21
|
+
export interface SerdeContext extends EndpointBearer {
|
|
22
|
+
base64Encoder: Encoder;
|
|
23
|
+
base64Decoder: Decoder;
|
|
24
|
+
utf8Encoder: Encoder;
|
|
25
|
+
utf8Decoder: Decoder;
|
|
26
|
+
streamCollector: StreamCollector;
|
|
27
|
+
requestHandler: RequestHandler<any, any>;
|
|
28
|
+
disableHostPrefix: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface RequestSerializer<Request, Context extends EndpointBearer = any> {
|
|
31
|
+
/**
|
|
32
|
+
* Converts the provided `input` into a request object
|
|
33
|
+
*
|
|
34
|
+
* @param input The user input to serialize.
|
|
35
|
+
*
|
|
36
|
+
* @param context Context containing runtime-specific util functions.
|
|
37
|
+
*/
|
|
38
|
+
(input: any, context: Context): Promise<Request>;
|
|
39
|
+
}
|
|
40
|
+
export interface ResponseDeserializer<OutputType, ResponseType = any, Context = any> {
|
|
41
|
+
/**
|
|
42
|
+
* Converts the output of an operation into JavaScript types.
|
|
43
|
+
*
|
|
44
|
+
* @param output The HTTP response received from the service
|
|
45
|
+
*
|
|
46
|
+
* @param context context containing runtime-specific util functions.
|
|
47
|
+
*/
|
|
48
|
+
(output: ResponseType, context: Context): Promise<OutputType>;
|
|
49
|
+
}
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { HttpRequest } from "./http";
|
|
2
|
-
/**
|
|
3
|
-
* A {Date} object, a unix (epoch) timestamp in seconds, or a string that can be
|
|
4
|
-
* understood by the JavaScript {Date} constructor.
|
|
5
|
-
*/
|
|
6
|
-
export declare type DateInput = number | string | Date;
|
|
7
|
-
export interface SigningArguments {
|
|
8
|
-
/**
|
|
9
|
-
* The date and time to be used as signature metadata. This value should be
|
|
10
|
-
* a Date object, a unix (epoch) timestamp, or a string that can be
|
|
11
|
-
* understood by the JavaScript `Date` constructor.If not supplied, the
|
|
12
|
-
* value returned by `new Date()` will be used.
|
|
13
|
-
*/
|
|
14
|
-
signingDate?: DateInput;
|
|
15
|
-
/**
|
|
16
|
-
* The service signing name. It will override the service name of the signer
|
|
17
|
-
* in current invocation
|
|
18
|
-
*/
|
|
19
|
-
signingService?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The region name to sign the request. It will override the signing region of the
|
|
22
|
-
* signer in current invocation
|
|
23
|
-
*/
|
|
24
|
-
signingRegion?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface RequestSigningArguments extends SigningArguments {
|
|
27
|
-
/**
|
|
28
|
-
* A set of strings whose members represents headers that cannot be signed.
|
|
29
|
-
* All headers in the provided request will have their names converted to
|
|
30
|
-
* lower case and then checked for existence in the unsignableHeaders set.
|
|
31
|
-
*/
|
|
32
|
-
unsignableHeaders?: Set<string>;
|
|
33
|
-
/**
|
|
34
|
-
* A set of strings whose members represents headers that should be signed.
|
|
35
|
-
* Any values passed here will override those provided via unsignableHeaders,
|
|
36
|
-
* allowing them to be signed.
|
|
37
|
-
*
|
|
38
|
-
* All headers in the provided request will have their names converted to
|
|
39
|
-
* lower case before signing.
|
|
40
|
-
*/
|
|
41
|
-
signableHeaders?: Set<string>;
|
|
42
|
-
}
|
|
43
|
-
export interface RequestPresigningArguments extends RequestSigningArguments {
|
|
44
|
-
/**
|
|
45
|
-
* The number of seconds before the presigned URL expires
|
|
46
|
-
*/
|
|
47
|
-
expiresIn?: number;
|
|
48
|
-
/**
|
|
49
|
-
* A set of strings whose representing headers that should not be hoisted
|
|
50
|
-
* to presigned request's query string. If not supplied, the presigner
|
|
51
|
-
* moves all the AWS-specific headers (starting with `x-amz-`) to the request
|
|
52
|
-
* query string. If supplied, these headers remain in the presigned request's
|
|
53
|
-
* header.
|
|
54
|
-
* All headers in the provided request will have their names converted to
|
|
55
|
-
* lower case and then checked for existence in the unhoistableHeaders set.
|
|
56
|
-
*/
|
|
57
|
-
unhoistableHeaders?: Set<string>;
|
|
58
|
-
}
|
|
59
|
-
export interface EventSigningArguments extends SigningArguments {
|
|
60
|
-
priorSignature: string;
|
|
61
|
-
}
|
|
62
|
-
export interface RequestPresigner {
|
|
63
|
-
/**
|
|
64
|
-
* Signs a request for future use.
|
|
65
|
-
*
|
|
66
|
-
* The request will be valid until either the provided `expiration` time has
|
|
67
|
-
* passed or the underlying credentials have expired.
|
|
68
|
-
*
|
|
69
|
-
* @param requestToSign The request that should be signed.
|
|
70
|
-
* @param options Additional signing options.
|
|
71
|
-
*/
|
|
72
|
-
presign(requestToSign: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* An object that signs request objects with AWS credentials using one of the
|
|
76
|
-
* AWS authentication protocols.
|
|
77
|
-
*/
|
|
78
|
-
export interface RequestSigner {
|
|
79
|
-
/**
|
|
80
|
-
* Sign the provided request for immediate dispatch.
|
|
81
|
-
*/
|
|
82
|
-
sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
|
|
83
|
-
}
|
|
84
|
-
export interface StringSigner {
|
|
85
|
-
/**
|
|
86
|
-
* Sign the provided `stringToSign` for use outside of the context of
|
|
87
|
-
* request signing. Typical uses include signed policy generation.
|
|
88
|
-
*/
|
|
89
|
-
sign(stringToSign: string, options?: SigningArguments): Promise<string>;
|
|
90
|
-
}
|
|
91
|
-
export interface FormattedEvent {
|
|
92
|
-
headers: Uint8Array;
|
|
93
|
-
payload: Uint8Array;
|
|
94
|
-
}
|
|
95
|
-
export interface EventSigner {
|
|
96
|
-
/**
|
|
97
|
-
* Sign the individual event of the event stream.
|
|
98
|
-
*/
|
|
99
|
-
sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
|
|
100
|
-
}
|
|
1
|
+
import { HttpRequest } from "./http";
|
|
2
|
+
/**
|
|
3
|
+
* A {Date} object, a unix (epoch) timestamp in seconds, or a string that can be
|
|
4
|
+
* understood by the JavaScript {Date} constructor.
|
|
5
|
+
*/
|
|
6
|
+
export declare type DateInput = number | string | Date;
|
|
7
|
+
export interface SigningArguments {
|
|
8
|
+
/**
|
|
9
|
+
* The date and time to be used as signature metadata. This value should be
|
|
10
|
+
* a Date object, a unix (epoch) timestamp, or a string that can be
|
|
11
|
+
* understood by the JavaScript `Date` constructor.If not supplied, the
|
|
12
|
+
* value returned by `new Date()` will be used.
|
|
13
|
+
*/
|
|
14
|
+
signingDate?: DateInput;
|
|
15
|
+
/**
|
|
16
|
+
* The service signing name. It will override the service name of the signer
|
|
17
|
+
* in current invocation
|
|
18
|
+
*/
|
|
19
|
+
signingService?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The region name to sign the request. It will override the signing region of the
|
|
22
|
+
* signer in current invocation
|
|
23
|
+
*/
|
|
24
|
+
signingRegion?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface RequestSigningArguments extends SigningArguments {
|
|
27
|
+
/**
|
|
28
|
+
* A set of strings whose members represents headers that cannot be signed.
|
|
29
|
+
* All headers in the provided request will have their names converted to
|
|
30
|
+
* lower case and then checked for existence in the unsignableHeaders set.
|
|
31
|
+
*/
|
|
32
|
+
unsignableHeaders?: Set<string>;
|
|
33
|
+
/**
|
|
34
|
+
* A set of strings whose members represents headers that should be signed.
|
|
35
|
+
* Any values passed here will override those provided via unsignableHeaders,
|
|
36
|
+
* allowing them to be signed.
|
|
37
|
+
*
|
|
38
|
+
* All headers in the provided request will have their names converted to
|
|
39
|
+
* lower case before signing.
|
|
40
|
+
*/
|
|
41
|
+
signableHeaders?: Set<string>;
|
|
42
|
+
}
|
|
43
|
+
export interface RequestPresigningArguments extends RequestSigningArguments {
|
|
44
|
+
/**
|
|
45
|
+
* The number of seconds before the presigned URL expires
|
|
46
|
+
*/
|
|
47
|
+
expiresIn?: number;
|
|
48
|
+
/**
|
|
49
|
+
* A set of strings whose representing headers that should not be hoisted
|
|
50
|
+
* to presigned request's query string. If not supplied, the presigner
|
|
51
|
+
* moves all the AWS-specific headers (starting with `x-amz-`) to the request
|
|
52
|
+
* query string. If supplied, these headers remain in the presigned request's
|
|
53
|
+
* header.
|
|
54
|
+
* All headers in the provided request will have their names converted to
|
|
55
|
+
* lower case and then checked for existence in the unhoistableHeaders set.
|
|
56
|
+
*/
|
|
57
|
+
unhoistableHeaders?: Set<string>;
|
|
58
|
+
}
|
|
59
|
+
export interface EventSigningArguments extends SigningArguments {
|
|
60
|
+
priorSignature: string;
|
|
61
|
+
}
|
|
62
|
+
export interface RequestPresigner {
|
|
63
|
+
/**
|
|
64
|
+
* Signs a request for future use.
|
|
65
|
+
*
|
|
66
|
+
* The request will be valid until either the provided `expiration` time has
|
|
67
|
+
* passed or the underlying credentials have expired.
|
|
68
|
+
*
|
|
69
|
+
* @param requestToSign The request that should be signed.
|
|
70
|
+
* @param options Additional signing options.
|
|
71
|
+
*/
|
|
72
|
+
presign(requestToSign: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* An object that signs request objects with AWS credentials using one of the
|
|
76
|
+
* AWS authentication protocols.
|
|
77
|
+
*/
|
|
78
|
+
export interface RequestSigner {
|
|
79
|
+
/**
|
|
80
|
+
* Sign the provided request for immediate dispatch.
|
|
81
|
+
*/
|
|
82
|
+
sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
|
|
83
|
+
}
|
|
84
|
+
export interface StringSigner {
|
|
85
|
+
/**
|
|
86
|
+
* Sign the provided `stringToSign` for use outside of the context of
|
|
87
|
+
* request signing. Typical uses include signed policy generation.
|
|
88
|
+
*/
|
|
89
|
+
sign(stringToSign: string, options?: SigningArguments): Promise<string>;
|
|
90
|
+
}
|
|
91
|
+
export interface FormattedEvent {
|
|
92
|
+
headers: Uint8Array;
|
|
93
|
+
payload: Uint8Array;
|
|
94
|
+
}
|
|
95
|
+
export interface EventSigner {
|
|
96
|
+
/**
|
|
97
|
+
* Sign the individual event of the event stream.
|
|
98
|
+
*/
|
|
99
|
+
sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
|
|
100
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export declare type RequestHandlerOutput<ResponseType> = {
|
|
2
|
-
response: ResponseType;
|
|
3
|
-
};
|
|
4
|
-
export interface RequestHandler<RequestType, ResponseType, HandlerOptions = {}> {
|
|
5
|
-
/**
|
|
6
|
-
* metadata contains information of a handler. For example
|
|
7
|
-
* 'h2' refers this handler is for handling HTTP/2 requests,
|
|
8
|
-
* whereas 'h1' refers handling HTTP1 requests
|
|
9
|
-
*/
|
|
10
|
-
metadata?: RequestHandlerMetadata;
|
|
11
|
-
destroy?: () => void;
|
|
12
|
-
handle: (request: RequestType, handlerOptions?: HandlerOptions) => Promise<RequestHandlerOutput<ResponseType>>;
|
|
13
|
-
}
|
|
14
|
-
export interface RequestHandlerMetadata {
|
|
15
|
-
handlerProtocol: string;
|
|
16
|
-
}
|
|
1
|
+
export declare type RequestHandlerOutput<ResponseType> = {
|
|
2
|
+
response: ResponseType;
|
|
3
|
+
};
|
|
4
|
+
export interface RequestHandler<RequestType, ResponseType, HandlerOptions = {}> {
|
|
5
|
+
/**
|
|
6
|
+
* metadata contains information of a handler. For example
|
|
7
|
+
* 'h2' refers this handler is for handling HTTP/2 requests,
|
|
8
|
+
* whereas 'h1' refers handling HTTP1 requests
|
|
9
|
+
*/
|
|
10
|
+
metadata?: RequestHandlerMetadata;
|
|
11
|
+
destroy?: () => void;
|
|
12
|
+
handle: (request: RequestType, handlerOptions?: HandlerOptions) => Promise<RequestHandlerOutput<ResponseType>>;
|
|
13
|
+
}
|
|
14
|
+
export interface RequestHandlerMetadata {
|
|
15
|
+
handlerProtocol: string;
|
|
16
|
+
}
|
|
@@ -1,83 +1,100 @@
|
|
|
1
|
-
import { Endpoint } from "./http";
|
|
2
|
-
import { FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput } from "./middleware";
|
|
3
|
-
import { MetadataBearer } from "./response";
|
|
4
|
-
/**
|
|
5
|
-
* A function that, given a TypedArray of bytes, can produce a string
|
|
6
|
-
* representation thereof.
|
|
7
|
-
*
|
|
8
|
-
* @example An encoder function that converts bytes to hexadecimal
|
|
9
|
-
* representation would return `'deadbeef'` when given `new
|
|
10
|
-
* Uint8Array([0xde, 0xad, 0xbe, 0xef])`.
|
|
11
|
-
*/
|
|
12
|
-
export interface Encoder {
|
|
13
|
-
(input: Uint8Array): string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A function that, given a string, can derive the bytes represented by that
|
|
17
|
-
* string.
|
|
18
|
-
*
|
|
19
|
-
* @example A decoder function that converts bytes to hexadecimal
|
|
20
|
-
* representation would return `new Uint8Array([0xde, 0xad, 0xbe, 0xef])` when
|
|
21
|
-
* given the string `'deadbeef'`.
|
|
22
|
-
*/
|
|
23
|
-
export interface Decoder {
|
|
24
|
-
(input: string): Uint8Array;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* A function that, when invoked, returns a promise that will be fulfilled with
|
|
28
|
-
* a value of type T.
|
|
29
|
-
*
|
|
30
|
-
* @example A function that reads credentials from shared SDK configuration
|
|
31
|
-
* files, assuming roles and collecting MFA tokens as necessary.
|
|
32
|
-
*/
|
|
33
|
-
export interface Provider<T> {
|
|
34
|
-
(): Promise<T>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* A function that, given a request body, determines the
|
|
38
|
-
* length of the body. This is used to determine the Content-Length
|
|
39
|
-
* that should be sent with a request.
|
|
40
|
-
*
|
|
41
|
-
* @example A function that reads a file stream and calculates
|
|
42
|
-
* the size of the file.
|
|
43
|
-
*/
|
|
44
|
-
export interface BodyLengthCalculator {
|
|
45
|
-
(body: any): number | undefined;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Interface that specifies the retry behavior
|
|
49
|
-
*/
|
|
50
|
-
export interface RetryStrategy {
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
import { Endpoint } from "./http";
|
|
2
|
+
import { FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput } from "./middleware";
|
|
3
|
+
import { MetadataBearer } from "./response";
|
|
4
|
+
/**
|
|
5
|
+
* A function that, given a TypedArray of bytes, can produce a string
|
|
6
|
+
* representation thereof.
|
|
7
|
+
*
|
|
8
|
+
* @example An encoder function that converts bytes to hexadecimal
|
|
9
|
+
* representation would return `'deadbeef'` when given `new
|
|
10
|
+
* Uint8Array([0xde, 0xad, 0xbe, 0xef])`.
|
|
11
|
+
*/
|
|
12
|
+
export interface Encoder {
|
|
13
|
+
(input: Uint8Array): string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A function that, given a string, can derive the bytes represented by that
|
|
17
|
+
* string.
|
|
18
|
+
*
|
|
19
|
+
* @example A decoder function that converts bytes to hexadecimal
|
|
20
|
+
* representation would return `new Uint8Array([0xde, 0xad, 0xbe, 0xef])` when
|
|
21
|
+
* given the string `'deadbeef'`.
|
|
22
|
+
*/
|
|
23
|
+
export interface Decoder {
|
|
24
|
+
(input: string): Uint8Array;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A function that, when invoked, returns a promise that will be fulfilled with
|
|
28
|
+
* a value of type T.
|
|
29
|
+
*
|
|
30
|
+
* @example A function that reads credentials from shared SDK configuration
|
|
31
|
+
* files, assuming roles and collecting MFA tokens as necessary.
|
|
32
|
+
*/
|
|
33
|
+
export interface Provider<T> {
|
|
34
|
+
(): Promise<T>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A function that, given a request body, determines the
|
|
38
|
+
* length of the body. This is used to determine the Content-Length
|
|
39
|
+
* that should be sent with a request.
|
|
40
|
+
*
|
|
41
|
+
* @example A function that reads a file stream and calculates
|
|
42
|
+
* the size of the file.
|
|
43
|
+
*/
|
|
44
|
+
export interface BodyLengthCalculator {
|
|
45
|
+
(body: any): number | undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Interface that specifies the retry behavior
|
|
49
|
+
*/
|
|
50
|
+
export interface RetryStrategy {
|
|
51
|
+
/**
|
|
52
|
+
* The retry mode describing how the retry strategy control the traffic flow.
|
|
53
|
+
*/
|
|
54
|
+
mode?: string;
|
|
55
|
+
/**
|
|
56
|
+
* the retry behavior the will invoke the next handler and handle the retry accordingly.
|
|
57
|
+
* This function should also update the $metadata from the response accordingly.
|
|
58
|
+
* @see {@link ResponseMetadata}
|
|
59
|
+
*/
|
|
60
|
+
retry: <Input extends object, Output extends MetadataBearer>(next: FinalizeHandler<Input, Output>, args: FinalizeHandlerArguments<Input>) => Promise<FinalizeHandlerOutput<Output>>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Parses a URL in string form into an Endpoint object.
|
|
64
|
+
*/
|
|
65
|
+
export interface UrlParser {
|
|
66
|
+
(url: string): Endpoint;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Object containing regionalization information of
|
|
70
|
+
* AWS services.
|
|
71
|
+
*/
|
|
72
|
+
export interface RegionInfo {
|
|
73
|
+
hostname: string;
|
|
74
|
+
partition: string;
|
|
75
|
+
path?: string;
|
|
76
|
+
signingService?: string;
|
|
77
|
+
signingRegion?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Function returns designated service's regionalization
|
|
81
|
+
* information from given region. Each service client
|
|
82
|
+
* comes with its regionalization provider. it serves
|
|
83
|
+
* to provide the default values of related configurations
|
|
84
|
+
*/
|
|
85
|
+
export interface RegionInfoProvider {
|
|
86
|
+
(region: string, options?: any): Promise<RegionInfo | undefined>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A tuple that represents an API name and optional version
|
|
90
|
+
* of a library built using the AWS SDK.
|
|
91
|
+
*/
|
|
92
|
+
export declare type UserAgentPair = [
|
|
93
|
+
/*name*/ string,
|
|
94
|
+
/*version*/ string
|
|
95
|
+
];
|
|
96
|
+
/**
|
|
97
|
+
* User agent data that to be put into the request's user
|
|
98
|
+
* agent.
|
|
99
|
+
*/
|
|
100
|
+
export declare type UserAgent = UserAgentPair[];
|
|
@@ -48,6 +48,10 @@ export interface BodyLengthCalculator {
|
|
|
48
48
|
* Interface that specifies the retry behavior
|
|
49
49
|
*/
|
|
50
50
|
export interface RetryStrategy {
|
|
51
|
+
/**
|
|
52
|
+
* The retry mode describing how the retry strategy control the traffic flow.
|
|
53
|
+
*/
|
|
54
|
+
mode?: string;
|
|
51
55
|
/**
|
|
52
56
|
* the retry behavior the will invoke the next handler and handle the retry accordingly.
|
|
53
57
|
* This function should also update the $metadata from the response accordingly.
|
|
@@ -81,3 +85,13 @@ export interface RegionInfo {
|
|
|
81
85
|
export interface RegionInfoProvider {
|
|
82
86
|
(region: string, options?: any): Promise<RegionInfo | undefined>;
|
|
83
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* A tuple that represents an API name and optional version
|
|
90
|
+
* of a library built using the AWS SDK.
|
|
91
|
+
*/
|
|
92
|
+
export declare type UserAgentPair = [name: string, version?: string];
|
|
93
|
+
/**
|
|
94
|
+
* User agent data that to be put into the request's user
|
|
95
|
+
* agent.
|
|
96
|
+
*/
|
|
97
|
+
export declare type UserAgent = UserAgentPair[];
|