diff --git a/private/aws-protocoltests-ec2/package.json b/private/aws-protocoltests-ec2/package.json index ce29471d8c16..9b4037a3747a 100644 --- a/private/aws-protocoltests-ec2/package.json +++ b/private/aws-protocoltests-ec2/package.json @@ -32,6 +32,7 @@ "@smithy/fetch-http-handler": "^2.3.2", "@smithy/hash-node": "^2.0.18", "@smithy/invalid-dependency": "^2.0.16", + "@smithy/middleware-compression": "^2.0.2", "@smithy/middleware-content-length": "^2.0.18", "@smithy/middleware-retry": "^2.0.26", "@smithy/middleware-serde": "^2.0.16", diff --git a/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts b/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts index 7b8a0d52c173..a7557dd7cfab 100644 --- a/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts +++ b/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts @@ -21,6 +21,11 @@ import { resolveEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; import { getContentLengthPlugin } from "@smithy/middleware-content-length"; import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; @@ -293,7 +298,8 @@ export type EC2ProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & - UserAgentInputConfig; + UserAgentInputConfig & + CompressionInputConfig; /** * @public * @@ -311,7 +317,8 @@ export type EC2ProtocolClientResolvedConfigType = __SmithyResolvedConfiguration< EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & - UserAgentResolvedConfig; + UserAgentResolvedConfig & + CompressionResolvedConfig; /** * @public * @@ -341,9 +348,10 @@ export class EC2ProtocolClient extends __Client< const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveHostHeaderConfig(_config_3); const _config_5 = resolveUserAgentConfig(_config_4); - const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []); - super(_config_6); - this.config = _config_6; + const _config_6 = resolveCompressionConfig(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); + super(_config_7); + this.config = _config_7; this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); diff --git a/private/aws-protocoltests-ec2/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-ec2/src/commands/PutWithContentEncodingCommand.ts index 194bae4a9f5e..014d5c354718 100644 --- a/private/aws-protocoltests-ec2/src/commands/PutWithContentEncodingCommand.ts +++ b/private/aws-protocoltests-ec2/src/commands/PutWithContentEncodingCommand.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; import { getSerdePlugin } from "@smithy/middleware-serde"; import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; @@ -62,7 +63,10 @@ export class PutWithContentEncodingCommand extends $Command ServiceOutputTypes >() .m(function (this: any, Command: any, cs: any, config: EC2ProtocolClientResolvedConfig, o: any) { - return [getSerdePlugin(config, this.serialize, this.deserialize)]; + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getCompressionPlugin(config, { encodings: ["gzip"] }), + ]; }) .s("AwsEc2", "PutWithContentEncoding", {}) .n("EC2ProtocolClient", "PutWithContentEncodingCommand") diff --git a/private/aws-protocoltests-ec2/src/runtimeConfig.browser.ts b/private/aws-protocoltests-ec2/src/runtimeConfig.browser.ts index 5d2f726334c1..0bb7b557bb01 100644 --- a/private/aws-protocoltests-ec2/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-ec2/src/runtimeConfig.browser.ts @@ -6,6 +6,10 @@ import { Sha256 } from "@aws-crypto/sha256-browser"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; import { calculateBodyLength } from "@smithy/util-body-length-browser"; import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; @@ -29,8 +33,11 @@ export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha256: config?.sha256 ?? Sha256, streamCollector: config?.streamCollector ?? streamCollector, diff --git a/private/aws-protocoltests-ec2/src/runtimeConfig.ts b/private/aws-protocoltests-ec2/src/runtimeConfig.ts index eb564403532e..22ff259daf70 100644 --- a/private/aws-protocoltests-ec2/src/runtimeConfig.ts +++ b/private/aws-protocoltests-ec2/src/runtimeConfig.ts @@ -9,6 +9,10 @@ import { NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; @@ -38,8 +42,12 @@ export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), retryMode: config?.retryMode ?? loadNodeConfig({ diff --git a/private/aws-protocoltests-json-10/package.json b/private/aws-protocoltests-json-10/package.json index 87428fc2887f..2fc3eea7e080 100644 --- a/private/aws-protocoltests-json-10/package.json +++ b/private/aws-protocoltests-json-10/package.json @@ -32,6 +32,7 @@ "@smithy/fetch-http-handler": "^2.3.2", "@smithy/hash-node": "^2.0.18", "@smithy/invalid-dependency": "^2.0.16", + "@smithy/middleware-compression": "^2.0.2", "@smithy/middleware-content-length": "^2.0.18", "@smithy/middleware-retry": "^2.0.26", "@smithy/middleware-serde": "^2.0.16", diff --git a/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts b/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts index eeb1d2b2ec25..d61d1ed6df55 100644 --- a/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts +++ b/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts @@ -21,6 +21,11 @@ import { resolveEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; import { getContentLengthPlugin } from "@smithy/middleware-content-length"; import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; @@ -260,7 +265,8 @@ export type JSONRPC10ClientConfigType = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & - UserAgentInputConfig; + UserAgentInputConfig & + CompressionInputConfig; /** * @public * @@ -278,7 +284,8 @@ export type JSONRPC10ClientResolvedConfigType = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & - UserAgentResolvedConfig; + UserAgentResolvedConfig & + CompressionResolvedConfig; /** * @public * @@ -307,9 +314,10 @@ export class JSONRPC10Client extends __Client< const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveHostHeaderConfig(_config_3); const _config_5 = resolveUserAgentConfig(_config_4); - const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []); - super(_config_6); - this.config = _config_6; + const _config_6 = resolveCompressionConfig(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); + super(_config_7); + this.config = _config_7; this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); diff --git a/private/aws-protocoltests-json-10/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-json-10/src/commands/PutWithContentEncodingCommand.ts index cc2696c1c16d..88459dad7b78 100644 --- a/private/aws-protocoltests-json-10/src/commands/PutWithContentEncodingCommand.ts +++ b/private/aws-protocoltests-json-10/src/commands/PutWithContentEncodingCommand.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; import { getSerdePlugin } from "@smithy/middleware-serde"; import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; @@ -62,7 +63,10 @@ export class PutWithContentEncodingCommand extends $Command ServiceOutputTypes >() .m(function (this: any, Command: any, cs: any, config: JSONRPC10ClientResolvedConfig, o: any) { - return [getSerdePlugin(config, this.serialize, this.deserialize)]; + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getCompressionPlugin(config, { encodings: ["gzip"] }), + ]; }) .s("JsonRpc10", "PutWithContentEncoding", {}) .n("JSONRPC10Client", "PutWithContentEncodingCommand") diff --git a/private/aws-protocoltests-json-10/src/runtimeConfig.browser.ts b/private/aws-protocoltests-json-10/src/runtimeConfig.browser.ts index 498f22348441..63f43906b2a2 100644 --- a/private/aws-protocoltests-json-10/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-json-10/src/runtimeConfig.browser.ts @@ -6,6 +6,10 @@ import { Sha256 } from "@aws-crypto/sha256-browser"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; import { calculateBodyLength } from "@smithy/util-body-length-browser"; import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; @@ -29,8 +33,11 @@ export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha256: config?.sha256 ?? Sha256, streamCollector: config?.streamCollector ?? streamCollector, diff --git a/private/aws-protocoltests-json-10/src/runtimeConfig.ts b/private/aws-protocoltests-json-10/src/runtimeConfig.ts index 63c7e9f5253b..2464fea7233c 100644 --- a/private/aws-protocoltests-json-10/src/runtimeConfig.ts +++ b/private/aws-protocoltests-json-10/src/runtimeConfig.ts @@ -9,6 +9,10 @@ import { NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; @@ -38,8 +42,12 @@ export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), retryMode: config?.retryMode ?? loadNodeConfig({ diff --git a/private/aws-protocoltests-json/package.json b/private/aws-protocoltests-json/package.json index d9609942fc4d..a4796287fca1 100644 --- a/private/aws-protocoltests-json/package.json +++ b/private/aws-protocoltests-json/package.json @@ -35,6 +35,7 @@ "@smithy/fetch-http-handler": "^2.3.2", "@smithy/hash-node": "^2.0.18", "@smithy/invalid-dependency": "^2.0.16", + "@smithy/middleware-compression": "^2.0.2", "@smithy/middleware-content-length": "^2.0.18", "@smithy/middleware-retry": "^2.0.26", "@smithy/middleware-serde": "^2.0.16", diff --git a/private/aws-protocoltests-json/src/JsonProtocolClient.ts b/private/aws-protocoltests-json/src/JsonProtocolClient.ts index 6948472a1a67..68c6099c4eed 100644 --- a/private/aws-protocoltests-json/src/JsonProtocolClient.ts +++ b/private/aws-protocoltests-json/src/JsonProtocolClient.ts @@ -28,6 +28,11 @@ import { resolveEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; import { getContentLengthPlugin } from "@smithy/middleware-content-length"; import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; @@ -282,7 +287,8 @@ export type JsonProtocolClientConfigType = Partial<__SmithyConfiguration<__HttpH RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & - UserAgentInputConfig; + UserAgentInputConfig & + CompressionInputConfig; /** * @public * @@ -301,7 +307,8 @@ export type JsonProtocolClientResolvedConfigType = __SmithyResolvedConfiguration RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & - UserAgentResolvedConfig; + UserAgentResolvedConfig & + CompressionResolvedConfig; /** * @public * @@ -331,9 +338,10 @@ export class JsonProtocolClient extends __Client< const _config_4 = resolveHostHeaderConfig(_config_3); const _config_5 = resolveAwsAuthConfig(_config_4); const _config_6 = resolveUserAgentConfig(_config_5); - const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); - super(_config_7); - this.config = _config_7; + const _config_7 = resolveCompressionConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); diff --git a/private/aws-protocoltests-json/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-json/src/commands/PutWithContentEncodingCommand.ts index c987dce387a7..f66873902c1c 100644 --- a/private/aws-protocoltests-json/src/commands/PutWithContentEncodingCommand.ts +++ b/private/aws-protocoltests-json/src/commands/PutWithContentEncodingCommand.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; import { getSerdePlugin } from "@smithy/middleware-serde"; import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; @@ -62,7 +63,10 @@ export class PutWithContentEncodingCommand extends $Command ServiceOutputTypes >() .m(function (this: any, Command: any, cs: any, config: JsonProtocolClientResolvedConfig, o: any) { - return [getSerdePlugin(config, this.serialize, this.deserialize)]; + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getCompressionPlugin(config, { encodings: ["gzip"] }), + ]; }) .s("JsonProtocol", "PutWithContentEncoding", {}) .n("JsonProtocolClient", "PutWithContentEncodingCommand") diff --git a/private/aws-protocoltests-json/src/runtimeConfig.browser.ts b/private/aws-protocoltests-json/src/runtimeConfig.browser.ts index e06436e0de40..2f2105bfd956 100644 --- a/private/aws-protocoltests-json/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-json/src/runtimeConfig.browser.ts @@ -7,6 +7,10 @@ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; import { invalidProvider } from "@smithy/invalid-dependency"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; import { calculateBodyLength } from "@smithy/util-body-length-browser"; import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; import { JsonProtocolClientConfig } from "./JsonProtocolClient"; @@ -32,9 +36,12 @@ export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, region: config?.region ?? invalidProvider("Region is missing"), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha256: config?.sha256 ?? Sha256, streamCollector: config?.streamCollector ?? streamCollector, diff --git a/private/aws-protocoltests-json/src/runtimeConfig.ts b/private/aws-protocoltests-json/src/runtimeConfig.ts index be7d6067f103..6381b44b2cd1 100644 --- a/private/aws-protocoltests-json/src/runtimeConfig.ts +++ b/private/aws-protocoltests-json/src/runtimeConfig.ts @@ -13,6 +13,10 @@ import { NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; @@ -44,9 +48,13 @@ export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), retryMode: config?.retryMode ?? loadNodeConfig({ diff --git a/private/aws-protocoltests-query/package.json b/private/aws-protocoltests-query/package.json index 16535d625b6d..6ea75c9722d1 100644 --- a/private/aws-protocoltests-query/package.json +++ b/private/aws-protocoltests-query/package.json @@ -32,6 +32,7 @@ "@smithy/fetch-http-handler": "^2.3.2", "@smithy/hash-node": "^2.0.18", "@smithy/invalid-dependency": "^2.0.16", + "@smithy/middleware-compression": "^2.0.2", "@smithy/middleware-content-length": "^2.0.18", "@smithy/middleware-retry": "^2.0.26", "@smithy/middleware-serde": "^2.0.16", diff --git a/private/aws-protocoltests-query/src/QueryProtocolClient.ts b/private/aws-protocoltests-query/src/QueryProtocolClient.ts index 3dd0355da327..50dc7408a909 100644 --- a/private/aws-protocoltests-query/src/QueryProtocolClient.ts +++ b/private/aws-protocoltests-query/src/QueryProtocolClient.ts @@ -21,6 +21,11 @@ import { resolveEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; import { getContentLengthPlugin } from "@smithy/middleware-content-length"; import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; @@ -323,7 +328,8 @@ export type QueryProtocolClientConfigType = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & - UserAgentInputConfig; + UserAgentInputConfig & + CompressionInputConfig; /** * @public * @@ -341,7 +347,8 @@ export type QueryProtocolClientResolvedConfigType = __SmithyResolvedConfiguratio EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & - UserAgentResolvedConfig; + UserAgentResolvedConfig & + CompressionResolvedConfig; /** * @public * @@ -371,9 +378,10 @@ export class QueryProtocolClient extends __Client< const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveHostHeaderConfig(_config_3); const _config_5 = resolveUserAgentConfig(_config_4); - const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []); - super(_config_6); - this.config = _config_6; + const _config_6 = resolveCompressionConfig(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); + super(_config_7); + this.config = _config_7; this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); diff --git a/private/aws-protocoltests-query/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-query/src/commands/PutWithContentEncodingCommand.ts index 03ba1e4fbfaf..6c8f6bcb43d8 100644 --- a/private/aws-protocoltests-query/src/commands/PutWithContentEncodingCommand.ts +++ b/private/aws-protocoltests-query/src/commands/PutWithContentEncodingCommand.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; import { getSerdePlugin } from "@smithy/middleware-serde"; import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; @@ -62,7 +63,10 @@ export class PutWithContentEncodingCommand extends $Command ServiceOutputTypes >() .m(function (this: any, Command: any, cs: any, config: QueryProtocolClientResolvedConfig, o: any) { - return [getSerdePlugin(config, this.serialize, this.deserialize)]; + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getCompressionPlugin(config, { encodings: ["gzip"] }), + ]; }) .s("AwsQuery", "PutWithContentEncoding", {}) .n("QueryProtocolClient", "PutWithContentEncodingCommand") diff --git a/private/aws-protocoltests-query/src/runtimeConfig.browser.ts b/private/aws-protocoltests-query/src/runtimeConfig.browser.ts index 97ab096949d1..0bc4fc141def 100644 --- a/private/aws-protocoltests-query/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-query/src/runtimeConfig.browser.ts @@ -6,6 +6,10 @@ import { Sha256 } from "@aws-crypto/sha256-browser"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; import { calculateBodyLength } from "@smithy/util-body-length-browser"; import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; import { QueryProtocolClientConfig } from "./QueryProtocolClient"; @@ -29,8 +33,11 @@ export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha256: config?.sha256 ?? Sha256, streamCollector: config?.streamCollector ?? streamCollector, diff --git a/private/aws-protocoltests-query/src/runtimeConfig.ts b/private/aws-protocoltests-query/src/runtimeConfig.ts index f7ab4eb64fce..661d051741e5 100644 --- a/private/aws-protocoltests-query/src/runtimeConfig.ts +++ b/private/aws-protocoltests-query/src/runtimeConfig.ts @@ -9,6 +9,10 @@ import { NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; @@ -38,8 +42,12 @@ export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), retryMode: config?.retryMode ?? loadNodeConfig({ diff --git a/private/aws-protocoltests-restjson/package.json b/private/aws-protocoltests-restjson/package.json index 3fa2aa1b7fd5..c31acd2c1593 100644 --- a/private/aws-protocoltests-restjson/package.json +++ b/private/aws-protocoltests-restjson/package.json @@ -37,6 +37,7 @@ "@smithy/invalid-dependency": "^2.0.16", "@smithy/md5-js": "^2.0.18", "@smithy/middleware-apply-body-checksum": "^2.0.18", + "@smithy/middleware-compression": "^2.0.2", "@smithy/middleware-content-length": "^2.0.18", "@smithy/middleware-retry": "^2.0.26", "@smithy/middleware-serde": "^2.0.16", diff --git a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts index 86f7c10f8d7e..c9a413f570d9 100644 --- a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts +++ b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts @@ -21,6 +21,11 @@ import { resolveEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; import { getContentLengthPlugin } from "@smithy/middleware-content-length"; import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; @@ -653,7 +658,8 @@ export type RestJsonProtocolClientConfigType = Partial<__SmithyConfiguration<__H EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & - UserAgentInputConfig; + UserAgentInputConfig & + CompressionInputConfig; /** * @public * @@ -671,7 +677,8 @@ export type RestJsonProtocolClientResolvedConfigType = __SmithyResolvedConfigura EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & - UserAgentResolvedConfig; + UserAgentResolvedConfig & + CompressionResolvedConfig; /** * @public * @@ -701,9 +708,10 @@ export class RestJsonProtocolClient extends __Client< const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveHostHeaderConfig(_config_3); const _config_5 = resolveUserAgentConfig(_config_4); - const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []); - super(_config_6); - this.config = _config_6; + const _config_6 = resolveCompressionConfig(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); + super(_config_7); + this.config = _config_7; this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); diff --git a/private/aws-protocoltests-restjson/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-restjson/src/commands/PutWithContentEncodingCommand.ts index 9561b322e7bc..4e3b78494bfc 100644 --- a/private/aws-protocoltests-restjson/src/commands/PutWithContentEncodingCommand.ts +++ b/private/aws-protocoltests-restjson/src/commands/PutWithContentEncodingCommand.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; import { getSerdePlugin } from "@smithy/middleware-serde"; import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; @@ -62,7 +63,10 @@ export class PutWithContentEncodingCommand extends $Command ServiceOutputTypes >() .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) { - return [getSerdePlugin(config, this.serialize, this.deserialize)]; + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getCompressionPlugin(config, { encodings: ["gzip"] }), + ]; }) .s("RestJson", "PutWithContentEncoding", {}) .n("RestJsonProtocolClient", "PutWithContentEncodingCommand") diff --git a/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts b/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts index d0d81ac6c895..eb10431aa6ec 100644 --- a/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-restjson/src/runtimeConfig.browser.ts @@ -8,6 +8,10 @@ import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smit import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; import { blobHasher as streamHasher } from "@smithy/hash-blob-browser"; import { Md5 } from "@smithy/md5-js"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; import { calculateBodyLength } from "@smithy/util-body-length-browser"; import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; @@ -31,9 +35,12 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, md5: config?.md5 ?? Md5, requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha256: config?.sha256 ?? Sha256, streamCollector: config?.streamCollector ?? streamCollector, diff --git a/private/aws-protocoltests-restjson/src/runtimeConfig.ts b/private/aws-protocoltests-restjson/src/runtimeConfig.ts index 556acef58436..669349b3afec 100644 --- a/private/aws-protocoltests-restjson/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restjson/src/runtimeConfig.ts @@ -10,6 +10,10 @@ import { } from "@smithy/config-resolver"; import { Hash } from "@smithy/hash-node"; import { fileStreamHasher as streamHasher } from "@smithy/hash-stream-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; @@ -39,9 +43,13 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: config?.md5 ?? Hash.bind(null, "md5"), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), retryMode: config?.retryMode ?? loadNodeConfig({ diff --git a/private/aws-protocoltests-restxml/package.json b/private/aws-protocoltests-restxml/package.json index da625c1510da..b93c89118457 100644 --- a/private/aws-protocoltests-restxml/package.json +++ b/private/aws-protocoltests-restxml/package.json @@ -34,6 +34,7 @@ "@smithy/fetch-http-handler": "^2.3.2", "@smithy/hash-node": "^2.0.18", "@smithy/invalid-dependency": "^2.0.16", + "@smithy/middleware-compression": "^2.0.2", "@smithy/middleware-content-length": "^2.0.18", "@smithy/middleware-retry": "^2.0.26", "@smithy/middleware-serde": "^2.0.16", diff --git a/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts b/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts index de4843a25a41..db6c521cd827 100644 --- a/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts +++ b/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts @@ -21,6 +21,11 @@ import { resolveEndpointsConfig, resolveRegionConfig, } from "@smithy/config-resolver"; +import { + CompressionInputConfig, + CompressionResolvedConfig, + resolveCompressionConfig, +} from "@smithy/middleware-compression"; import { getContentLengthPlugin } from "@smithy/middleware-content-length"; import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; @@ -473,7 +478,8 @@ export type RestXmlProtocolClientConfigType = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & RetryInputConfig & HostHeaderInputConfig & - UserAgentInputConfig; + UserAgentInputConfig & + CompressionInputConfig; /** * @public * @@ -491,7 +497,8 @@ export type RestXmlProtocolClientResolvedConfigType = __SmithyResolvedConfigurat EndpointsResolvedConfig & RetryResolvedConfig & HostHeaderResolvedConfig & - UserAgentResolvedConfig; + UserAgentResolvedConfig & + CompressionResolvedConfig; /** * @public * @@ -521,9 +528,10 @@ export class RestXmlProtocolClient extends __Client< const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveHostHeaderConfig(_config_3); const _config_5 = resolveUserAgentConfig(_config_4); - const _config_6 = resolveRuntimeExtensions(_config_5, configuration?.extensions || []); - super(_config_6); - this.config = _config_6; + const _config_6 = resolveCompressionConfig(_config_5); + const _config_7 = resolveRuntimeExtensions(_config_6, configuration?.extensions || []); + super(_config_7); + this.config = _config_7; this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); diff --git a/private/aws-protocoltests-restxml/src/commands/PutWithContentEncodingCommand.ts b/private/aws-protocoltests-restxml/src/commands/PutWithContentEncodingCommand.ts index a84d01ba3c18..2a677bdd3131 100644 --- a/private/aws-protocoltests-restxml/src/commands/PutWithContentEncodingCommand.ts +++ b/private/aws-protocoltests-restxml/src/commands/PutWithContentEncodingCommand.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code +import { getCompressionPlugin } from "@smithy/middleware-compression"; import { getSerdePlugin } from "@smithy/middleware-serde"; import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; @@ -62,7 +63,10 @@ export class PutWithContentEncodingCommand extends $Command ServiceOutputTypes >() .m(function (this: any, Command: any, cs: any, config: RestXmlProtocolClientResolvedConfig, o: any) { - return [getSerdePlugin(config, this.serialize, this.deserialize)]; + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getCompressionPlugin(config, { encodings: ["gzip"] }), + ]; }) .s("RestXml", "PutWithContentEncoding", {}) .n("RestXmlProtocolClient", "PutWithContentEncodingCommand") diff --git a/private/aws-protocoltests-restxml/src/runtimeConfig.browser.ts b/private/aws-protocoltests-restxml/src/runtimeConfig.browser.ts index 90fb07ba7403..d7ac083b4f2d 100644 --- a/private/aws-protocoltests-restxml/src/runtimeConfig.browser.ts +++ b/private/aws-protocoltests-restxml/src/runtimeConfig.browser.ts @@ -6,6 +6,10 @@ import { Sha256 } from "@aws-crypto/sha256-browser"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { + DEFAULT_DISABLE_REQUEST_COMPRESSION, + DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, +} from "@smithy/middleware-compression"; import { calculateBodyLength } from "@smithy/util-body-length-browser"; import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; @@ -29,8 +33,11 @@ export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: config?.disableRequestCompression ?? DEFAULT_DISABLE_REQUEST_COMPRESSION, maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? DEFAULT_NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES, retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), sha256: config?.sha256 ?? Sha256, streamCollector: config?.streamCollector ?? streamCollector, diff --git a/private/aws-protocoltests-restxml/src/runtimeConfig.ts b/private/aws-protocoltests-restxml/src/runtimeConfig.ts index 687d94d0ef74..9e1e7bdc25ba 100644 --- a/private/aws-protocoltests-restxml/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restxml/src/runtimeConfig.ts @@ -9,6 +9,10 @@ import { NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver"; import { Hash } from "@smithy/hash-node"; +import { + NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, + NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, +} from "@smithy/middleware-compression"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; @@ -38,8 +42,12 @@ export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + disableRequestCompression: + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + requestMinCompressionSizeBytes: + config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), retryMode: config?.retryMode ?? loadNodeConfig({ diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index 96d0ae0deeb4..df3886d43330 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,5 +1,5 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "e3b13dda0891091282c27cd65cc72b87826753b6", + SMITHY_TS_COMMIT: "9972041f7d31886e035ec68bffc5f0af12512dd3", }; diff --git a/yarn.lock b/yarn.lock index b6cce85feb44..81cda18b94e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2982,6 +2982,18 @@ "@smithy/types" "^2.8.0" tslib "^2.5.0" +"@smithy/middleware-compression@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@smithy/middleware-compression/-/middleware-compression-2.0.2.tgz#c3703e41f75375d85a56fc1068b0d019de105834" + integrity sha512-NfmxAKj64PCq8U4w2UpdraA4UAkd2Tsdms+8czU2CtOzjWMFe3aSE/pEWTfy/l+BpfyT8lsghFyTr3DIlk1kCg== + dependencies: + "@smithy/node-config-provider" "^2.1.9" + "@smithy/types" "^2.8.0" + "@smithy/util-config-provider" "^2.1.0" + "@smithy/util-middleware" "^2.0.9" + fflate "0.8.1" + tslib "^2.5.0" + "@smithy/middleware-content-length@^2.0.18": version "2.0.18" resolved "https://registry.yarnpkg.com/@smithy/middleware-content-length/-/middleware-content-length-2.0.18.tgz#a3b13beb300290f5d0d48ace0f818e44261356fa"