From 121d0f53361d624da18355dcb181e50e96cd886b Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 10:33:28 -0700 Subject: [PATCH 1/7] test: add api-gateway Stage in api-basic-type/global-import --- .../__fixtures__/api-basic-type/global-import.input.ts | 3 ++- .../__fixtures__/api-basic-type/global-import.output.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts index f4df5db11..3916dad5c 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts @@ -1,3 +1,4 @@ import AWS from "aws-sdk"; -const testTags: AWS.S3.Tag[] = [{ Key: "key", Value: "value" }]; \ No newline at end of file +const testTags: AWS.S3.Tag[] = [{ Key: "key", Value: "value" }]; +const testStages: AWS.APIGateway.Stage[] = []; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts index 4d3e7f953..38857f5bb 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts @@ -1,3 +1,5 @@ import { Tag } from "@aws-sdk/client-s3"; +import { Stage } from "@aws-sdk/client-api-gateway"; -const testTags: Tag[] = [{ Key: "key", Value: "value" }]; \ No newline at end of file +const testTags: Tag[] = [{ Key: "key", Value: "value" }]; +const testStages: Stage[] = []; \ No newline at end of file From 7d6b3ecdc034b4cce1fe74d555aa2a6a57646498 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:55:45 -0700 Subject: [PATCH 2/7] Revert "test: add api-gateway Stage in api-basic-type/global-import" This reverts commit 121d0f53361d624da18355dcb181e50e96cd886b. --- .../__fixtures__/api-basic-type/global-import.input.ts | 3 +-- .../__fixtures__/api-basic-type/global-import.output.ts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts index 3916dad5c..f4df5db11 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.input.ts @@ -1,4 +1,3 @@ import AWS from "aws-sdk"; -const testTags: AWS.S3.Tag[] = [{ Key: "key", Value: "value" }]; -const testStages: AWS.APIGateway.Stage[] = []; \ No newline at end of file +const testTags: AWS.S3.Tag[] = [{ Key: "key", Value: "value" }]; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts index 38857f5bb..4d3e7f953 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-basic-type/global-import.output.ts @@ -1,5 +1,3 @@ import { Tag } from "@aws-sdk/client-s3"; -import { Stage } from "@aws-sdk/client-api-gateway"; -const testTags: Tag[] = [{ Key: "key", Value: "value" }]; -const testStages: Stage[] = []; \ No newline at end of file +const testTags: Tag[] = [{ Key: "key", Value: "value" }]; \ No newline at end of file From 26ec7d7d21719d02b3fd55e6f398b43f3d7373c3 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:57:22 -0700 Subject: [PATCH 3/7] test: remove clients from api-input-output-type/service-import-deep --- .../service-import-deep.input.ts | 21 ++++++------------- .../service-import-deep.output.ts | 18 ++++++---------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts index e5053152c..82e20f98c 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts @@ -1,21 +1,12 @@ -import DynamoDB, { ListTablesInput, ListTablesOutput } from "aws-sdk/clients/dynamodb"; -import Lambda, { InvocationRequest, InvocationResponse } from "aws-sdk/clients/lambda"; -import STS, { GetCallerIdentityRequest, GetCallerIdentityResponse } from "aws-sdk/clients/sts"; +import { ListTablesInput, ListTablesOutput } from "aws-sdk/clients/dynamodb"; +import { InvocationRequest, InvocationResponse } from "aws-sdk/clients/lambda"; +import { GetCallerIdentityRequest, GetCallerIdentityResponse } from "aws-sdk/clients/sts"; -const ddbClient = new DynamoDB(); const listTablesInput: ListTablesInput = { Limit: 10 }; -const listTablesOutput: ListTablesOutput = await ddbClient - .listTables(listTablesInput) - .promise(); +const listTablesOutput: ListTablesOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityRequest = {}; -const getCallerIdentityOutput: GetCallerIdentityResponse = await stsClient - .getCallerIdentity(getCallerIdentityInput) - .promise(); +const getCallerIdentityOutput: GetCallerIdentityResponse = {}; -const lambdaClient = new Lambda(); const invokeInput: InvocationRequest = { FunctionName: "my-function" }; -const invokeOutput: InvocationResponse = await lambdaClient - .invoke(invokeInput) - .promise(); \ No newline at end of file +const invokeOutput: InvocationResponse = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts index 606d75fce..68a28fb27 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts @@ -1,18 +1,12 @@ -import { DynamoDB, ListTablesCommandInput, ListTablesCommandOutput } from "@aws-sdk/client-dynamodb"; -import { InvokeCommandInput, InvokeCommandOutput, Lambda } from "@aws-sdk/client-lambda"; -import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; +import { ListTablesCommandInput, ListTablesCommandOutput } from "@aws-sdk/client-dynamodb"; +import { InvokeCommandInput, InvokeCommandOutput } from "@aws-sdk/client-lambda"; +import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "@aws-sdk/client-sts"; -const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; -const listTablesOutput: ListTablesCommandOutput = await ddbClient - .listTables(listTablesInput); +const listTablesOutput: ListTablesCommandOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; -const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient - .getCallerIdentity(getCallerIdentityInput); +const getCallerIdentityOutput: GetCallerIdentityCommandOutput = {}; -const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; -const invokeOutput: InvokeCommandOutput = await lambdaClient - .invoke(invokeInput); \ No newline at end of file +const invokeOutput: InvokeCommandOutput = {}; \ No newline at end of file From 87d0b183f5b0f010fbf0ad30b3b93debcd2a1b9e Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:12:10 -0700 Subject: [PATCH 4/7] Populate client names for type transformations if not found --- .../client-names/getClientNamesRecord.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts b/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts index 62f3c2e35..e0e593672 100644 --- a/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts +++ b/src/transforms/v2-to-v3/client-names/getClientNamesRecord.ts @@ -11,7 +11,19 @@ export const getClientNamesRecord = ( importType: ImportType ) => { const clientNamesFromDeepImport = getClientNamesFromDeepImport(source.toSource()); - return importType === ImportType.REQUIRE - ? getClientNamesRecordFromRequire(j, source, clientNamesFromDeepImport) - : getClientNamesRecordFromImport(j, source, clientNamesFromDeepImport); + + const clientNamesRecord = + importType === ImportType.REQUIRE + ? getClientNamesRecordFromRequire(j, source, clientNamesFromDeepImport) + : getClientNamesRecordFromImport(j, source, clientNamesFromDeepImport); + + // Populate client names for type transformations + // Ref: https://github.com/awslabs/aws-sdk-js-codemod/issues/663 + for (const clientName of clientNamesFromDeepImport) { + if (!(clientName in clientNamesRecord)) { + clientNamesRecord[clientName] = clientName; + } + } + + return clientNamesRecord; }; From 9b8773bce27892916b79ab688374de48f9c171ad Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:16:13 -0700 Subject: [PATCH 5/7] test: remove clients from api-input-output-type --- .../global-import-equals.input.ts | 15 +++------------ .../global-import-equals.output.ts | 15 +++------------ .../global-import.input.ts | 15 +++------------ .../global-import.output.ts | 18 ++++++------------ .../service-import-equals.input.ts | 15 +++------------ .../service-import-equals.output.ts | 15 +++------------ .../service-import.input.ts | 15 +++------------ .../service-import.output.ts | 18 ++++++------------ 8 files changed, 30 insertions(+), 96 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts index a23d0672f..c54d821c6 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts @@ -1,19 +1,10 @@ import AWS = require("aws-sdk"); -const ddbClient = new AWS.DynamoDB(); const listTablesInput: AWS.DynamoDB.ListTablesInput = { Limit: 10 }; -const listTablesOutput: AWS.DynamoDB.ListTablesOutput = await ddbClient - .listTables(listTablesInput) - .promise(); +const listTablesOutput: AWS.DynamoDB.ListTablesOutput = {}; -const stsClient = new AWS.STS(); const getCallerIdentityInput: AWS.STS.GetCallerIdentityRequest = {}; -const getCallerIdentityOutput: AWS.STS.GetCallerIdentityResponse = await stsClient - .getCallerIdentity(getCallerIdentityInput) - .promise(); +const getCallerIdentityOutput: AWS.STS.GetCallerIdentityResponse = {}; -const lambdaClient = new AWS.Lambda(); const invokeInput: AWS.Lambda.InvocationRequest = { FunctionName: "my-function" }; -const invokeOutput: AWS.Lambda.InvocationResponse = await lambdaClient - .invoke(invokeInput) - .promise(); \ No newline at end of file +const invokeOutput: AWS.Lambda.InvocationResponse = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts index 4b9ccc1f6..7e27e829b 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts @@ -1,27 +1,18 @@ import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); -import DynamoDB = AWS_client_dynamodb.DynamoDB; import ListTablesCommandOutput = AWS_client_dynamodb.ListTablesCommandOutput; import ListTablesCommandInput = AWS_client_dynamodb.ListTablesCommandInput; import AWS_client_lambda = require("@aws-sdk/client-lambda"); -import Lambda = AWS_client_lambda.Lambda; import InvokeCommandOutput = AWS_client_lambda.InvokeCommandOutput; import InvokeCommandInput = AWS_client_lambda.InvokeCommandInput; import AWS_client_sts = require("@aws-sdk/client-sts"); -import STS = AWS_client_sts.STS; import GetCallerIdentityCommandOutput = AWS_client_sts.GetCallerIdentityCommandOutput; import GetCallerIdentityCommandInput = AWS_client_sts.GetCallerIdentityCommandInput; -const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; -const listTablesOutput: ListTablesCommandOutput = await ddbClient - .listTables(listTablesInput); +const listTablesOutput: ListTablesCommandOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; -const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient - .getCallerIdentity(getCallerIdentityInput); +const getCallerIdentityOutput: GetCallerIdentityCommandOutput = {}; -const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; -const invokeOutput: InvokeCommandOutput = await lambdaClient - .invoke(invokeInput); \ No newline at end of file +const invokeOutput: InvokeCommandOutput = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts index 77b97a50a..0551fca40 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts @@ -1,19 +1,10 @@ import AWS from "aws-sdk"; -const ddbClient = new AWS.DynamoDB(); const listTablesInput: AWS.DynamoDB.ListTablesInput = { Limit: 10 }; -const listTablesOutput: AWS.DynamoDB.ListTablesOutput = await ddbClient - .listTables(listTablesInput) - .promise(); +const listTablesOutput: AWS.DynamoDB.ListTablesOutput = {}; -const stsClient = new AWS.STS(); const getCallerIdentityInput: AWS.STS.GetCallerIdentityRequest = {}; -const getCallerIdentityOutput: AWS.STS.GetCallerIdentityResponse = await stsClient - .getCallerIdentity(getCallerIdentityInput) - .promise(); +const getCallerIdentityOutput: AWS.STS.GetCallerIdentityResponse = {}; -const lambdaClient = new AWS.Lambda(); const invokeInput: AWS.Lambda.InvocationRequest = { FunctionName: "my-function" }; -const invokeOutput: AWS.Lambda.InvocationResponse = await lambdaClient - .invoke(invokeInput) - .promise(); +const invokeOutput: AWS.Lambda.InvocationResponse = {}; diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts index 606d75fce..68a28fb27 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts @@ -1,18 +1,12 @@ -import { DynamoDB, ListTablesCommandInput, ListTablesCommandOutput } from "@aws-sdk/client-dynamodb"; -import { InvokeCommandInput, InvokeCommandOutput, Lambda } from "@aws-sdk/client-lambda"; -import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; +import { ListTablesCommandInput, ListTablesCommandOutput } from "@aws-sdk/client-dynamodb"; +import { InvokeCommandInput, InvokeCommandOutput } from "@aws-sdk/client-lambda"; +import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "@aws-sdk/client-sts"; -const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; -const listTablesOutput: ListTablesCommandOutput = await ddbClient - .listTables(listTablesInput); +const listTablesOutput: ListTablesCommandOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; -const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient - .getCallerIdentity(getCallerIdentityInput); +const getCallerIdentityOutput: GetCallerIdentityCommandOutput = {}; -const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; -const invokeOutput: InvokeCommandOutput = await lambdaClient - .invoke(invokeInput); \ No newline at end of file +const invokeOutput: InvokeCommandOutput = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts index e70093f19..e9679ac2f 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts @@ -2,20 +2,11 @@ import DynamoDB = require("aws-sdk/clients/dynamodb"); import Lambda = require("aws-sdk/clients/lambda"); import STS = require("aws-sdk/clients/sts"); -const ddbClient = new DynamoDB(); const listTablesInput: DynamoDB.ListTablesInput = { Limit: 10 }; -const listTablesOutput: DynamoDB.ListTablesOutput = await ddbClient - .listTables(listTablesInput) - .promise(); +const listTablesOutput: DynamoDB.ListTablesOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: STS.GetCallerIdentityRequest = {}; -const getCallerIdentityOutput: STS.GetCallerIdentityResponse = await stsClient - .getCallerIdentity(getCallerIdentityInput) - .promise(); +const getCallerIdentityOutput: STS.GetCallerIdentityResponse = {}; -const lambdaClient = new Lambda(); const invokeInput: Lambda.InvocationRequest = { FunctionName: "my-function" }; -const invokeOutput: Lambda.InvocationResponse = await lambdaClient - .invoke(invokeInput) - .promise(); \ No newline at end of file +const invokeOutput: Lambda.InvocationResponse = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts index 4b9ccc1f6..7e27e829b 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts @@ -1,27 +1,18 @@ import AWS_client_dynamodb = require("@aws-sdk/client-dynamodb"); -import DynamoDB = AWS_client_dynamodb.DynamoDB; import ListTablesCommandOutput = AWS_client_dynamodb.ListTablesCommandOutput; import ListTablesCommandInput = AWS_client_dynamodb.ListTablesCommandInput; import AWS_client_lambda = require("@aws-sdk/client-lambda"); -import Lambda = AWS_client_lambda.Lambda; import InvokeCommandOutput = AWS_client_lambda.InvokeCommandOutput; import InvokeCommandInput = AWS_client_lambda.InvokeCommandInput; import AWS_client_sts = require("@aws-sdk/client-sts"); -import STS = AWS_client_sts.STS; import GetCallerIdentityCommandOutput = AWS_client_sts.GetCallerIdentityCommandOutput; import GetCallerIdentityCommandInput = AWS_client_sts.GetCallerIdentityCommandInput; -const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; -const listTablesOutput: ListTablesCommandOutput = await ddbClient - .listTables(listTablesInput); +const listTablesOutput: ListTablesCommandOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; -const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient - .getCallerIdentity(getCallerIdentityInput); +const getCallerIdentityOutput: GetCallerIdentityCommandOutput = {}; -const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; -const invokeOutput: InvokeCommandOutput = await lambdaClient - .invoke(invokeInput); \ No newline at end of file +const invokeOutput: InvokeCommandOutput = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts index 4e9fe21a4..6d311da54 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts @@ -1,20 +1,11 @@ import { DynamoDB, Lambda, STS } from "aws-sdk"; -const ddbClient = new DynamoDB(); const listTablesInput: DynamoDB.ListTablesInput = { Limit: 10 }; -const listTablesOutput: DynamoDB.ListTablesOutput = await ddbClient - .listTables(listTablesInput) - .promise(); +const listTablesOutput: DynamoDB.ListTablesOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: STS.GetCallerIdentityRequest = {}; -const getCallerIdentityOutput: STS.GetCallerIdentityResponse = await stsClient - .getCallerIdentity(getCallerIdentityInput) - .promise(); +const getCallerIdentityOutput: STS.GetCallerIdentityResponse = {}; -const lambdaClient = new Lambda(); const invokeInput: Lambda.InvocationRequest = { FunctionName: "my-function" }; -const invokeOutput: Lambda.InvocationResponse = await lambdaClient - .invoke(invokeInput) - .promise(); +const invokeOutput: Lambda.InvocationResponse = {}; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts index 606d75fce..68a28fb27 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts @@ -1,18 +1,12 @@ -import { DynamoDB, ListTablesCommandInput, ListTablesCommandOutput } from "@aws-sdk/client-dynamodb"; -import { InvokeCommandInput, InvokeCommandOutput, Lambda } from "@aws-sdk/client-lambda"; -import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; +import { ListTablesCommandInput, ListTablesCommandOutput } from "@aws-sdk/client-dynamodb"; +import { InvokeCommandInput, InvokeCommandOutput } from "@aws-sdk/client-lambda"; +import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "@aws-sdk/client-sts"; -const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; -const listTablesOutput: ListTablesCommandOutput = await ddbClient - .listTables(listTablesInput); +const listTablesOutput: ListTablesCommandOutput = {}; -const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; -const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient - .getCallerIdentity(getCallerIdentityInput); +const getCallerIdentityOutput: GetCallerIdentityCommandOutput = {}; -const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; -const invokeOutput: InvokeCommandOutput = await lambdaClient - .invoke(invokeInput); \ No newline at end of file +const invokeOutput: InvokeCommandOutput = {}; \ No newline at end of file From 4716cc70392b5deba495bcae00aec36b8aa5ceec Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:17:37 -0700 Subject: [PATCH 6/7] test: remove misc/unsupported-type-import --- .../__fixtures__/misc/unsupported-type-import.input.ts | 3 --- .../__fixtures__/misc/unsupported-type-import.output.ts | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.input.ts delete mode 100644 src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.output.ts diff --git a/src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.input.ts deleted file mode 100644 index 99199e845..000000000 --- a/src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.input.ts +++ /dev/null @@ -1,3 +0,0 @@ -// ToDo: Update when transformation is added. -// Current test verifies error is not thrown. -import { ListTablesInputLimit } from "aws-sdk/clients/dynamodb"; \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.output.ts deleted file mode 100644 index 99199e845..000000000 --- a/src/transforms/v2-to-v3/__fixtures__/misc/unsupported-type-import.output.ts +++ /dev/null @@ -1,3 +0,0 @@ -// ToDo: Update when transformation is added. -// Current test verifies error is not thrown. -import { ListTablesInputLimit } from "aws-sdk/clients/dynamodb"; \ No newline at end of file From 5839dca3105bfa0495af934747443930ba599413 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:18:42 -0700 Subject: [PATCH 7/7] chore: yarn changeset --- .changeset/hot-dancers-count.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hot-dancers-count.md diff --git a/.changeset/hot-dancers-count.md b/.changeset/hot-dancers-count.md new file mode 100644 index 000000000..9d6eb63a2 --- /dev/null +++ b/.changeset/hot-dancers-count.md @@ -0,0 +1,5 @@ +--- +"aws-sdk-js-codemod": patch +--- + +Transform types imported without clients