-
Notifications
You must be signed in to change notification settings - Fork 615
feat: standardize plugins #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AllanZhengYP
merged 20 commits into
aws:smithy-codegen
from
AllanZhengYP:standardize-plugins
Oct 29, 2019
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
020fb0d
feat: standardize Config naming, add getMiddleware fn
4a2c1bf
feat: update client naming
6b3405d
fix: add back protocol config
796c246
fix: remove structValue on visitor
fd542ed
fix: remove Config naming
8ae1483
feat: add ContentLength
be5473c
feat: change to resolveConfig and setMiddleware
a641570
fix: resolveConfig on config-resolver
5ae1811
fix: revert changelog changes
c01c845
fix: clean up commented
885a226
chore: resolve merging conflicts
AllanZhengYP e30bd0f
feat: move client.use() to client.middlewarestack.use()
AllanZhengYP 90fcc28
feat: use naming convention instead of namespace
AllanZhengYP f60c6c0
feat: add smithy resolved config type to client config type
AllanZhengYP 5d3e5e7
chore: move rds node client to rds universal client
AllanZhengYP b4acef2
feat: update client destroy method
AllanZhengYP 1bb9f02
feat: move rds client config to the client file
AllanZhengYP a8a50c0
fix: fix client export
AllanZhengYP 3839e22
chore: update README
AllanZhengYP ef2258d
fix: fix endpoints config
AllanZhengYP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
import { | ||
BatchExecuteStatementRequest, | ||
BatchExecuteStatementResponse, | ||
BeginTransactionRequest, | ||
BeginTransactionResponse, | ||
CommitTransactionRequest, | ||
CommitTransactionResponse, | ||
ExecuteSqlRequest, | ||
ExecuteSqlResponse, | ||
ExecuteStatementRequest, | ||
ExecuteStatementResponse, | ||
RollbackTransactionRequest, | ||
RollbackTransactionResponse | ||
} from "./models/index"; | ||
import { RDSRuntimeConfiguration } from "./runtimeConfig"; | ||
import { | ||
Credentials, | ||
Provider, | ||
HashConstructor, | ||
UrlParser, | ||
Protocol, | ||
StreamCollector, | ||
Decoder, | ||
Encoder | ||
} from "@aws-sdk/types"; | ||
import { | ||
EndpointsConfigInput, | ||
EndpointsConfigResolved, | ||
resolveEndpointsConfig, | ||
ClientProtocolConfigInput, | ||
ClientProtocolConfigResolved, | ||
resolveClientProtocolConfig, | ||
destroyClientProtocolConfig, | ||
RegionConfigInput, | ||
RegionConfigResolved, | ||
resolveRegionConfig | ||
} from "@aws-sdk/config-resolver"; | ||
import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; | ||
import { | ||
UserAgentConfigInput, | ||
UserAgentConfigResolved, | ||
resolveUserAgentConfig, | ||
getUserAgentPlugin | ||
} from "@aws-sdk/middleware-user-agent"; | ||
import { | ||
RetryConfigInput, | ||
RetryConfigResolved, | ||
resolveRetryConfig, | ||
getRetryPlugin | ||
} from "@aws-sdk/middleware-retry"; | ||
import { | ||
AwsAuthConfigInput, | ||
AwsAuthConfigResolved, | ||
resolveAwsAuthConfig, | ||
getAwsAuthPlugin | ||
} from "@aws-sdk/middleware-signing"; | ||
import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { | ||
Client as SmithyClient, | ||
SmithyResolvedConfiguration | ||
} from "@aws-sdk/smithy-client"; | ||
import { HttpOptions as __HttpOptions } from "@aws-sdk/types"; | ||
|
||
export type ServiceInputTypes = | ||
| RollbackTransactionRequest | ||
| CommitTransactionRequest | ||
| ExecuteSqlRequest | ||
| BeginTransactionRequest | ||
| ExecuteStatementRequest | ||
| BatchExecuteStatementRequest; | ||
|
||
export type ServiceOutputTypes = | ||
| RollbackTransactionResponse | ||
| CommitTransactionResponse | ||
| ExecuteSqlResponse | ||
| BeginTransactionResponse | ||
| ExecuteStatementResponse | ||
| BatchExecuteStatementResponse; | ||
|
||
export interface RDSDataRuntimeDependencies { | ||
/** | ||
* The HTTP handler to use. Fetch in browser and Https in Nodejs | ||
*/ | ||
httpHandler?: HttpHandler; | ||
|
||
/** | ||
* 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 | ||
*/ | ||
sha256?: HashConstructor; | ||
|
||
/** | ||
* Default credentials provider; Not available in browser runtime | ||
*/ | ||
credentialDefaultProvider?: (input: any) => Provider<Credentials>; | ||
|
||
/** | ||
* Provider function that return promise of a region string | ||
*/ | ||
regionDefaultProvider?: (input: any) => Provider<string>; | ||
|
||
/** | ||
* The function that will be used to convert strings into HTTP endpoints | ||
*/ | ||
urlParser?: UrlParser; | ||
|
||
/** | ||
* A function that can calculate the length of a request body. | ||
*/ | ||
bodyLengthChecker?: (body: any) => number | undefined; | ||
|
||
/** | ||
* A function that converts a stream into an array of bytes. | ||
*/ | ||
streamCollector?: StreamCollector; | ||
|
||
/** | ||
* The function that will be used to convert a base64-encoded string to a byte array | ||
*/ | ||
base64Decoder?: Decoder; | ||
|
||
/** | ||
* The function that will be used to convert binary data to a base64-encoded string | ||
*/ | ||
base64Encoder?: Encoder; | ||
|
||
/** | ||
* The function that will be used to convert a UTF8-encoded string to a byte array | ||
*/ | ||
utf8Decoder?: Decoder; | ||
|
||
/** | ||
* The function that will be used to convert binary data to a UTF-8 encoded string | ||
*/ | ||
utf8Encoder?: Encoder; | ||
|
||
/** | ||
* The function that will be used to populate default value in 'User-Agent' header | ||
*/ | ||
defaultUserAgent?: string; | ||
|
||
/** | ||
* The function that will be used to populate serializing protocol | ||
*/ | ||
protocolDefaultProvider?: ( | ||
handler: HttpHandler | ||
) => Protocol<HttpRequest, HttpResponse>; | ||
|
||
/** | ||
* The service name with which to sign requests. | ||
*/ | ||
signingName?: string; | ||
|
||
/** | ||
* The service name with which to construct endpoints. | ||
*/ | ||
service?: string; | ||
} | ||
|
||
export type RdsDataServiceConfig = RDSDataRuntimeDependencies & | ||
AwsAuthConfigInput & | ||
RegionConfigInput & | ||
RetryConfigInput & | ||
EndpointsConfigInput & | ||
ClientProtocolConfigInput & | ||
UserAgentConfigInput; | ||
|
||
export type RdsDataServiceResolvedConfig = SmithyResolvedConfiguration< | ||
__HttpOptions | ||
> & | ||
Required<RDSDataRuntimeDependencies> & | ||
AwsAuthConfigResolved & | ||
RegionConfigResolved & | ||
RetryConfigResolved & | ||
EndpointsConfigResolved & | ||
ClientProtocolConfigResolved & | ||
UserAgentConfigResolved; | ||
|
||
export class RdsDataService extends SmithyClient< | ||
__HttpOptions, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
> { | ||
readonly config: RdsDataServiceResolvedConfig; | ||
|
||
constructor(configuration: RdsDataServiceConfig) { | ||
const _config_0 = resolveClientProtocolConfig({ | ||
...RDSRuntimeConfiguration, | ||
...configuration | ||
}); | ||
let _config_1 = resolveRegionConfig(_config_0); | ||
let _config_2 = resolveAwsAuthConfig(_config_1); | ||
let _config_3 = resolveEndpointsConfig(_config_2); | ||
let _config_4 = resolveRetryConfig(_config_3); | ||
let _config_5 = resolveUserAgentConfig(_config_4); | ||
super(_config_5); | ||
this.config = _config_5; | ||
trivikr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
this.middlewareStack.use(getContentLengthPlugin(this.config)); | ||
this.middlewareStack.use(getAwsAuthPlugin(this.config)); | ||
this.middlewareStack.use(getRetryPlugin(this.config)); | ||
this.middlewareStack.use(getUserAgentPlugin(this.config)); | ||
} | ||
|
||
destroy(): void { | ||
destroyClientProtocolConfig(this.config); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./RdsDataServiceClient"; | ||
export * from "./commands/ExecuteStatementCommand"; |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.