From 6bd04696e3d939c00e27aa573322cf26c8fbbef1 Mon Sep 17 00:00:00 2001 From: AllanFly120 Date: Mon, 28 Oct 2019 17:39:08 -0700 Subject: [PATCH] feat: standardize plugins (#422) --- .../.gitignore | 0 .../.npmignore | 0 .../CHANGELOG.md | 0 .../LICENSE | 0 .../README.md | 36 ++- .../client-rds-data/RdsDataServiceClient.ts | 206 ++++++++++++++++++ .../commands/ExecuteStatementCommand.ts | 19 +- clients/client-rds-data/index.ts | 2 + .../lib/smithy.ts | 0 .../models/index.ts | 0 .../package.json | 8 +- .../protocol/AwsRestJson1_1.ts | 0 .../runtimeConfig.browser.ts | 2 +- .../runtimeConfig.ts | 2 +- .../tsconfig.es.json | 0 .../tsconfig.json | 0 .../tsconfig.test.json | 0 .../client-rds-data-node/RDSDataClient.ts | 57 ----- .../RDSDataConfiguration.ts | 125 ----------- clients/node/client-rds-data-node/index.ts | 3 - jest.config.js | 4 +- package.json | 8 +- .../config-resolver/src/EndpointsConfig.ts | 87 ++++---- .../config-resolver/src/ProtocolConfig.ts | 50 ++--- packages/config-resolver/src/RegionConfig.ts | 44 ++-- .../middleware-content-length/src/index.ts | 16 +- .../.gitignore | 0 .../.npmignore | 0 .../CHANGELOG.md | 0 .../LICENSE | 0 packages/middleware-retry/README.md | 4 + .../jest.config.js | 0 .../package.json | 2 +- .../middleware-retry/src/configurations.ts | 28 +++ .../src/constants.ts | 0 .../src/defaultStrategy.ts | 0 .../src/delayDecider.spec.ts | 0 .../src/delayDecider.ts | 0 .../src/index.spec.ts | 18 +- .../src/index.ts | 0 .../src/retryDecider.spec.ts | 0 .../src/retryDecider.ts | 0 .../middleware-retry/src/retryMiddleware.ts | 31 +++ .../tsconfig.json | 0 .../tsconfig.test.json | 0 packages/middleware-serde/src/serdePlugin.ts | 22 +- .../.gitignore | 0 .../.npmignore | 0 .../CHANGELOG.md | 0 .../LICENSE | 0 packages/middleware-signing/README.md | 4 + .../jest.config.js | 0 .../package.json | 2 +- .../middleware-signing/src/configurations.ts | 63 ++++++ .../src/index.ts | 0 .../src/middleware.spec.ts | 0 .../src/middleware.ts | 22 +- .../tsconfig.json | 0 .../tsconfig.test.json | 0 packages/middleware-stack/src/index.ts | 9 +- .../src/configurations.ts | 38 ++-- .../middleware-user-agent/src/middleware.ts | 22 +- packages/retry-middleware/README.md | 4 - .../retry-middleware/src/configurations.ts | 31 --- .../retry-middleware/src/retryMiddleware.ts | 16 +- .../retryMiddleware.ts | 4 +- .../signatureCustomizations.ts | 10 +- .../src/internalImports.ts | 8 +- packages/signing-middleware/README.md | 4 - .../signing-middleware/src/configurations.ts | 68 ------ packages/smithy-client/src/client.ts | 5 +- packages/smithy-client/src/command.ts | 4 - packages/smithy-client/tsconfig.json | 1 + packages/types/src/middleware.ts | 4 +- packages/types/src/transfer.ts | 5 + yarn.lock | 20 +- 76 files changed, 588 insertions(+), 530 deletions(-) rename clients/{node/client-rds-data-node => client-rds-data}/.gitignore (100%) rename clients/{node/client-rds-data-node => client-rds-data}/.npmignore (100%) rename clients/{node/client-rds-data-node => client-rds-data}/CHANGELOG.md (100%) rename clients/{node/client-rds-data-node => client-rds-data}/LICENSE (100%) rename clients/{node/client-rds-data-node => client-rds-data}/README.md (74%) create mode 100644 clients/client-rds-data/RdsDataServiceClient.ts rename clients/{node/client-rds-data-node => client-rds-data}/commands/ExecuteStatementCommand.ts (82%) create mode 100644 clients/client-rds-data/index.ts rename clients/{node/client-rds-data-node => client-rds-data}/lib/smithy.ts (100%) rename clients/{node/client-rds-data-node => client-rds-data}/models/index.ts (100%) rename clients/{node/client-rds-data-node => client-rds-data}/package.json (94%) rename clients/{node/client-rds-data-node => client-rds-data}/protocol/AwsRestJson1_1.ts (100%) rename clients/{node/client-rds-data-node => client-rds-data}/runtimeConfig.browser.ts (95%) rename clients/{node/client-rds-data-node => client-rds-data}/runtimeConfig.ts (95%) rename clients/{node/client-rds-data-node => client-rds-data}/tsconfig.es.json (100%) rename clients/{node/client-rds-data-node => client-rds-data}/tsconfig.json (100%) rename clients/{node/client-rds-data-node => client-rds-data}/tsconfig.test.json (100%) delete mode 100644 clients/node/client-rds-data-node/RDSDataClient.ts delete mode 100644 clients/node/client-rds-data-node/RDSDataConfiguration.ts delete mode 100644 clients/node/client-rds-data-node/index.ts rename packages/{retry-middleware => middleware-retry}/.gitignore (100%) rename packages/{retry-middleware => middleware-retry}/.npmignore (100%) rename packages/{retry-middleware => middleware-retry}/CHANGELOG.md (100%) rename packages/{retry-middleware => middleware-retry}/LICENSE (100%) create mode 100644 packages/middleware-retry/README.md rename packages/{retry-middleware => middleware-retry}/jest.config.js (100%) rename packages/{retry-middleware => middleware-retry}/package.json (94%) create mode 100644 packages/middleware-retry/src/configurations.ts rename packages/{retry-middleware => middleware-retry}/src/constants.ts (100%) rename packages/{retry-middleware => middleware-retry}/src/defaultStrategy.ts (100%) rename packages/{retry-middleware => middleware-retry}/src/delayDecider.spec.ts (100%) rename packages/{retry-middleware => middleware-retry}/src/delayDecider.ts (100%) rename packages/{retry-middleware => middleware-retry}/src/index.spec.ts (88%) rename packages/{retry-middleware => middleware-retry}/src/index.ts (100%) rename packages/{retry-middleware => middleware-retry}/src/retryDecider.spec.ts (100%) rename packages/{retry-middleware => middleware-retry}/src/retryDecider.ts (100%) create mode 100644 packages/middleware-retry/src/retryMiddleware.ts rename packages/{retry-middleware => middleware-retry}/tsconfig.json (100%) rename packages/{retry-middleware => middleware-retry}/tsconfig.test.json (100%) rename packages/{signing-middleware => middleware-signing}/.gitignore (100%) rename packages/{signing-middleware => middleware-signing}/.npmignore (100%) rename packages/{signing-middleware => middleware-signing}/CHANGELOG.md (100%) rename packages/{signing-middleware => middleware-signing}/LICENSE (100%) create mode 100644 packages/middleware-signing/README.md rename packages/{signing-middleware => middleware-signing}/jest.config.js (100%) rename packages/{signing-middleware => middleware-signing}/package.json (94%) create mode 100644 packages/middleware-signing/src/configurations.ts rename packages/{signing-middleware => middleware-signing}/src/index.ts (100%) rename packages/{signing-middleware => middleware-signing}/src/middleware.spec.ts (100%) rename packages/{signing-middleware => middleware-signing}/src/middleware.ts (67%) rename packages/{signing-middleware => middleware-signing}/tsconfig.json (100%) rename packages/{signing-middleware => middleware-signing}/tsconfig.test.json (100%) delete mode 100644 packages/retry-middleware/README.md delete mode 100644 packages/retry-middleware/src/configurations.ts delete mode 100644 packages/signing-middleware/README.md delete mode 100644 packages/signing-middleware/src/configurations.ts diff --git a/clients/node/client-rds-data-node/.gitignore b/clients/client-rds-data/.gitignore similarity index 100% rename from clients/node/client-rds-data-node/.gitignore rename to clients/client-rds-data/.gitignore diff --git a/clients/node/client-rds-data-node/.npmignore b/clients/client-rds-data/.npmignore similarity index 100% rename from clients/node/client-rds-data-node/.npmignore rename to clients/client-rds-data/.npmignore diff --git a/clients/node/client-rds-data-node/CHANGELOG.md b/clients/client-rds-data/CHANGELOG.md similarity index 100% rename from clients/node/client-rds-data-node/CHANGELOG.md rename to clients/client-rds-data/CHANGELOG.md diff --git a/clients/node/client-rds-data-node/LICENSE b/clients/client-rds-data/LICENSE similarity index 100% rename from clients/node/client-rds-data-node/LICENSE rename to clients/client-rds-data/LICENSE diff --git a/clients/node/client-rds-data-node/README.md b/clients/client-rds-data/README.md similarity index 74% rename from clients/node/client-rds-data-node/README.md rename to clients/client-rds-data/README.md index 3d0ab51937e3..d6f5c2ef0480 100644 --- a/clients/node/client-rds-data-node/README.md +++ b/clients/client-rds-data/README.md @@ -1,7 +1,7 @@ -# @aws-sdk/client-rds-data-node +# @aws-sdk/client-rds-data -[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-rds-data-node/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds-data-node) -[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-rds-data-node.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds-data-node) +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-rds-data/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds-data) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-rds-data.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds-data) ## Description @@ -18,29 +18,29 @@ Serverless in the Amazon Aurora User Guide.

To install the this package using NPM, simply type the following into a terminal window: ``` -npm install @aws-sdk/client-rds-data-node +npm install @aws-sdk/client-rds-data ``` ## Getting Started ### Import -The AWS SDK is modulized by clients and commands in CommonJS modules. To send a request, you only need to import the client(`RDSDataClient`) and the commands you need, for example `BatchExecuteStatementCommand`: +The AWS SDK is modulized by clients and commands in CommonJS modules. To send a request, you only need to import the client(`RdsDataServiceClient`) and the commands you need, for example `BatchExecuteStatementCommand`: ```javascript //JavaScript const { - RDSDataClient -} = require("@aws-sdk/client-rds-data-node/RDSDataClient"); -const { + RdsDataServiceClient, BatchExecuteStatementCommand -} = require("@aws-sdk/client-rds-data-node/commands/BatchExecuteStatementCommand"); +} = require("@aws-sdk/client-rds-data"); ``` ```javascript //TypeScript -import { RDSDataClient } from "@aws-sdk/client-rds-data-node/RDSDataClient"; -import { BatchExecuteStatementCommand } from "@aws-sdk/client-rds-data-node/commands/BatchExecuteStatementCommand"; +import { + RdsDataServiceClient, + BatchExecuteStatementCommand +} from "@aws-sdk/client-rds-data"; ``` ### Usage @@ -53,7 +53,7 @@ To send a request, you: - If you are using a custom http handler, you may call `destroy()` to close open connections. ```javascript -const rDSData = new RDSDataClient({region: 'region'}); +const rDSData = new RdsDataServiceClient({region: 'region'}); //clients can be shared by different commands const params = { resourceArn: /**a string value*/, @@ -87,16 +87,6 @@ rDSData.send(batchExecuteStatementCommand, (err, data) => { }); ``` -The SDK can also send requests using the simplified callback style from version 2 of the SDK. - -```javascript -import * as AWS from "@aws-sdk/@aws-sdk/client-rds-data-node/RDSData"; -const rDSData = new AWS.RDSData({ region: "region" }); -rDSData.batchExecuteStatement(params, (err, data) => { - //do something -}); -``` - ### Troubleshooting When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id). @@ -131,7 +121,7 @@ Please use these community resources for getting help. We use the GitHub issues ## Contributing -This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/@aws-sdk/client-rds-data-node' package is updated. To contribute to SDK you can checkout our [code generator package][]. +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/@aws-sdk/client-rds-data' package is updated. To contribute to SDK you can checkout our [code generator package][]. ## License diff --git a/clients/client-rds-data/RdsDataServiceClient.ts b/clients/client-rds-data/RdsDataServiceClient.ts new file mode 100644 index 000000000000..051c131f7fee --- /dev/null +++ b/clients/client-rds-data/RdsDataServiceClient.ts @@ -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; + + /** + * Provider function that return promise of a region string + */ + regionDefaultProvider?: (input: any) => Provider; + + /** + * 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; + + /** + * 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 & + 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; + 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); + } +} diff --git a/clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts b/clients/client-rds-data/commands/ExecuteStatementCommand.ts similarity index 82% rename from clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts rename to clients/client-rds-data/commands/ExecuteStatementCommand.ts index 65bee0aabc51..0d8b7d0b9308 100644 --- a/clients/node/client-rds-data-node/commands/ExecuteStatementCommand.ts +++ b/clients/client-rds-data/commands/ExecuteStatementCommand.ts @@ -1,5 +1,5 @@ import { Command } from "@aws-sdk/smithy-client"; -import { serdePlugin } from "@aws-sdk/middleware-serde"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; import { HttpOptions, Handler, @@ -8,16 +8,17 @@ import { MiddlewareStack, SerdeContext } from "@aws-sdk/types"; -import { RDSDataResolvedConfiguration } from "../RDSDataConfiguration"; import { HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; import { executeStatementAwsRestJson1_1Serialize, executeStatementAwsRestJson1_1Deserialize } from "../protocol/AwsRestJson1_1"; import { ExecuteStatementRequest, ExecuteStatementResponse } from "../models"; - -type InputTypesUnion = any; -type OutputTypesUnion = any; +import { + ServiceInputTypes, + ServiceOutputTypes, + RdsDataServiceResolvedConfig +} from "../RdsDataServiceClient"; export class ExecuteStatementCommand extends Command< ExecuteStatementRequest, @@ -28,15 +29,17 @@ export class ExecuteStatementCommand extends Command< } resolveMiddleware( - clientStack: MiddlewareStack, - configuration: RDSDataResolvedConfiguration, + clientStack: MiddlewareStack, + configuration: RdsDataServiceResolvedConfig, options?: HttpOptions ): Handler { const { protocol: { handler } } = configuration; - this.use(serdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); const stack = clientStack.concat(this.middlewareStack); diff --git a/clients/client-rds-data/index.ts b/clients/client-rds-data/index.ts new file mode 100644 index 000000000000..22f1e0d74f7e --- /dev/null +++ b/clients/client-rds-data/index.ts @@ -0,0 +1,2 @@ +export * from "./RdsDataServiceClient"; +export * from "./commands/ExecuteStatementCommand"; diff --git a/clients/node/client-rds-data-node/lib/smithy.ts b/clients/client-rds-data/lib/smithy.ts similarity index 100% rename from clients/node/client-rds-data-node/lib/smithy.ts rename to clients/client-rds-data/lib/smithy.ts diff --git a/clients/node/client-rds-data-node/models/index.ts b/clients/client-rds-data/models/index.ts similarity index 100% rename from clients/node/client-rds-data-node/models/index.ts rename to clients/client-rds-data/models/index.ts diff --git a/clients/node/client-rds-data-node/package.json b/clients/client-rds-data/package.json similarity index 94% rename from clients/node/client-rds-data-node/package.json rename to clients/client-rds-data/package.json index 0b02f9f33ef1..61156b98ce12 100644 --- a/clients/node/client-rds-data-node/package.json +++ b/clients/client-rds-data/package.json @@ -1,11 +1,11 @@ { - "name": "@aws-sdk/client-rds-data-node", + "name": "@aws-sdk/client-rds-data", "description": "Node SDK for AWS RDS DataService", "version": "0.1.0-preview.3", "scripts": { "clean": "npm run remove-definitions && npm run remove-maps && npm run remove-js", "build-documentation": "npm run clean && typedoc ./", - "prepublishOnly": "tsc", + "prepublishOnly": "yarn build", "pretest": "tsc", "remove-definitions": "rimraf *.d.ts && rimraf ./commands/*.d.ts && rimraf ./model/*.d.ts rimraf ./types/*.d.ts && rimraf ./protocol/*.d.ts", "remove-documentation": "rimraf ./docs", @@ -44,9 +44,9 @@ "@aws-sdk/node-http-handler": "^0.1.0-preview.6", "@aws-sdk/protocol-rest-json": "^0.1.0-preview.5", "@aws-sdk/region-provider": "^0.1.0-preview.5", - "@aws-sdk/retry-middleware": "^0.1.0-preview.5", + "@aws-sdk/middleware-retry": "^0.1.0-preview.5", "@aws-sdk/signature-v4": "^0.1.0-preview.7", - "@aws-sdk/signing-middleware": "^0.1.0-preview.7", + "@aws-sdk/middleware-signing": "^0.1.0-preview.7", "@aws-sdk/stream-collector-node": "^0.1.0-preview.6", "@aws-sdk/stream-collector-browser": "^0.1.0-preview.5", "@aws-sdk/types": "^0.1.0-preview.5", diff --git a/clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts b/clients/client-rds-data/protocol/AwsRestJson1_1.ts similarity index 100% rename from clients/node/client-rds-data-node/protocol/AwsRestJson1_1.ts rename to clients/client-rds-data/protocol/AwsRestJson1_1.ts diff --git a/clients/node/client-rds-data-node/runtimeConfig.browser.ts b/clients/client-rds-data/runtimeConfig.browser.ts similarity index 95% rename from clients/node/client-rds-data-node/runtimeConfig.browser.ts rename to clients/client-rds-data/runtimeConfig.browser.ts index 1b0b420a864b..8ce6759932fd 100644 --- a/clients/node/client-rds-data-node/runtimeConfig.browser.ts +++ b/clients/client-rds-data/runtimeConfig.browser.ts @@ -9,7 +9,7 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { name, version } from "./package.json"; -import { RDSDataRuntimeDependencies } from "./RDSDataConfiguration"; +import { RDSDataRuntimeDependencies } from "./RdsDataServiceClient"; export const RDSRuntimeConfiguration: Required = { protocolDefaultProvider: handler => new RestJsonProtocol(handler), diff --git a/clients/node/client-rds-data-node/runtimeConfig.ts b/clients/client-rds-data/runtimeConfig.ts similarity index 95% rename from clients/node/client-rds-data-node/runtimeConfig.ts rename to clients/client-rds-data/runtimeConfig.ts index 670cd8ebe69d..f5c967be9b7e 100644 --- a/clients/node/client-rds-data-node/runtimeConfig.ts +++ b/clients/client-rds-data/runtimeConfig.ts @@ -10,7 +10,7 @@ import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; import { name, version } from "./package.json"; -import { RDSDataRuntimeDependencies } from "./RDSDataConfiguration"; +import { RDSDataRuntimeDependencies } from "./RdsDataServiceClient"; export const RDSRuntimeConfiguration: Required = { protocolDefaultProvider: handler => new RestJsonProtocol(handler), diff --git a/clients/node/client-rds-data-node/tsconfig.es.json b/clients/client-rds-data/tsconfig.es.json similarity index 100% rename from clients/node/client-rds-data-node/tsconfig.es.json rename to clients/client-rds-data/tsconfig.es.json diff --git a/clients/node/client-rds-data-node/tsconfig.json b/clients/client-rds-data/tsconfig.json similarity index 100% rename from clients/node/client-rds-data-node/tsconfig.json rename to clients/client-rds-data/tsconfig.json diff --git a/clients/node/client-rds-data-node/tsconfig.test.json b/clients/client-rds-data/tsconfig.test.json similarity index 100% rename from clients/node/client-rds-data-node/tsconfig.test.json rename to clients/client-rds-data/tsconfig.test.json diff --git a/clients/node/client-rds-data-node/RDSDataClient.ts b/clients/node/client-rds-data-node/RDSDataClient.ts deleted file mode 100644 index 557826e5cee8..000000000000 --- a/clients/node/client-rds-data-node/RDSDataClient.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { contentLengthPlugin } from "@aws-sdk/middleware-content-length"; -import { - userAgentPlugin, - UserAgentConfig -} from "@aws-sdk/middleware-user-agent"; -import { retryPlugin, RetryConfig } from "@aws-sdk/retry-middleware"; -import { - awsAuthPlugin, - AwsAuthConfiguration -} from "@aws-sdk/signing-middleware"; -import { - RDSDataConfiguration, - RDSDataResolvedConfiguration -} from "./RDSDataConfiguration"; -import { RDSRuntimeConfiguration } from "./runtimeConfig"; -import { - RegionConfiguration, - EndpointsConfig, - ProtocolConfig -} from "@aws-sdk/config-resolver"; -import { HttpOptions, MetadataBearer } from "@aws-sdk/types"; -import { Client as SmithyClient } from "@aws-sdk/smithy-client"; - -type InputTypesUnion = any; -type OutputTypesUnion = MetadataBearer; - -export class RDSDataClient extends SmithyClient< - HttpOptions, - InputTypesUnion, - OutputTypesUnion -> { - readonly config: RDSDataResolvedConfiguration; - - constructor(configuration: RDSDataConfiguration) { - const intermediaConfig_0 = ProtocolConfig.resolve({ - ...RDSRuntimeConfiguration, - ...configuration - }); - let intermediaConfig_1 = RegionConfiguration.resolve(intermediaConfig_0); - let intermediaConfig_2 = AwsAuthConfiguration.resolve(intermediaConfig_1); - let intermediaConfig_3 = EndpointsConfig.resolve(intermediaConfig_2); - let intermediaConfig_4 = RetryConfig.resolve(intermediaConfig_3); - let intermediaConfig_5 = UserAgentConfig.resolve(intermediaConfig_4); - super(intermediaConfig_0); - this.config = intermediaConfig_5; - super.use(contentLengthPlugin(this.config)); - super.use(retryPlugin(this.config)); - super.use(awsAuthPlugin(this.config)); - super.use(userAgentPlugin(this.config)); - } - - destroy(): void { - if (typeof this.config.httpHandler.destroy === "function") { - this.config.httpHandler.destroy(); - } - } -} diff --git a/clients/node/client-rds-data-node/RDSDataConfiguration.ts b/clients/node/client-rds-data-node/RDSDataConfiguration.ts deleted file mode 100644 index b821f9c333f8..000000000000 --- a/clients/node/client-rds-data-node/RDSDataConfiguration.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { - AwsAuthConfiguration, - AwsAuthConfigurationInput -} from "@aws-sdk/signing-middleware"; -import { - UserAgentConfig, - UserAgentConfigInput -} from "@aws-sdk/middleware-user-agent"; -import { RetryConfig, RetryConfigInput } from "@aws-sdk/retry-middleware"; -import { - RegionConfiguration, - RegionConfigurationInput, - EndpointsConfig, - EndpointsConfigInput, - ProtocolConfig, - ProtocolConfigInput -} from "@aws-sdk/config-resolver"; -import { - Credentials, - Provider, - HashConstructor, - UrlParser, - Protocol, - StreamCollector, - Decoder, - Encoder -} from "@aws-sdk/types"; -import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; - -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; - - /** - * Provider function that return promise of a region string - */ - regionDefaultProvider?: (input: any) => Provider; - - /** - * 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; - - /** - * The service name with which to sign requests. - */ - signingName?: string; - - /** - * The service name with which to construct endpoints. - */ - service?: string; -} - -export type RDSDataConfiguration = RDSDataRuntimeDependencies & - AwsAuthConfigurationInput & - RegionConfigurationInput & - RetryConfigInput & - EndpointsConfigInput & - ProtocolConfigInput & - UserAgentConfigInput; - -export type RDSDataResolvedConfiguration = Required< - RDSDataRuntimeDependencies -> & - AwsAuthConfiguration.Resolved & - RegionConfiguration.Resolved & - RetryConfig.Resolved & - EndpointsConfig.Resolved & - ProtocolConfig.Resolved & - UserAgentConfig.Resolved; diff --git a/clients/node/client-rds-data-node/index.ts b/clients/node/client-rds-data-node/index.ts deleted file mode 100644 index c1112a29fc2a..000000000000 --- a/clients/node/client-rds-data-node/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./RDSDataClient"; -export * from "./RDSDataConfiguration"; -export * from "./commands/ExecuteStatementCommand"; diff --git a/jest.config.js b/jest.config.js index b296b881fcc1..5715d043240f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,14 +5,14 @@ module.exports = { projects: ["/packages/*/jest.config.js"], testPathIgnorePatterns: [ "/packages/add-glacier-checksum-headers-browser", - "/clients/.*/client-.*" + "/clients/client-.*" ], coveragePathIgnorePatterns: [ "/node_modules/", "/packages/add-glacier-checksum-headers-browser", "/packages/crypto-sjcl-*", "/packages/xml-body-parser/vendor/", - "/clients/.*/client-.*", + "/clients/client-.*", "/__fixtures__/" ] }; diff --git a/package.json b/package.json index b7b72c5b3fc2..158c76a43c35 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "copy-models": "node ./scripts/copyModels.js", "update-clients": "node ./packages/package-generator/build/cli.js import-all --matching './models/*/*/service-2.json'", "build:crypto-dependencies": "lerna run --scope '@aws-sdk/types' --scope '@aws-sdk/util-utf8-browser' --scope '@aws-sdk/util-locate-window' --scope '@aws-sdk/hash-node' --include-filtered-dependencies pretest", - "build:smithy-client": "lerna run --scope '@aws-sdk/client-rds-data-node' --include-filtered-dependencies pretest", + "build:smithy-client": "lerna run --scope '@aws-sdk/client-rds-data' --include-filtered-dependencies pretest", "pretest": "yarn build:crypto-dependencies && yarn build:smithy-client", "test": "jest --coverage --passWithNoTests", "pretest-all": "lerna run pretest", @@ -48,9 +48,7 @@ }, "workspaces": [ "packages/*", - "clients/browser/*", - "clients/node/*", - "clients/universal/*" + "clients/*" ], "husky": { "hooks": { @@ -64,4 +62,4 @@ "git add" ] } -} \ No newline at end of file +} diff --git a/packages/config-resolver/src/EndpointsConfig.ts b/packages/config-resolver/src/EndpointsConfig.ts index 79157e40835e..1f34a14cb853 100644 --- a/packages/config-resolver/src/EndpointsConfig.ts +++ b/packages/config-resolver/src/EndpointsConfig.ts @@ -14,51 +14,48 @@ export function normalizeEndpoint( return endpoint!; } -export namespace EndpointsConfig { - export interface Input { - /** - * The fully qualified endpoint of the webservice. This is only required when using a custom endpoint (for example, when using a local version of S3). - */ - endpoint?: string | Endpoint | Provider; +export interface EndpointsConfigInput { + /** + * The fully qualified endpoint of the webservice. This is only required when using a custom endpoint (for example, when using a local version of S3). + */ + endpoint?: string | Endpoint | Provider; - /** - * The endpoint provider to call if no endpoint is provided - */ - endpointProvider?: any; + /** + * The endpoint provider to call if no endpoint is provided + */ + endpointProvider?: any; - /** - * Whether TLS is enabled for requests. - */ - tls?: boolean; - } - interface PreviouslyResolved { - urlParser: UrlParser; - region: Provider; - service: string; - } - export interface Resolved extends Required { - endpoint: Provider; - } - export function resolve( - input: T & Input & PreviouslyResolved - ): T & Resolved { - const tls = input.tls || true; - const defaultProvider = (tls: boolean, region: string) => ({ - protocol: tls ? "https:" : "http:", - path: "/", - hostname: `${input.service}.${region}.amazonaws.com` - }); - const endpointProvider = input.endpointProvider || defaultProvider; - let endpoint: Provider = input.endpoint - ? normalizeEndpoint(input.endpoint, input.urlParser) - : () => input.region().then(region => endpointProvider(tls, region)); - return { - ...input, - endpointProvider, - endpoint, - tls - }; - } + /** + * Whether TLS is enabled for requests. + */ + tls?: boolean; +} +interface PreviouslyResolved { + urlParser: UrlParser; + region: Provider; + service: string; +} +export interface EndpointsConfigResolved + extends Required { + endpoint: Provider; +} +export function resolveEndpointsConfig( + input: T & EndpointsConfigInput & PreviouslyResolved +): T & EndpointsConfigResolved { + const tls = input.tls || true; + const defaultProvider = (tls: boolean, region: string) => ({ + protocol: tls ? "https:" : "http:", + path: "/", + hostname: `${input.service}.${region}.amazonaws.com` + }); + const endpointProvider = input.endpointProvider || defaultProvider; + const endpoint: Provider = input.endpoint + ? normalizeEndpoint(input.endpoint, input.urlParser) + : () => input.region().then(region => endpointProvider(tls, region)); + return { + ...input, + endpointProvider, + endpoint, + tls + }; } -//export separately for showing comment block in Intellisense -export type EndpointsConfigInput = EndpointsConfig.Input; diff --git a/packages/config-resolver/src/ProtocolConfig.ts b/packages/config-resolver/src/ProtocolConfig.ts index 3851ecf3ddd7..51225b0e5892 100644 --- a/packages/config-resolver/src/ProtocolConfig.ts +++ b/packages/config-resolver/src/ProtocolConfig.ts @@ -1,29 +1,29 @@ import { Protocol, HttpOptions } from "@aws-sdk/types"; import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; -export namespace ProtocolConfig { - export interface Input { - /** - * The serializing protocol to used in request - */ - protocol?: Protocol; - } - interface PreviouslyResolved { - httpHandler: HttpHandler; - protocolDefaultProvider: ( - handler: HttpHandler - ) => Protocol; - } - export type Resolved = Required; - export function resolve( - input: T & Input & PreviouslyResolved - ): T & Resolved { - return { - ...input, - protocol: - input.protocol || input.protocolDefaultProvider(input.httpHandler) - }; - } +export interface ClientProtocolConfigInput { + /** + * The serializing protocol to used in request + */ + protocol?: Protocol; +} +interface PreviouslyResolved { + httpHandler: HttpHandler; + protocolDefaultProvider: ( + handler: HttpHandler + ) => Protocol; +} +export type ClientProtocolConfigResolved = Required; +export function resolveClientProtocolConfig( + input: T & ClientProtocolConfigInput & PreviouslyResolved +): T & ClientProtocolConfigResolved { + return { + ...input, + protocol: input.protocol || input.protocolDefaultProvider(input.httpHandler) + }; +} +export function destroyClientProtocolConfig( + config: ClientProtocolConfigResolved +): void { + config.protocol.destroy(); } -//export separately for showing comment block in Intellisense -export type ProtocolConfigInput = ProtocolConfig.Input; diff --git a/packages/config-resolver/src/RegionConfig.ts b/packages/config-resolver/src/RegionConfig.ts index 67be54fd208c..2a16eb5d2499 100644 --- a/packages/config-resolver/src/RegionConfig.ts +++ b/packages/config-resolver/src/RegionConfig.ts @@ -1,30 +1,26 @@ import { Provider } from "@aws-sdk/types"; -export namespace RegionConfiguration { - export interface Input { - /** - * The AWS region to which this client will send requests - */ - region?: string | Provider; - } - interface PreviouslyResolved { - regionDefaultProvider: (input: any) => Provider; - } - export interface Resolved { - region: Provider; - } - export function resolve( - input: T & Input & PreviouslyResolved - ): T & Resolved { - let region = input.region || input.regionDefaultProvider(input as any); - return { - ...input, - region: normalizeRegion(region) - }; - } +export interface RegionConfigInput { + /** + * The AWS region to which this client will send requests + */ + region?: string | Provider; +} +interface PreviouslyResolved { + regionDefaultProvider: (input: any) => Provider; +} +export interface RegionConfigResolved { + region: Provider; +} +export function resolveRegionConfig( + input: T & RegionConfigInput & PreviouslyResolved +): T & RegionConfigResolved { + let region = input.region || input.regionDefaultProvider(input as any); + return { + ...input, + region: normalizeRegion(region) + }; } -//export separately for showing comment block in Intellisense -export type RegionConfigurationInput = RegionConfiguration.Input; function normalizeRegion(region: string | Provider): Provider { if (typeof region === "string") { diff --git a/packages/middleware-content-length/src/index.ts b/packages/middleware-content-length/src/index.ts index cff54e7911d5..868833bbf427 100644 --- a/packages/middleware-content-length/src/index.ts +++ b/packages/middleware-content-length/src/index.ts @@ -44,11 +44,13 @@ export function contentLengthMiddleware( }; } -export const contentLengthPlugin = (options: { +export const getContentLengthPlugin = (options: { bodyLengthChecker: BodyLengthCalculator; -}): Pluggable => clientStack => { - clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), { - step: "build", - tags: { SET_CONTENT_LENGTH: true } - }); -}; +}): Pluggable => ({ + applyToStack: clientStack => { + clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), { + step: "build", + tags: { SET_CONTENT_LENGTH: true } + }); + } +}); diff --git a/packages/retry-middleware/.gitignore b/packages/middleware-retry/.gitignore similarity index 100% rename from packages/retry-middleware/.gitignore rename to packages/middleware-retry/.gitignore diff --git a/packages/retry-middleware/.npmignore b/packages/middleware-retry/.npmignore similarity index 100% rename from packages/retry-middleware/.npmignore rename to packages/middleware-retry/.npmignore diff --git a/packages/retry-middleware/CHANGELOG.md b/packages/middleware-retry/CHANGELOG.md similarity index 100% rename from packages/retry-middleware/CHANGELOG.md rename to packages/middleware-retry/CHANGELOG.md diff --git a/packages/retry-middleware/LICENSE b/packages/middleware-retry/LICENSE similarity index 100% rename from packages/retry-middleware/LICENSE rename to packages/middleware-retry/LICENSE diff --git a/packages/middleware-retry/README.md b/packages/middleware-retry/README.md new file mode 100644 index 000000000000..80ed6d075aba --- /dev/null +++ b/packages/middleware-retry/README.md @@ -0,0 +1,4 @@ +# @aws-sdk/middleware-retry + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-retry/preview.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-retry) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-retry.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-retry) diff --git a/packages/retry-middleware/jest.config.js b/packages/middleware-retry/jest.config.js similarity index 100% rename from packages/retry-middleware/jest.config.js rename to packages/middleware-retry/jest.config.js diff --git a/packages/retry-middleware/package.json b/packages/middleware-retry/package.json similarity index 94% rename from packages/retry-middleware/package.json rename to packages/middleware-retry/package.json index cd8acef83917..66b655ba758d 100644 --- a/packages/retry-middleware/package.json +++ b/packages/middleware-retry/package.json @@ -1,5 +1,5 @@ { - "name": "@aws-sdk/retry-middleware", + "name": "@aws-sdk/middleware-retry", "version": "0.1.0-preview.5", "scripts": { "prepublishOnly": "tsc", diff --git a/packages/middleware-retry/src/configurations.ts b/packages/middleware-retry/src/configurations.ts new file mode 100644 index 000000000000..daf6a6643298 --- /dev/null +++ b/packages/middleware-retry/src/configurations.ts @@ -0,0 +1,28 @@ +import { RetryStrategy } from "@aws-sdk/types"; +import { ExponentialBackOffStrategy } from "./defaultStrategy"; + +export interface RetryConfigInput { + /** + * The maximum number of times requests that encounter potentially transient failures should be retried + */ + maxRetries?: number; + /** + * The strategy to retry the request. Using built-in exponential backoff strategy by default. + */ + retryStrategy?: RetryStrategy; +} +export interface RetryConfigResolved { + maxRetries: number; + retryStrategy: RetryStrategy; +} +export function resolveRetryConfig( + input: T & RetryConfigInput +): T & RetryConfigResolved { + const maxRetries = input.maxRetries === undefined ? 3 : input.maxRetries; + return { + ...input, + maxRetries, + retryStrategy: + input.retryStrategy || new ExponentialBackOffStrategy(maxRetries) + }; +} diff --git a/packages/retry-middleware/src/constants.ts b/packages/middleware-retry/src/constants.ts similarity index 100% rename from packages/retry-middleware/src/constants.ts rename to packages/middleware-retry/src/constants.ts diff --git a/packages/retry-middleware/src/defaultStrategy.ts b/packages/middleware-retry/src/defaultStrategy.ts similarity index 100% rename from packages/retry-middleware/src/defaultStrategy.ts rename to packages/middleware-retry/src/defaultStrategy.ts diff --git a/packages/retry-middleware/src/delayDecider.spec.ts b/packages/middleware-retry/src/delayDecider.spec.ts similarity index 100% rename from packages/retry-middleware/src/delayDecider.spec.ts rename to packages/middleware-retry/src/delayDecider.spec.ts diff --git a/packages/retry-middleware/src/delayDecider.ts b/packages/middleware-retry/src/delayDecider.ts similarity index 100% rename from packages/retry-middleware/src/delayDecider.ts rename to packages/middleware-retry/src/delayDecider.ts diff --git a/packages/retry-middleware/src/index.spec.ts b/packages/middleware-retry/src/index.spec.ts similarity index 88% rename from packages/retry-middleware/src/index.spec.ts rename to packages/middleware-retry/src/index.spec.ts index 7e0c5696b90a..b21b37aaa879 100644 --- a/packages/retry-middleware/src/index.spec.ts +++ b/packages/middleware-retry/src/index.spec.ts @@ -3,18 +3,18 @@ import { THROTTLING_RETRY_DELAY_BASE } from "./constants"; import { retryMiddleware } from "./retryMiddleware"; -import { RetryConfig } from "./configurations"; +import { resolveRetryConfig } from "./configurations"; import * as delayDeciderModule from "./delayDecider"; import { ExponentialBackOffStrategy, RetryDecider } from "./defaultStrategy"; import { HttpRequest } from "@aws-sdk/protocol-http"; -import { SdkError } from '@aws-sdk/types'; +import { SdkError } from "@aws-sdk/types"; describe("retryMiddleware", () => { it("should not retry when the handler completes successfully", async () => { const next = jest.fn().mockResolvedValue({ output: { $metadata: {} } }); - const retryHandler = retryMiddleware( - RetryConfig.resolve({ maxRetries: 0 }) - )(next); + const retryHandler = retryMiddleware(resolveRetryConfig({ maxRetries: 0 }))( + next + ); const { output: { $metadata } @@ -30,7 +30,7 @@ describe("retryMiddleware", () => { const error = new Error(); error.name = "ProvisionedThroughputExceededException"; const next = jest.fn().mockRejectedValue(error); - const retryHandler = retryMiddleware(RetryConfig.resolve({ maxRetries }))( + const retryHandler = retryMiddleware(resolveRetryConfig({ maxRetries }))( next ); @@ -45,9 +45,9 @@ describe("retryMiddleware", () => { const error = new Error(); error.name = "ValidationException"; const next = jest.fn().mockRejectedValue(error); - const retryHandler = retryMiddleware( - RetryConfig.resolve({ maxRetries: 3 }) - )(next); + const retryHandler = retryMiddleware(resolveRetryConfig({ maxRetries: 3 }))( + next + ); await expect( retryHandler({ input: {}, request: new HttpRequest({}) }) diff --git a/packages/retry-middleware/src/index.ts b/packages/middleware-retry/src/index.ts similarity index 100% rename from packages/retry-middleware/src/index.ts rename to packages/middleware-retry/src/index.ts diff --git a/packages/retry-middleware/src/retryDecider.spec.ts b/packages/middleware-retry/src/retryDecider.spec.ts similarity index 100% rename from packages/retry-middleware/src/retryDecider.spec.ts rename to packages/middleware-retry/src/retryDecider.spec.ts diff --git a/packages/retry-middleware/src/retryDecider.ts b/packages/middleware-retry/src/retryDecider.ts similarity index 100% rename from packages/retry-middleware/src/retryDecider.ts rename to packages/middleware-retry/src/retryDecider.ts diff --git a/packages/middleware-retry/src/retryMiddleware.ts b/packages/middleware-retry/src/retryMiddleware.ts new file mode 100644 index 000000000000..87b404ece2cf --- /dev/null +++ b/packages/middleware-retry/src/retryMiddleware.ts @@ -0,0 +1,31 @@ +import { + FinalizeHandler, + FinalizeHandlerArguments, + MetadataBearer, + FinalizeHandlerOutput, + Pluggable +} from "@aws-sdk/types"; +import { RetryConfigResolved } from "./configurations"; + +export function retryMiddleware(options: RetryConfigResolved) { + return ( + next: FinalizeHandler + ): FinalizeHandler => async ( + args: FinalizeHandlerArguments + ): Promise> => { + return options.retryStrategy.retry(next, args); + }; +} + +export const getRetryPlugin = ( + options: RetryConfigResolved +): Pluggable => ({ + applyToStack: clientStack => { + if (options.maxRetries > 0) { + clientStack.add(retryMiddleware(options), { + step: "finalizeRequest", + tags: { RETRY: true } + }); + } + } +}); diff --git a/packages/retry-middleware/tsconfig.json b/packages/middleware-retry/tsconfig.json similarity index 100% rename from packages/retry-middleware/tsconfig.json rename to packages/middleware-retry/tsconfig.json diff --git a/packages/retry-middleware/tsconfig.test.json b/packages/middleware-retry/tsconfig.test.json similarity index 100% rename from packages/retry-middleware/tsconfig.test.json rename to packages/middleware-retry/tsconfig.test.json diff --git a/packages/middleware-serde/src/serdePlugin.ts b/packages/middleware-serde/src/serdePlugin.ts index 89d6ffc37b71..32d40964ddb4 100644 --- a/packages/middleware-serde/src/serdePlugin.ts +++ b/packages/middleware-serde/src/serdePlugin.ts @@ -10,7 +10,7 @@ import { import { deserializerMiddleware } from "./deserializerMiddleware"; import { serializerMiddleware } from "./serializerMiddleware"; -export function serdePlugin< +export function getSerdePlugin< InputType extends object, SerializerRuntimeUtils extends EndpointBearer, OutputType extends MetadataBearer, @@ -21,14 +21,16 @@ export function serdePlugin< serializer: RequestSerializer, deserializer: ResponseDeserializer ): Pluggable { - return (commandStack: MiddlewareStack) => { - commandStack.add(deserializerMiddleware(config, deserializer), { - step: "deserialize", - tags: { DESERIALIZER: true } - }); - commandStack.add(serializerMiddleware(config, serializer), { - step: "serialize", - tags: { SERIALIZER: true } - }); + return { + applyToStack: (commandStack: MiddlewareStack) => { + commandStack.add(deserializerMiddleware(config, deserializer), { + step: "deserialize", + tags: { DESERIALIZER: true } + }); + commandStack.add(serializerMiddleware(config, serializer), { + step: "serialize", + tags: { SERIALIZER: true } + }); + } }; } diff --git a/packages/signing-middleware/.gitignore b/packages/middleware-signing/.gitignore similarity index 100% rename from packages/signing-middleware/.gitignore rename to packages/middleware-signing/.gitignore diff --git a/packages/signing-middleware/.npmignore b/packages/middleware-signing/.npmignore similarity index 100% rename from packages/signing-middleware/.npmignore rename to packages/middleware-signing/.npmignore diff --git a/packages/signing-middleware/CHANGELOG.md b/packages/middleware-signing/CHANGELOG.md similarity index 100% rename from packages/signing-middleware/CHANGELOG.md rename to packages/middleware-signing/CHANGELOG.md diff --git a/packages/signing-middleware/LICENSE b/packages/middleware-signing/LICENSE similarity index 100% rename from packages/signing-middleware/LICENSE rename to packages/middleware-signing/LICENSE diff --git a/packages/middleware-signing/README.md b/packages/middleware-signing/README.md new file mode 100644 index 000000000000..14825ea42688 --- /dev/null +++ b/packages/middleware-signing/README.md @@ -0,0 +1,4 @@ +# signer-middleware + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-signing/preview.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-signing) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-signing.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-signing) diff --git a/packages/signing-middleware/jest.config.js b/packages/middleware-signing/jest.config.js similarity index 100% rename from packages/signing-middleware/jest.config.js rename to packages/middleware-signing/jest.config.js diff --git a/packages/signing-middleware/package.json b/packages/middleware-signing/package.json similarity index 94% rename from packages/signing-middleware/package.json rename to packages/middleware-signing/package.json index 911a26e27eee..42dbb1c5578a 100644 --- a/packages/signing-middleware/package.json +++ b/packages/middleware-signing/package.json @@ -1,5 +1,5 @@ { - "name": "@aws-sdk/signing-middleware", + "name": "@aws-sdk/middleware-signing", "version": "0.1.0-preview.7", "scripts": { "prepublishOnly": "tsc", diff --git a/packages/middleware-signing/src/configurations.ts b/packages/middleware-signing/src/configurations.ts new file mode 100644 index 000000000000..e650c1ef204e --- /dev/null +++ b/packages/middleware-signing/src/configurations.ts @@ -0,0 +1,63 @@ +import { + RequestSigner, + Credentials, + Provider, + HashConstructor +} from "@aws-sdk/types"; +import { SignatureV4 } from "@aws-sdk/signature-v4"; + +export interface AwsAuthConfigInput { + /** + * The credentials used to sign requests. + */ + credentials?: Credentials | Provider; + + /** + * The signer to use when signing requests. + */ + signer?: RequestSigner; + + /** + * Whether to escape request path when signing the request + */ + signingEscapePath?: boolean; +} +interface PreviouslyResolved { + credentialDefaultProvider: (input: any) => Provider; + region: string | Provider; + signingName: string; + sha256: HashConstructor; +} +export interface AwsAuthConfigResolved { + credentials: Provider; + signer: RequestSigner; + signingEscapePath: boolean; +} +export function resolveAwsAuthConfig( + input: T & AwsAuthConfigInput & PreviouslyResolved +): T & AwsAuthConfigResolved { + let credentials = + input.credentials || input.credentialDefaultProvider(input as any); + const normalizedCreds = normalizeProvider(credentials); + const signingEscapePath = input.signingEscapePath || false; + return { + ...input, + signingEscapePath, + credentials: normalizedCreds, + signer: new SignatureV4({ + credentials: normalizedCreds, + region: input.region, + service: input.signingName, + sha256: input.sha256, + uriEscapePath: signingEscapePath + }) + }; +} + +function normalizeProvider(input: T | Provider): Provider { + if (typeof input === "object") { + const promisified = Promise.resolve(input); + return () => promisified; + } + return input as Provider; +} diff --git a/packages/signing-middleware/src/index.ts b/packages/middleware-signing/src/index.ts similarity index 100% rename from packages/signing-middleware/src/index.ts rename to packages/middleware-signing/src/index.ts diff --git a/packages/signing-middleware/src/middleware.spec.ts b/packages/middleware-signing/src/middleware.spec.ts similarity index 100% rename from packages/signing-middleware/src/middleware.spec.ts rename to packages/middleware-signing/src/middleware.spec.ts diff --git a/packages/signing-middleware/src/middleware.ts b/packages/middleware-signing/src/middleware.ts similarity index 67% rename from packages/signing-middleware/src/middleware.ts rename to packages/middleware-signing/src/middleware.ts index 81b78bb2c39f..8a930523c371 100644 --- a/packages/signing-middleware/src/middleware.ts +++ b/packages/middleware-signing/src/middleware.ts @@ -5,11 +5,11 @@ import { FinalizeHandlerOutput, Pluggable } from "@aws-sdk/types"; -import { AwsAuthConfiguration } from "./configurations"; +import { AwsAuthConfigResolved } from "./configurations"; import { HttpRequest } from "@aws-sdk/protocol-http"; export function signingMiddleware( - options: AwsAuthConfiguration.Resolved + options: AwsAuthConfigResolved ): FinalizeRequestMiddleware { return ( next: FinalizeHandler @@ -25,11 +25,13 @@ export function signingMiddleware( }; } -export const awsAuthPlugin = ( - options: AwsAuthConfiguration.Resolved -): Pluggable => clientStack => { - clientStack.add(signingMiddleware(options), { - step: "finalizeRequest", - tags: { SIGNATURE: true } - }); -}; +export const getAwsAuthPlugin = ( + options: AwsAuthConfigResolved +): Pluggable => ({ + applyToStack: clientStack => { + clientStack.add(signingMiddleware(options), { + step: "finalizeRequest", + tags: { SIGNATURE: true } + }); + } +}); diff --git a/packages/signing-middleware/tsconfig.json b/packages/middleware-signing/tsconfig.json similarity index 100% rename from packages/signing-middleware/tsconfig.json rename to packages/middleware-signing/tsconfig.json diff --git a/packages/signing-middleware/tsconfig.test.json b/packages/middleware-signing/tsconfig.test.json similarity index 100% rename from packages/signing-middleware/tsconfig.test.json rename to packages/middleware-signing/tsconfig.test.json diff --git a/packages/middleware-stack/src/index.ts b/packages/middleware-stack/src/index.ts index d165cd763a65..aead414822f8 100644 --- a/packages/middleware-stack/src/index.ts +++ b/packages/middleware-stack/src/index.ts @@ -1,10 +1,8 @@ import { BuildHandlerOptions, - FinalizeHandler, FinalizeRequestHandlerOptions, SerializeMiddleware, FinalizeRequestMiddleware, - BuildMiddleware, Handler, HandlerExecutionContext, HandlerOptions, @@ -14,7 +12,8 @@ import { Step, DeserializeMiddleware, DeserializeHandlerOptions, - DeserializeHandler + DeserializeHandler, + Pluggable } from "@aws-sdk/types"; interface HandlerListEntry { @@ -70,6 +69,10 @@ export class MiddlewareStack { }); } + use(pluggable: Pluggable) { + pluggable.applyToStack(this); + } + clone(): IMiddlewareStack { const clone = new MiddlewareStack(); clone.entries.push(...this.entries); diff --git a/packages/middleware-user-agent/src/configurations.ts b/packages/middleware-user-agent/src/configurations.ts index a7c53b7482e5..703386099876 100644 --- a/packages/middleware-user-agent/src/configurations.ts +++ b/packages/middleware-user-agent/src/configurations.ts @@ -1,22 +1,18 @@ -export namespace UserAgentConfig { - export interface Input { - /** - * The custom user agent header that would be appended to default one - */ - customUserAgent?: string; - } - export interface PreviouslyResolved { - defaultUserAgent: string; - } - export interface Resolved { - defaultUserAgent: string; - customUserAgent?: string; - } - export function resolve( - input: T & PreviouslyResolved & Input - ): T & Resolved { - return input; - } +export interface UserAgentConfigInput { + /** + * The custom user agent header that would be appended to default one + */ + customUserAgent?: string; +} +interface PreviouslyResolved { + defaultUserAgent: string; +} +export interface UserAgentConfigResolved { + defaultUserAgent: string; + customUserAgent?: string; +} +export function resolveUserAgentConfig( + input: T & PreviouslyResolved & UserAgentConfigInput +): T & UserAgentConfigResolved { + return input; } - -export type UserAgentConfigInput = UserAgentConfig.Input; diff --git a/packages/middleware-user-agent/src/middleware.ts b/packages/middleware-user-agent/src/middleware.ts index 264d611407cc..2b6f12139eb0 100644 --- a/packages/middleware-user-agent/src/middleware.ts +++ b/packages/middleware-user-agent/src/middleware.ts @@ -6,11 +6,11 @@ import { Pluggable } from "@aws-sdk/types"; import { HttpRequest } from "@aws-sdk/protocol-http"; -import { UserAgentConfig } from "./configurations"; +import { UserAgentConfigResolved } from "./configurations"; const userAgentHeader = "User-Agent"; -export function userAgentMiddleware(options: UserAgentConfig.Resolved) { +export function userAgentMiddleware(options: UserAgentConfigResolved) { return ( next: BuildHandler ): BuildHandler => ( @@ -34,11 +34,13 @@ export function userAgentMiddleware(options: UserAgentConfig.Resolved) { }; } -export const userAgentPlugin = ( - config: UserAgentConfig.Resolved -): Pluggable => clientStack => { - clientStack.add(userAgentMiddleware(config), { - step: "build", - tags: { SET_USER_AGENT: true } - }); -}; +export const getUserAgentPlugin = ( + config: UserAgentConfigResolved +): Pluggable => ({ + applyToStack: clientStack => { + clientStack.add(userAgentMiddleware(config), { + step: "build", + tags: { SET_USER_AGENT: true } + }); + } +}); diff --git a/packages/retry-middleware/README.md b/packages/retry-middleware/README.md deleted file mode 100644 index 8f5a83a7b004..000000000000 --- a/packages/retry-middleware/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# @aws-sdk/retry-middleware - -[![NPM version](https://img.shields.io/npm/v/@aws-sdk/retry-middleware/preview.svg)](https://www.npmjs.com/package/@aws-sdk/retry-middleware) -[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/retry-middleware.svg)](https://www.npmjs.com/package/@aws-sdk/retry-middleware) diff --git a/packages/retry-middleware/src/configurations.ts b/packages/retry-middleware/src/configurations.ts deleted file mode 100644 index 1a944fd5a6f7..000000000000 --- a/packages/retry-middleware/src/configurations.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { RetryStrategy } from "@aws-sdk/types"; -import { ExponentialBackOffStrategy } from "./defaultStrategy"; - -export namespace RetryConfig { - export interface Input { - /** - * The maximum number of times requests that encounter potentially transient failures should be retried - */ - maxRetries?: number; - /** - * The strategy to retry the request. Using built-in exponential backoff strategy by default. - */ - retryStrategy?: RetryStrategy; - } - export interface Resolved { - maxRetries: number; - retryStrategy: RetryStrategy; - } - export function resolve(input: T & Input): T & Resolved { - const maxRetries = input.maxRetries === undefined ? 3 : input.maxRetries; - return { - ...input, - maxRetries, - retryStrategy: - input.retryStrategy || new ExponentialBackOffStrategy(maxRetries) - }; - } -} - -//export separately for showing comment block in Intellisense -export type RetryConfigInput = RetryConfig.Input; diff --git a/packages/retry-middleware/src/retryMiddleware.ts b/packages/retry-middleware/src/retryMiddleware.ts index 95249132bd64..fa5a97f9ef6e 100644 --- a/packages/retry-middleware/src/retryMiddleware.ts +++ b/packages/retry-middleware/src/retryMiddleware.ts @@ -19,11 +19,13 @@ export function retryMiddleware(options: RetryConfig.Resolved) { export const retryPlugin = ( options: RetryConfig.Resolved -): Pluggable => clientStack => { - if (options.maxRetries > 0) { - clientStack.add(retryMiddleware(options), { - step: "finalizeRequest", - tags: { RETRY: true } - }); +): Pluggable => ({ + applyToStack: clientStack => { + if (options.maxRetries > 0) { + clientStack.add(retryMiddleware(options), { + step: "finalizeRequest", + tags: { RETRY: true } + }); + } } -}; +}); diff --git a/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/retryMiddleware.ts b/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/retryMiddleware.ts index a7cfa9fe515a..35d20eb435e8 100644 --- a/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/retryMiddleware.ts +++ b/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/retryMiddleware.ts @@ -4,12 +4,12 @@ import { packageNameToVariable } from "../../packageNameToVariable"; export const retryMiddleware: MiddlewareCustomizationDefinition = { type: "Middleware", - imports: [IMPORTS["retry-middleware"], IMPORTS["types"]], + imports: [IMPORTS["middleware-retry"], IMPORTS["types"]], step: "finalize", priority: Number.POSITIVE_INFINITY, tags: "{RETRY: true}", expression: `${packageNameToVariable( - "@aws-sdk/retry-middleware" + "@aws-sdk/middleware-retry" )}.retryMiddleware( this.config.maxRetries, this.config.retryDecider, diff --git a/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/signatureCustomizations.ts b/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/signatureCustomizations.ts index e4148e65cafa..a262faa48d5c 100644 --- a/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/signatureCustomizations.ts +++ b/packages/service-types-generator/src/ServiceCustomizations/customizationsFromModel/signatureCustomizations.ts @@ -167,9 +167,9 @@ function clientCustomizationsForAuthType( signingName: signingNameProperty(metadata), signer: signerProperty(metadata) }, - imports: [IMPORTS["signing-middleware"]], + imports: [IMPORTS["middleware-signing"]], expression: `${packageNameToVariable( - "@aws-sdk/signing-middleware" + "@aws-sdk/middleware-signing" )}.signingMiddleware(this.config.signer)` @@ -217,9 +217,9 @@ function commandCustomizationsForAuthType( signingName: signingNameProperty(metadata), signer: signerProperty(metadata) }, - imports: [IMPORTS["signing-middleware"]], + imports: [IMPORTS["middleware-signing"]], expression: `${packageNameToVariable( - "@aws-sdk/signing-middleware" + "@aws-sdk/middleware-signing" )}.signingMiddleware<${commandName}Input, ${commandName}Output, ${streamType( runtime )}>(configuration.signer)` @@ -258,7 +258,7 @@ function signerProperty( imports: [ IMPORTS.types, IMPORTS["signature-v4"], - IMPORTS["signing-middleware"] + IMPORTS["middleware-signing"] ], documentation: "The signer to use when signing requests.", required: false, diff --git a/packages/service-types-generator/src/internalImports.ts b/packages/service-types-generator/src/internalImports.ts index 2b2b822a8266..0746d55b018b 100644 --- a/packages/service-types-generator/src/internalImports.ts +++ b/packages/service-types-generator/src/internalImports.ts @@ -276,8 +276,8 @@ export const IMPORTS: { [key: string]: Import } = { package: "@aws-sdk/response-metadata-extractor", version: "^0.1.0-preview.6" }, - "retry-middleware": { - package: "@aws-sdk/retry-middleware", + "middleware-retry": { + package: "@aws-sdk/middleware-retry", version: "^0.1.0-preview.5" }, "route53-id-normalizer-middleware": { @@ -328,8 +328,8 @@ export const IMPORTS: { [key: string]: Import } = { package: "@aws-sdk/signature-v4-universal", version: "^0.1.0-preview.7" }, - "signing-middleware": { - package: "@aws-sdk/signing-middleware", + "middleware-signing": { + package: "@aws-sdk/middleware-signing", version: "^0.1.0-preview.7" }, "ssec-middleware": { diff --git a/packages/signing-middleware/README.md b/packages/signing-middleware/README.md deleted file mode 100644 index 397b2ad392b0..000000000000 --- a/packages/signing-middleware/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# signer-middleware - -[![NPM version](https://img.shields.io/npm/v/@aws-sdk/signing-middleware/preview.svg)](https://www.npmjs.com/package/@aws-sdk/signing-middleware) -[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/signing-middleware.svg)](https://www.npmjs.com/package/@aws-sdk/signing-middleware) diff --git a/packages/signing-middleware/src/configurations.ts b/packages/signing-middleware/src/configurations.ts deleted file mode 100644 index f95063d33c7d..000000000000 --- a/packages/signing-middleware/src/configurations.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { - RequestSigner, - Credentials, - Provider, - HashConstructor -} from "@aws-sdk/types"; -import { SignatureV4 } from "@aws-sdk/signature-v4"; - -export namespace AwsAuthConfiguration { - export interface Input { - /** - * The credentials used to sign requests. - */ - credentials?: Credentials | Provider; - - /** - * The signer to use when signing requests. - */ - signer?: RequestSigner; - - /** - * Whether to escape request path when signing the request - */ - signingEscapePath?: boolean; - } - interface PreviouslyResolved { - credentialDefaultProvider: (input: any) => Provider; - region: string | Provider; - signingName: string; - sha256: HashConstructor; - } - export interface Resolved { - credentials: Provider; - signer: RequestSigner; - signingEscapePath: boolean; - } - export function resolve( - input: T & Input & PreviouslyResolved - ): T & Resolved { - let credentials = - input.credentials || input.credentialDefaultProvider(input as any); - const normalizedCreds = normalizeProvider(credentials); - const signingEscapePath = input.signingEscapePath || false; - return { - ...input, - signingEscapePath, - credentials: normalizedCreds, - signer: new SignatureV4({ - credentials: normalizedCreds, - region: input.region, - service: input.signingName, - sha256: input.sha256, - uriEscapePath: signingEscapePath - }) - }; - } -} - -//export separately for showing comment block in Intellisense -export type AwsAuthConfigurationInput = AwsAuthConfiguration.Input; - -function normalizeProvider(input: T | Provider): Provider { - if (typeof input === "object") { - const promisified = Promise.resolve(input); - return () => promisified; - } - return input as Provider; -} diff --git a/packages/smithy-client/src/client.ts b/packages/smithy-client/src/client.ts index 789d74ee5e3f..b7dc5e465149 100644 --- a/packages/smithy-client/src/client.ts +++ b/packages/smithy-client/src/client.ts @@ -1,5 +1,5 @@ import { MiddlewareStack } from "@aws-sdk/middleware-stack"; -import { Protocol, Command, MetadataBearer, Pluggable } from "@aws-sdk/types"; +import { Protocol, Command, MetadataBearer } from "@aws-sdk/types"; export interface SmithyConfiguration { protocol: Protocol; @@ -19,9 +19,6 @@ export class Client< constructor(config: SmithyConfiguration) { this.config = config; } - use(pluggable: Pluggable) { - pluggable(this.middlewareStack); - } send( command: Command< ClientInput, diff --git a/packages/smithy-client/src/command.ts b/packages/smithy-client/src/command.ts index c0a8c4e4cccb..fefccca45d49 100644 --- a/packages/smithy-client/src/command.ts +++ b/packages/smithy-client/src/command.ts @@ -1,9 +1,5 @@ import { MiddlewareStack } from "@aws-sdk/middleware-stack"; -import { Pluggable, HandlerOptions as InjectOptions } from "@aws-sdk/types"; export class Command { readonly middlewareStack = new MiddlewareStack(); - use(pluggable: Pluggable) { - pluggable(this.middlewareStack); - } } diff --git a/packages/smithy-client/tsconfig.json b/packages/smithy-client/tsconfig.json index 38b94cda274e..28c8abe6f6dc 100644 --- a/packages/smithy-client/tsconfig.json +++ b/packages/smithy-client/tsconfig.json @@ -8,6 +8,7 @@ "downlevelIteration": true, "importHelpers": true, "noEmitHelpers": true, + "noUnusedLocals": true, "lib": [ "es5", "es2015.promise", diff --git a/packages/types/src/middleware.ts b/packages/types/src/middleware.ts index 2279f92c8410..b1ef7b16c5d7 100644 --- a/packages/types/src/middleware.ts +++ b/packages/types/src/middleware.ts @@ -305,6 +305,8 @@ export interface MiddlewareStack { options: DeserializeHandlerOptions ): void; + use(pluggable: Pluggable): void; + /** * Create a shallow clone of this list. Step bindings and handler priorities * and tags are preserved in the copy. @@ -372,5 +374,5 @@ export interface Pluggable { * this interface can add, remove, modify existing middleware stack from clients * or commands */ - (stack: MiddlewareStack): void; + applyToStack: (stack: MiddlewareStack) => void; } diff --git a/packages/types/src/transfer.ts b/packages/types/src/transfer.ts index 3673c2a28355..78b83120140c 100644 --- a/packages/types/src/transfer.ts +++ b/packages/types/src/transfer.ts @@ -28,4 +28,9 @@ export abstract class Protocol { input: ResponseType, utils?: { [key: string]: any } ): ReturnType; + destroy(): void { + if (typeof this.handler.destroy === "function") { + this.handler.destroy(); + } + } } diff --git a/yarn.lock b/yarn.lock index ff7ad85bd889..5a50948e5560 100644 --- a/yarn.lock +++ b/yarn.lock @@ -142,6 +142,24 @@ "@aws-sdk/util-error-constructor" "^0.1.0-preview.5" tslib "^1.8.0" +"@aws-sdk/retry-middleware@^0.1.0-preview.5": + version "0.1.0-preview.5" + resolved "https://registry.yarnpkg.com/@aws-sdk/retry-middleware/-/retry-middleware-0.1.0-preview.5.tgz#f8d1466294ee18ceaa60e19a66e271af706288db" + integrity sha512-bxsY5LlUqrzqrGIJBDLjasiBzBzib+1fSLg6MR4DrYd9WmilnNKR+lmf592+enaR2K1DNdvmkfJz3CKl9HMZIg== + dependencies: + "@aws-sdk/service-error-classification" "^0.1.0-preview.3" + "@aws-sdk/types" "^0.1.0-preview.5" + tslib "^1.8.0" + +"@aws-sdk/signing-middleware@^0.1.0-preview.7": + version "0.1.0-preview.7" + resolved "https://registry.yarnpkg.com/@aws-sdk/signing-middleware/-/signing-middleware-0.1.0-preview.7.tgz#55f3b5c4703fe7cd5999adbbd6629497588225fb" + integrity sha512-tmQcI3tdVMdxdOR8o17fHEyMRGepe8tEL+TPnvnD7TX0c8tkxZ+bHxRV9KU+s0DW+b2rWe7l+E1ytgS1tY04UA== + dependencies: + "@aws-sdk/signature-v4" "^0.1.0-preview.7" + "@aws-sdk/types" "^0.1.0-preview.5" + tslib "^1.8.0" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" @@ -8688,7 +8706,7 @@ typescript@3.2.x: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== -typescript@3.7.0-dev.20190926, typescript@^3.7.0-dev.20190926: +typescript@3.7.0-dev.20190926: version "3.7.0-dev.20190926" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20190926.tgz#2e90fa4e56fad0fddb87e4d837cd33c7e4a55e7c" integrity sha512-uOQij3UHJnzxY/8Kv1kdmvWTjghgbCD0kBOgVGbY7Rni8ER51O8iPMmI4YpanZmaiZbPK6zUaS60b04/2C91bA==