From fb18aa6f8722e5877f5bf672b372e2b491f7b487 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:24:23 -0800 Subject: [PATCH] Mark Config apiVersion as deprecated (#699) --- .changeset/five-peas-whisper.md | 5 +++++ .../v2-to-v3/__fixtures__/config/apiVersion.input.js | 5 +++++ .../v2-to-v3/__fixtures__/config/apiVersion.output.js | 5 +++++ src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts | 3 +++ 4 files changed, 18 insertions(+) create mode 100644 .changeset/five-peas-whisper.md create mode 100644 src/transforms/v2-to-v3/__fixtures__/config/apiVersion.input.js create mode 100644 src/transforms/v2-to-v3/__fixtures__/config/apiVersion.output.js diff --git a/.changeset/five-peas-whisper.md b/.changeset/five-peas-whisper.md new file mode 100644 index 00000000..2bb59273 --- /dev/null +++ b/.changeset/five-peas-whisper.md @@ -0,0 +1,5 @@ +--- +"aws-sdk-js-codemod": patch +--- + +Mark Config apiVersion as deprecated diff --git a/src/transforms/v2-to-v3/__fixtures__/config/apiVersion.input.js b/src/transforms/v2-to-v3/__fixtures__/config/apiVersion.input.js new file mode 100644 index 00000000..b7bd7a7f --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/config/apiVersion.input.js @@ -0,0 +1,5 @@ +import AWS from "aws-sdk"; + +const config = new AWS.Config({ + apiVersion: "2012-08-10" +}); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/config/apiVersion.output.js b/src/transforms/v2-to-v3/__fixtures__/config/apiVersion.output.js new file mode 100644 index 00000000..b9140e95 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/config/apiVersion.output.js @@ -0,0 +1,5 @@ +const config = { + // The key apiVersion is no longer supported in v3, and can be removed. + // @deprecated The client uses the "latest" apiVersion. + apiVersion: "2012-08-10" +}; \ 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 c31563f4..57e3ac64 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 @@ -8,6 +8,9 @@ export interface AwsConfigKeyStatus { * Maps the AWS config keys with their equivalent replacement in v3. */ export const AWS_CONFIG_KEY_MAP: Record = { + apiVersion: { + deprecationMessage: `The client uses the "latest" apiVersion.`, + }, computeChecksums: { deprecationMessage: "Applicable commands of S3 will automatically compute the MD5 checksums.", },