From fa5324448dc49d9a3db16f98c2171864224d5c10 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:32:36 -0700 Subject: [PATCH] Skip adding unsupported comment for config customUserAgent (#855) --- .changeset/brown-badgers-cheer.md | 5 +++++ .../v2-to-v3/__fixtures__/config/customUserAgent.input.js | 5 +++++ .../v2-to-v3/__fixtures__/config/customUserAgent.output.js | 3 +++ src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts | 1 + 4 files changed, 14 insertions(+) create mode 100644 .changeset/brown-badgers-cheer.md create mode 100644 src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.input.js create mode 100644 src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.output.js diff --git a/.changeset/brown-badgers-cheer.md b/.changeset/brown-badgers-cheer.md new file mode 100644 index 000000000..c84860a64 --- /dev/null +++ b/.changeset/brown-badgers-cheer.md @@ -0,0 +1,5 @@ +--- +"aws-sdk-js-codemod": patch +--- + +Skip adding unsupported comment for config customUserAgent diff --git a/src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.input.js b/src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.input.js new file mode 100644 index 000000000..a68d2d673 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.input.js @@ -0,0 +1,5 @@ +import AWS from "aws-sdk"; + +const config = new AWS.Config({ + customUserAgent: "MyApp/1.0.0" +}); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.output.js b/src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.output.js new file mode 100644 index 000000000..b86d6b540 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/config/customUserAgent.output.js @@ -0,0 +1,3 @@ +const config = { + customUserAgent: "MyApp/1.0.0" +}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts b/src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts index 688c2b067..ffdc05733 100644 --- a/src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts +++ b/src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts @@ -26,6 +26,7 @@ export const AWS_CONFIG_KEY_MAP: Record = { newKeyName: "credentials", description: "The credentials in JS SDK v3 accepts providers.", }, + customUserAgent: {}, endpoint: {}, endpointCacheSize: {}, endpointDiscoveryEnabled: {},