diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java index e0a50fa7648..2c74dbc0033 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptDependency.java @@ -40,25 +40,25 @@ public enum TypeScriptDependency implements Dependency { AWS_SDK_CLIENT_DOCGEN("devDependencies", "@smithy/service-client-documentation-generator", "^2.0.0", true), AWS_SDK_TYPES("dependencies", "@aws-sdk/types", true), - SMITHY_TYPES("dependencies", "@smithy/types", "^2.2.2", true), - AWS_SMITHY_CLIENT("dependencies", "@smithy/smithy-client", "^2.0.5", true), - INVALID_DEPENDENCY("dependencies", "@smithy/invalid-dependency", "^2.0.5", true), - CONFIG_RESOLVER("dependencies", "@smithy/config-resolver", "^2.0.5", true), + SMITHY_TYPES("dependencies", "@smithy/types", "^2.3.0", true), + AWS_SMITHY_CLIENT("dependencies", "@smithy/smithy-client", "^2.1.1", true), + INVALID_DEPENDENCY("dependencies", "@smithy/invalid-dependency", "^2.0.6", true), + CONFIG_RESOLVER("dependencies", "@smithy/config-resolver", "^2.0.6", true), TYPES_NODE("devDependencies", "@types/node", "^14.14.31", true), - MIDDLEWARE_CONTENT_LENGTH("dependencies", "@smithy/middleware-content-length", "^2.0.5", true), - MIDDLEWARE_SERDE("dependencies", "@smithy/middleware-serde", "^2.0.5", true), - MIDDLEWARE_RETRY("dependencies", "@smithy/middleware-retry", "^2.0.5", true), + MIDDLEWARE_CONTENT_LENGTH("dependencies", "@smithy/middleware-content-length", "^2.0.7", true), + MIDDLEWARE_SERDE("dependencies", "@smithy/middleware-serde", "^2.0.6", true), + MIDDLEWARE_RETRY("dependencies", "@smithy/middleware-retry", "^2.0.7", true), UTIL_RETRY("dependencies", "@smithy/util-retry", "^2.0.0", false), MIDDLEWARE_STACK("dependencies", "@smithy/middleware-stack", "^2.0.0", true), - MIDDLEWARE_ENDPOINTS_V2("dependencies", "@smithy/middleware-endpoint", "^2.0.5", false), + MIDDLEWARE_ENDPOINTS_V2("dependencies", "@smithy/middleware-endpoint", "^2.0.6", false), AWS_SDK_UTIL_ENDPOINTS("dependencies", "@aws-sdk/util-endpoints", false), AWS_CRYPTO_SHA256_BROWSER("dependencies", "@aws-crypto/sha256-browser", "3.0.0", true), AWS_CRYPTO_SHA256_JS("dependencies", "@aws-crypto/sha256-js", "3.0.0", true), - AWS_SDK_HASH_NODE("dependencies", "@smithy/hash-node", "^2.0.5", true), + AWS_SDK_HASH_NODE("dependencies", "@smithy/hash-node", "^2.0.6", true), - AWS_SDK_URL_PARSER("dependencies", "@smithy/url-parser", "^2.0.5", true), + AWS_SDK_URL_PARSER("dependencies", "@smithy/url-parser", "^2.0.6", true), @Deprecated AWS_SDK_UTIL_BASE64_BROWSER("dependencies", "@smithy/util-base64-browser", "^1.0.1", false), @Deprecated AWS_SDK_UTIL_BASE64_NODE("dependencies", "@smithy/util-base64-node", "^1.0.1", false), @@ -69,25 +69,25 @@ public enum TypeScriptDependency implements Dependency { AWS_SDK_UTIL_UTF8("dependencies", "@smithy/util-utf8", "^2.0.0", true), - AWS_SDK_UTIL_WAITERS("dependencies", "@smithy/util-waiter", "^2.0.5", false), + AWS_SDK_UTIL_WAITERS("dependencies", "@smithy/util-waiter", "^2.0.6", false), - AWS_SDK_UTIL_DEFAULTS_MODE_NODE("dependencies", "@smithy/util-defaults-mode-node", "^2.0.6", true), - AWS_SDK_UTIL_DEFAULTS_MODE_BROWSER("dependencies", "@smithy/util-defaults-mode-browser", "^2.0.6", true), + AWS_SDK_UTIL_DEFAULTS_MODE_NODE("dependencies", "@smithy/util-defaults-mode-node", "^2.0.8", true), + AWS_SDK_UTIL_DEFAULTS_MODE_BROWSER("dependencies", "@smithy/util-defaults-mode-browser", "^2.0.7", true), - NODE_CONFIG_PROVIDER("dependencies", "@smithy/node-config-provider", "^2.0.6", false), + NODE_CONFIG_PROVIDER("dependencies", "@smithy/node-config-provider", "^2.0.8", false), UUID("dependencies", "uuid", "^8.3.2", false), // Conditionally added when httpChecksumRequired trait exists - MD5_BROWSER("dependencies", "@smithy/md5-js", "^2.0.5", false), - STREAM_HASHER_NODE("dependencies", "@smithy/hash-stream-node", "^2.0.5", false), - STREAM_HASHER_BROWSER("dependencies", "@smithy/hash-blob-browser", "^2.0.5", false), - BODY_CHECKSUM("dependencies", "@smithy/middleware-apply-body-checksum", "^2.0.5", false), + MD5_BROWSER("dependencies", "@smithy/md5-js", "^2.0.6", false), + STREAM_HASHER_NODE("dependencies", "@smithy/hash-stream-node", "^2.0.6", false), + STREAM_HASHER_BROWSER("dependencies", "@smithy/hash-blob-browser", "^2.0.6", false), + BODY_CHECKSUM("dependencies", "@smithy/middleware-apply-body-checksum", "^2.0.7", false), // Conditionally added when using an HTTP application protocol. - PROTOCOL_HTTP("dependencies", "@smithy/protocol-http", "^2.0.5", false), - AWS_SDK_FETCH_HTTP_HANDLER("dependencies", "@smithy/fetch-http-handler", "^2.0.5", false), - AWS_SDK_NODE_HTTP_HANDLER("dependencies", "@smithy/node-http-handler", "^2.0.5", false), + PROTOCOL_HTTP("dependencies", "@smithy/protocol-http", "^3.0.1", false), + AWS_SDK_FETCH_HTTP_HANDLER("dependencies", "@smithy/fetch-http-handler", "^2.1.1", false), + AWS_SDK_NODE_HTTP_HANDLER("dependencies", "@smithy/node-http-handler", "^2.1.1", false), // Conditionally added when setting the auth middleware. UTIL_MIDDLEWARE("dependencies", "@smithy/util-middleware", "^2.0.0", false), @@ -95,28 +95,28 @@ public enum TypeScriptDependency implements Dependency { // Conditionally added if a event stream shape is found anywhere in the model AWS_SDK_EVENTSTREAM_SERDE_CONFIG_RESOLVER( - "dependencies", "@smithy/eventstream-serde-config-resolver", "^2.0.5", false), - AWS_SDK_EVENTSTREAM_SERDE_NODE("dependencies", "@smithy/eventstream-serde-node", "^2.0.5", false), - AWS_SDK_EVENTSTREAM_SERDE_BROWSER("dependencies", "@smithy/eventstream-serde-browser", "^2.0.5", false), + "dependencies", "@smithy/eventstream-serde-config-resolver", "^2.0.6", false), + AWS_SDK_EVENTSTREAM_SERDE_NODE("dependencies", "@smithy/eventstream-serde-node", "^2.0.6", false), + AWS_SDK_EVENTSTREAM_SERDE_BROWSER("dependencies", "@smithy/eventstream-serde-browser", "^2.0.6", false), // Conditionally added if a big decimal shape is found in a model. BIG_JS("dependencies", "big.js", "^6.0.0", false), TYPES_BIG_JS("devDependencies", "@types/big.js", "^6.0.0", false), // Conditionally added when interacting with specific protocol test bodyMediaType values. - AWS_SDK_QUERYSTRING_BUILDER("dependencies", "@smithy/querystring-builder", "^2.0.5", false), + AWS_SDK_QUERYSTRING_BUILDER("dependencies", "@smithy/querystring-builder", "^2.0.6", false), // Conditionally added when XML parser needs to be used. XML_PARSER("dependencies", "fast-xml-parser", "4.2.5", false), HTML_ENTITIES("dependencies", "entities", "2.2.0", false), // Conditionally added when streaming blob response payload exists. - @Deprecated UTIL_STREAM_NODE("dependencies", "@smithy/util-stream-node", "^2.0.5", false), - @Deprecated UTIL_STREAM_BROWSER("dependencies", "@smithy/util-stream-browser", "^2.0.5", false), - UTIL_STREAM("dependencies", "@smithy/util-stream", "^2.0.5", false), + @Deprecated UTIL_STREAM_NODE("dependencies", "@smithy/util-stream-node", "^2.0.7", false), + @Deprecated UTIL_STREAM_BROWSER("dependencies", "@smithy/util-stream-browser", "^2.0.7", false), + UTIL_STREAM("dependencies", "@smithy/util-stream", "^2.0.7", false), // Conditionally added when @aws.auth#sigv4 is used - SIGNATURE_V4("dependencies", "@smithy/signature-v4", "^2.0.4", false), + SIGNATURE_V4("dependencies", "@smithy/signature-v4", "^2.0.6", false), // feat(experimentalIdentityAndAuth): Conditionally added dependencies for `experimentalIdentityAndAuth`. // This package should never have a major version, and should only use minor and patch versions in development. diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/DefaultExtensionConfigurationInterface.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/DefaultExtensionConfigurationInterface.java index f4cf09d893d..faf3d5b471d 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/DefaultExtensionConfigurationInterface.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/DefaultExtensionConfigurationInterface.java @@ -1,16 +1,6 @@ /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package software.amazon.smithy.typescript.codegen.extensions; diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/ExtensionConfigurationInterface.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/ExtensionConfigurationInterface.java index cf751f35230..03bdeae8c29 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/ExtensionConfigurationInterface.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/ExtensionConfigurationInterface.java @@ -1,16 +1,6 @@ /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * SPDX-License-Identifier: Apache-2.0 */ package software.amazon.smithy.typescript.codegen.extensions; diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/HttpHandlerExtensionConfigurationInterface.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/HttpHandlerExtensionConfigurationInterface.java new file mode 100644 index 00000000000..b14a540acb2 --- /dev/null +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/extensions/HttpHandlerExtensionConfigurationInterface.java @@ -0,0 +1,28 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.typescript.codegen.extensions; + +import software.amazon.smithy.typescript.codegen.Dependency; +import software.amazon.smithy.typescript.codegen.TypeScriptDependency; +import software.amazon.smithy.utils.Pair; + +public class HttpHandlerExtensionConfigurationInterface implements ExtensionConfigurationInterface { + + @Override + public Pair name() { + return Pair.of("HttpHandlerExtensionConfiguration", TypeScriptDependency.PROTOCOL_HTTP); + } + + @Override + public Pair getExtensionConfigurationFn() { + return Pair.of("getHttpHandlerExtensionConfiguration", TypeScriptDependency.PROTOCOL_HTTP); + } + + @Override + public Pair resolveRuntimeConfigFn() { + return Pair.of("resolveHttpHandlerRuntimeConfig", TypeScriptDependency.PROTOCOL_HTTP); + } +} diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddClientRuntimeConfig.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddClientRuntimeConfig.java index ceb0fe935d9..1a849d41ea8 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddClientRuntimeConfig.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddClientRuntimeConfig.java @@ -19,6 +19,7 @@ import software.amazon.smithy.typescript.codegen.TypeScriptWriter; import software.amazon.smithy.typescript.codegen.extensions.DefaultExtensionConfigurationInterface; import software.amazon.smithy.typescript.codegen.extensions.ExtensionConfigurationInterface; +import software.amazon.smithy.typescript.codegen.extensions.HttpHandlerExtensionConfigurationInterface; import software.amazon.smithy.utils.MapUtils; import software.amazon.smithy.utils.SmithyInternalApi; @@ -138,6 +139,6 @@ public Map> getRuntimeConfigWriters( @Override public List getExtensionConfigurationInterfaces() { - return List.of(new DefaultExtensionConfigurationInterface()); + return List.of(new DefaultExtensionConfigurationInterface(), new HttpHandlerExtensionConfigurationInterface()); } } diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/resolveRuntimeExtensions1.template b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/resolveRuntimeExtensions1.template index 08422f06673..e66fe2c9f11 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/resolveRuntimeExtensions1.template +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/resolveRuntimeExtensions1.template @@ -4,7 +4,7 @@ import { ${extensionConfigName} } from "./extensionConfiguration"; * @public */ export interface RuntimeExtension { - configure(clientConfiguration: ${extensionConfigName}): void; + configure(extensionConfiguration: ${extensionConfigName}): void; } /**