1
- import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node" ;
2
- import { Hash } from "@aws-sdk/hash-node" ;
3
- import { NodeHttpHandler } from "@aws-sdk/node-http-handler" ;
4
- import { defaultProvider as regionDefaultProvider } from "@aws-sdk/region-provider" ;
5
- import { parseUrl } from "@aws-sdk/url-parser-node" ;
6
- import { calculateBodyLength } from "@aws-sdk/util-body-length-node" ;
7
- import { streamCollector } from '@aws-sdk/stream-collector-node' ;
8
- import { RestJsonProtocol } from "@aws-sdk/protocol-rest-json" ;
9
- import { fromUtf8 , toUtf8 } from '@aws-sdk/util-utf8-node' ;
10
- import { fromBase64 , toBase64 } from '@aws-sdk/util-base64-node' ;
11
- import { defaultUserAgent } from '@aws-sdk/util-user-agent-node' ;
12
- import { AwsAuthConfiguration , AwsAuthConfigurationInput } from '@aws-sdk/signing-middleware' ;
13
- import { UserAgentConfig , UserAgentConfigInput } from '@aws-sdk/middleware-user-agent' ;
14
- import { RetryConfig , RetryConfigInput } from '@aws-sdk/retry-middleware' ;
15
- import { name , version } from './package.json' ;
1
+ import {
2
+ AwsAuthConfiguration ,
3
+ AwsAuthConfigurationInput
4
+ } from "@aws-sdk/signing-middleware" ;
5
+ import {
6
+ UserAgentConfig ,
7
+ UserAgentConfigInput
8
+ } from "@aws-sdk/middleware-user-agent" ;
9
+ import { RetryConfig , RetryConfigInput } from "@aws-sdk/retry-middleware" ;
16
10
import {
17
11
RegionConfiguration ,
18
12
RegionConfigurationInput ,
19
13
EndpointsConfig ,
20
14
EndpointsConfigInput ,
21
15
ProtocolConfig ,
22
- ProtocolConfigInput ,
23
- AWSClientRuntimeConfiguration
24
- } from '@aws-sdk/config-resolver' ;
25
-
26
- export type AWSClientRuntimeResolvedConfiguration = Required < AWSClientRuntimeConfiguration > ;
27
-
28
- export const RDSRuntimeConfiguration : AWSClientRuntimeResolvedConfiguration = {
29
- protocolDefaultProvider : ( handler ) => new RestJsonProtocol ( handler ) ,
30
- signingName : "rds-data" ,
31
- service : "rds-data" ,
32
- httpHandler : new NodeHttpHandler ( ) ,
33
- sha256 : Hash . bind ( null , "sha256" ) ,
34
- credentialDefaultProvider,
35
- regionDefaultProvider,
36
- urlParser : parseUrl ,
37
- bodyLengthChecker : calculateBodyLength ,
38
- streamCollector,
39
- base64Decoder : fromBase64 ,
40
- base64Encoder : toBase64 ,
41
- utf8Decoder : fromUtf8 ,
42
- utf8Encoder : toUtf8 ,
43
- defaultUserAgent : defaultUserAgent ( name , version )
16
+ ProtocolConfigInput
17
+ } from "@aws-sdk/config-resolver" ;
18
+ import {
19
+ Credentials ,
20
+ Provider ,
21
+ HashConstructor ,
22
+ UrlParser ,
23
+ Protocol ,
24
+ StreamCollector ,
25
+ Decoder ,
26
+ Encoder
27
+ } from "@aws-sdk/types" ;
28
+ import { HttpHandler , HttpRequest , HttpResponse } from "@aws-sdk/protocol-http" ;
29
+
30
+ export interface RDSDataRuntimeDependencies {
31
+ /**
32
+ * The HTTP handler to use. Fetch in browser and Https in Nodejs
33
+ */
34
+ httpHandler ?: HttpHandler ;
35
+
36
+ /**
37
+ * A constructor for a class implementing the @aws-sdk/types.Hash interface that computes the SHA-256 HMAC or checksum of a string or binary buffer
38
+ */
39
+ sha256 ?: HashConstructor ;
40
+
41
+ /**
42
+ * Default credentials provider; Not available in browser runtime
43
+ */
44
+ credentialDefaultProvider ?: ( input : any ) => Provider < Credentials > ;
45
+
46
+ /**
47
+ * Provider function that return promise of a region string
48
+ */
49
+ regionDefaultProvider ?: ( input : any ) => Provider < string > ;
50
+
51
+ /**
52
+ * The function that will be used to convert strings into HTTP endpoints
53
+ */
54
+ urlParser ?: UrlParser ;
55
+
56
+ /**
57
+ * A function that can calculate the length of a request body.
58
+ */
59
+ bodyLengthChecker ?: ( body : any ) => number | undefined ;
60
+
61
+ /**
62
+ * A function that converts a stream into an array of bytes.
63
+ */
64
+ streamCollector ?: StreamCollector ;
65
+
66
+ /**
67
+ * The function that will be used to convert a base64-encoded string to a byte array
68
+ */
69
+ base64Decoder ?: Decoder ;
70
+
71
+ /**
72
+ * The function that will be used to convert binary data to a base64-encoded string
73
+ */
74
+ base64Encoder ?: Encoder ;
75
+
76
+ /**
77
+ * The function that will be used to convert a UTF8-encoded string to a byte array
78
+ */
79
+ utf8Decoder ?: Decoder ;
80
+
81
+ /**
82
+ * The function that will be used to convert binary data to a UTF-8 encoded string
83
+ */
84
+ utf8Encoder ?: Encoder ;
85
+
86
+ /**
87
+ * The function that will be used to populate default value in 'User-Agent' header
88
+ */
89
+ defaultUserAgent ?: string ;
90
+
91
+ /**
92
+ * The function that will be used to populate serializing protocol
93
+ */
94
+ protocolDefaultProvider ?: (
95
+ handler : HttpHandler
96
+ ) => Protocol < HttpRequest , HttpResponse > ;
97
+
98
+ /**
99
+ * The service name with which to sign requests.
100
+ */
101
+ signingName ?: string ;
102
+
103
+ /**
104
+ * The service name with which to construct endpoints.
105
+ */
106
+ service ?: string ;
44
107
}
45
108
46
- export type RDSDataConfiguration = AWSClientRuntimeConfiguration &
109
+ export type RDSDataConfiguration = RDSDataRuntimeDependencies &
47
110
AwsAuthConfigurationInput &
48
111
RegionConfigurationInput &
49
112
RetryConfigInput &
50
113
EndpointsConfigInput &
51
114
ProtocolConfigInput &
52
- UserAgentConfigInput
115
+ UserAgentConfigInput ;
53
116
54
- export type RDSDataResolvedConfiguration = AWSClientRuntimeResolvedConfiguration &
117
+ export type RDSDataResolvedConfiguration = Required <
118
+ RDSDataRuntimeDependencies
119
+ > &
55
120
AwsAuthConfiguration . Resolved &
56
121
RegionConfiguration . Resolved &
57
122
RetryConfig . Resolved &
58
123
EndpointsConfig . Resolved &
59
124
ProtocolConfig . Resolved &
60
- UserAgentConfig . Resolved
125
+ UserAgentConfig . Resolved ;
0 commit comments