Skip to content

Commit 91b67f0

Browse files
authored
Add import equals declaration for named imports (#615)
1 parent a01e797 commit 91b67f0

File tree

44 files changed

+307
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+307
-295
lines changed

.changeset/rotten-dragons-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Add import equals declaration for named imports
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { CLIENT_NAMES_MAP } from "../../src/transforms/v2-to-v3/config";
2-
import { getDefaultLocalName } from "../../src/transforms/v2-to-v3/utils";
31
import { CLIENTS_TO_TEST } from "./config";
42
import { getClientNamesSortedByPackageName } from "./getClientNamesSortedByPackageName";
53
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode";
@@ -10,11 +8,7 @@ export const getGlobalImportEqualsOutput = () => {
108

119
content += getV3PackageImportEqualsCode(getClientNamesSortedByPackageName(CLIENTS_TO_TEST));
1210
content += "\n";
13-
content += getV3ClientsNewExpressionCode(
14-
CLIENTS_TO_TEST.map((clientName) =>
15-
[getDefaultLocalName(clientName), CLIENT_NAMES_MAP[clientName]].join(".")
16-
)
17-
);
11+
content += getV3ClientsNewExpressionCode(CLIENTS_TO_TEST);
1812

1913
return content;
2014
};
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { CLIENT_NAMES_MAP } from "../../src/transforms/v2-to-v3/config";
2-
import { getDefaultLocalName } from "../../src/transforms/v2-to-v3/utils";
31
import { CLIENTS_TO_TEST } from "./config";
42
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode";
53
import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode";
@@ -9,11 +7,7 @@ export const getServiceImportEqualsOutput = () => {
97

108
content += getV3PackageImportEqualsCode(CLIENTS_TO_TEST);
119
content += "\n";
12-
content += getV3ClientsNewExpressionCode(
13-
CLIENTS_TO_TEST.map((clientName) =>
14-
[getDefaultLocalName(clientName), CLIENT_NAMES_MAP[clientName]].join(".")
15-
)
16-
);
10+
content += getV3ClientsNewExpressionCode(CLIENTS_TO_TEST);
1711

1812
return content;
1913
};
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
import { getServiceImportEqualsOutput } from "./getServiceImportEqualsOutput";
1+
import { CLIENTS_TO_TEST } from "./config";
2+
import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix";
3+
import { getV3ClientsNewExpressionCode } from "./getV3ClientsNewExpressionCode";
4+
import { getV3PackageImportEqualsCode } from "./getV3PackageImportEqualsCode";
25

3-
export const getServiceImportEqualsWithNameOutput = getServiceImportEqualsOutput;
6+
export const getServiceImportEqualsWithNameOutput = () => {
7+
let content = ``;
8+
9+
content += getV3PackageImportEqualsCode(CLIENTS_TO_TEST, { useLocalSuffix: true });
10+
content += "\n";
11+
content += getV3ClientsNewExpressionCode(CLIENTS_TO_TEST.map(getClientNameWithLocalSuffix));
12+
13+
return content;
14+
};

scripts/generateNewClientTests/getV3PackageImportEqualsCode.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1-
import { CLIENT_NAMES, CLIENT_PACKAGE_NAMES_MAP } from "../../src/transforms/v2-to-v3/config";
1+
import {
2+
CLIENT_NAMES,
3+
CLIENT_NAMES_MAP,
4+
CLIENT_PACKAGE_NAMES_MAP,
5+
} from "../../src/transforms/v2-to-v3/config";
26
import { getDefaultLocalName } from "../../src/transforms/v2-to-v3/utils";
7+
import { getClientNameWithLocalSuffix } from "./getClientNameWithLocalSuffix";
38

4-
export const getV3PackageImportEqualsCode = (clientsToTest: typeof CLIENT_NAMES) => {
9+
export interface V3PackageImportEqualsCodeOptions {
10+
useLocalSuffix?: boolean;
11+
}
12+
13+
export const getV3PackageImportEqualsCode = (
14+
clientsToTest: typeof CLIENT_NAMES,
15+
options?: V3PackageImportEqualsCodeOptions
16+
) => {
517
let content = ``;
18+
const { useLocalSuffix = false } = options || {};
619

720
for (const v2ClientName of clientsToTest) {
821
const v3ClientDefaultLocalName = getDefaultLocalName(v2ClientName);
922
const v3ClientPackageName = `@aws-sdk/${CLIENT_PACKAGE_NAMES_MAP[v2ClientName]}`;
1023
content += `import ${v3ClientDefaultLocalName} = require("${v3ClientPackageName}");\n`;
24+
25+
const v3ClientName = CLIENT_NAMES_MAP[v2ClientName];
26+
const importName = useLocalSuffix ? getClientNameWithLocalSuffix(v2ClientName) : v3ClientName;
27+
content += `import ${importName} = ${[v3ClientDefaultLocalName, v3ClientName].join(".")};\n`;
1128
}
1229

1330
return content;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import AWS_S3 = require("@aws-sdk/client-s3");
2+
import Tag = AWS_S3.Tag;
23

3-
const testTags: AWS_S3.Tag[] = [{ Key: "key", Value: "value" }];
4+
const testTags: Tag[] = [{ Key: "key", Value: "value" }];
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import AWS_S3 = require("@aws-sdk/client-s3");
2+
import Tag = AWS_S3.Tag;
23

3-
const testTags: AWS_S3.Tag[] = [{ Key: "key", Value: "value" }];
4+
const testTags: Tag[] = [{ Key: "key", Value: "value" }];
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
2+
import DynamoDB = AWS_DynamoDB.DynamoDB;
3+
import ListTablesCommandOutput = AWS_DynamoDB.ListTablesCommandOutput;
4+
import ListTablesCommandInput = AWS_DynamoDB.ListTablesCommandInput;
25
import AWS_Lambda = require("@aws-sdk/client-lambda");
6+
import Lambda = AWS_Lambda.Lambda;
7+
import InvokeCommandOutput = AWS_Lambda.InvokeCommandOutput;
8+
import InvokeCommandInput = AWS_Lambda.InvokeCommandInput;
39
import AWS_STS = require("@aws-sdk/client-sts");
10+
import STS = AWS_STS.STS;
11+
import GetCallerIdentityCommandOutput = AWS_STS.GetCallerIdentityCommandOutput;
12+
import GetCallerIdentityCommandInput = AWS_STS.GetCallerIdentityCommandInput;
413

5-
const ddbClient = new AWS_DynamoDB.DynamoDB({ region: "us-west-2" });
6-
const listTablesInput: AWS_DynamoDB.ListTablesCommandInput = { Limit: 10 };
7-
const listTablesOutput: AWS_DynamoDB.ListTablesCommandOutput = await ddbClient
14+
const ddbClient = new DynamoDB({ region: "us-west-2" });
15+
const listTablesInput: ListTablesCommandInput = { Limit: 10 };
16+
const listTablesOutput: ListTablesCommandOutput = await ddbClient
817
.listTables(listTablesInput);
918

10-
const stsClient = new AWS_STS.STS({ region: "us-west-2" });
11-
const getCallerIdentityInput: AWS_STS.GetCallerIdentityCommandInput = {};
12-
const getCallerIdentityOutput: AWS_STS.GetCallerIdentityCommandOutput = await stsClient
19+
const stsClient = new STS({ region: "us-west-2" });
20+
const getCallerIdentityInput: GetCallerIdentityCommandInput = {};
21+
const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient
1322
.getCallerIdentity(getCallerIdentityInput);
1423

15-
const lambdaClient = new AWS_Lambda.Lambda({ region: "us-west-2" });
16-
const invokeInput: AWS_Lambda.InvokeCommandInput = { FunctionName: "my-function" };
17-
const invokeOutput: AWS_Lambda.InvokeCommandOutput = await lambdaClient
24+
const lambdaClient = new Lambda({ region: "us-west-2" });
25+
const invokeInput: InvokeCommandInput = { FunctionName: "my-function" };
26+
const invokeOutput: InvokeCommandOutput = await lambdaClient
1827
.invoke(invokeInput);
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
2+
import DynamoDB = AWS_DynamoDB.DynamoDB;
3+
import ListTablesCommandOutput = AWS_DynamoDB.ListTablesCommandOutput;
4+
import ListTablesCommandInput = AWS_DynamoDB.ListTablesCommandInput;
25
import AWS_Lambda = require("@aws-sdk/client-lambda");
6+
import Lambda = AWS_Lambda.Lambda;
7+
import InvokeCommandOutput = AWS_Lambda.InvokeCommandOutput;
8+
import InvokeCommandInput = AWS_Lambda.InvokeCommandInput;
39
import AWS_STS = require("@aws-sdk/client-sts");
10+
import STS = AWS_STS.STS;
11+
import GetCallerIdentityCommandOutput = AWS_STS.GetCallerIdentityCommandOutput;
12+
import GetCallerIdentityCommandInput = AWS_STS.GetCallerIdentityCommandInput;
413

5-
const ddbClient = new AWS_DynamoDB.DynamoDB({ region: "us-west-2" });
6-
const listTablesInput: AWS_DynamoDB.ListTablesCommandInput = { Limit: 10 };
7-
const listTablesOutput: AWS_DynamoDB.ListTablesCommandOutput = await ddbClient
14+
const ddbClient = new DynamoDB({ region: "us-west-2" });
15+
const listTablesInput: ListTablesCommandInput = { Limit: 10 };
16+
const listTablesOutput: ListTablesCommandOutput = await ddbClient
817
.listTables(listTablesInput);
918

10-
const stsClient = new AWS_STS.STS({ region: "us-west-2" });
11-
const getCallerIdentityInput: AWS_STS.GetCallerIdentityCommandInput = {};
12-
const getCallerIdentityOutput: AWS_STS.GetCallerIdentityCommandOutput = await stsClient
19+
const stsClient = new STS({ region: "us-west-2" });
20+
const getCallerIdentityInput: GetCallerIdentityCommandInput = {};
21+
const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient
1322
.getCallerIdentity(getCallerIdentityInput);
1423

15-
const lambdaClient = new AWS_Lambda.Lambda({ region: "us-west-2" });
16-
const invokeInput: AWS_Lambda.InvokeCommandInput = { FunctionName: "my-function" };
17-
const invokeOutput: AWS_Lambda.InvokeCommandOutput = await lambdaClient
24+
const lambdaClient = new Lambda({ region: "us-west-2" });
25+
const invokeInput: InvokeCommandInput = { FunctionName: "my-function" };
26+
const invokeOutput: InvokeCommandOutput = await lambdaClient
1827
.invoke(invokeInput);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
2+
import DynamoDB = AWS_DynamoDB.DynamoDB;
23

3-
const client = new AWS_DynamoDB.DynamoDB();
4+
const client = new DynamoDB();
45
const data = await client.listTables();
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
2+
import DynamoDB = AWS_DynamoDB.DynamoDB;
23

3-
const client = new AWS_DynamoDB.DynamoDB();
4+
const client = new DynamoDB();
45
const data = await client.listTables();

src/transforms/v2-to-v3/__fixtures__/api-redundant-type/global-import-equals.output.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import AWS_APIGateway = require("@aws-sdk/client-api-gateway");
2+
import MethodSnapshot = AWS_APIGateway.MethodSnapshot;
23
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
4+
import AttributeValue = AWS_DynamoDB.AttributeValue;
35
import AWS_S3 = require("@aws-sdk/client-s3");
6+
import Bucket = AWS_S3.Bucket;
7+
import ChecksumAlgorithm = AWS_S3.ChecksumAlgorithm;
48

59
// Native types
610
const stringType: string = "string";
@@ -18,14 +22,14 @@ const stringArray: Array<string> = ["string1", "string2"];
1822
const booleanArray: Array<boolean> = [true, false];
1923
const numberArray: Array<number> = [123, 456];
2024
const blobArray: Array<Uint8Array> = [new Uint8Array()];
21-
const enumArray: Array<AWS_S3.ChecksumAlgorithm> = ["CRC32"];
22-
const structureArray: Array<AWS_S3.Bucket> = [{ Name: "bucketName" }];
25+
const enumArray: Array<ChecksumAlgorithm> = ["CRC32"];
26+
const structureArray: Array<Bucket> = [{ Name: "bucketName" }];
2327

2428
// Maps
2529
const stringMap: Record<string, string> = { key: "value" };
2630
const booleanMap: Record<string, boolean> = { key: true };
2731
const numberMap: Record<string, number> = { key: 123 };
28-
const structureMap: Record<string, AWS_APIGateway.MethodSnapshot> = { key: { apiKeyRequired: true } };
32+
const structureMap: Record<string, MethodSnapshot> = { key: { apiKeyRequired: true } };
2933

3034
// Nested arrays
3135
const arrayNestedTwice: Array<Array<number>> = [[1, 2], [3, 4]];
@@ -37,12 +41,12 @@ const arrayNestedFour: Array<Array<Array<Array<number>>>> = [
3741

3842
// Nested maps
3943
const mapNestedTwice: Record<string, Record<string, string>> = { key: stringMap };
40-
const mapNestedTwiceStruct: Record<string, Record<string, AWS_APIGateway.MethodSnapshot>> = { key: structureMap };
44+
const mapNestedTwiceStruct: Record<string, Record<string, MethodSnapshot>> = { key: structureMap };
4145

4246
// Nested arrays and maps
4347
const mapOfArrays: Record<string, Array<string>> = { key: ["value"] };
4448
const mapOfMapOfArrays: Record<string, Record<string, Array<string>>> = { key: mapOfArrays };
45-
const mapOfArrayOfMaps: Record<string, Array<Record<string, AWS_DynamoDB.AttributeValue>>> = { key: [{ key: { S:"A" }}] };
49+
const mapOfArrayOfMaps: Record<string, Array<Record<string, AttributeValue>>> = { key: [{ key: { S:"A" }}] };
4650
const mapOfArrayOfArrays: Record<string, Array<Array<number>>> = { key: [[1], [2]] };
4751
const arrayOfMaps: Array<Record<string, string>> = [stringMap];
4852
const arrayOfMapOfArrays: Array<Record<string, Array<string>>> = [mapOfArrays];

src/transforms/v2-to-v3/__fixtures__/api-redundant-type/service-import-equals.output.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import AWS_APIGateway = require("@aws-sdk/client-api-gateway");
2+
import MethodSnapshot = AWS_APIGateway.MethodSnapshot;
23
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
4+
import AttributeValue = AWS_DynamoDB.AttributeValue;
35
import AWS_S3 = require("@aws-sdk/client-s3");
6+
import Bucket = AWS_S3.Bucket;
7+
import ChecksumAlgorithm = AWS_S3.ChecksumAlgorithm;
48

59
// Native types
610
const stringType: string = "string";
@@ -18,14 +22,14 @@ const stringArray: Array<string> = ["string1", "string2"];
1822
const booleanArray: Array<boolean> = [true, false];
1923
const numberArray: Array<number> = [123, 456];
2024
const blobArray: Array<Uint8Array> = [new Uint8Array()];
21-
const enumArray: Array<AWS_S3.ChecksumAlgorithm> = ["CRC32"];
22-
const structureArray: Array<AWS_S3.Bucket> = [{ Name: "bucketName" }];
25+
const enumArray: Array<ChecksumAlgorithm> = ["CRC32"];
26+
const structureArray: Array<Bucket> = [{ Name: "bucketName" }];
2327

2428
// Maps
2529
const stringMap: Record<string, string> = { key: "value" };
2630
const booleanMap: Record<string, boolean> = { key: true };
2731
const numberMap: Record<string, number> = { key: 123 };
28-
const structureMap: Record<string, AWS_APIGateway.MethodSnapshot> = { key: { apiKeyRequired: true } };
32+
const structureMap: Record<string, MethodSnapshot> = { key: { apiKeyRequired: true } };
2933

3034
// Nested arrays
3135
const arrayNestedTwice: Array<Array<number>> = [[1, 2], [3, 4]];
@@ -37,12 +41,12 @@ const arrayNestedFour: Array<Array<Array<Array<number>>>> = [
3741

3842
// Nested maps
3943
const mapNestedTwice: Record<string, Record<string, string>> = { key: stringMap };
40-
const mapNestedTwiceStruct: Record<string, Record<string, AWS_APIGateway.MethodSnapshot>> = { key: structureMap };
44+
const mapNestedTwiceStruct: Record<string, Record<string, MethodSnapshot>> = { key: structureMap };
4145

4246
// Nested arrays and maps
4347
const mapOfArrays: Record<string, Array<string>> = { key: ["value"] };
4448
const mapOfMapOfArrays: Record<string, Record<string, Array<string>>> = { key: mapOfArrays };
45-
const mapOfArrayOfMaps: Record<string, Array<Record<string, AWS_DynamoDB.AttributeValue>>> = { key: [{ key: { S:"A" }}] };
49+
const mapOfArrayOfMaps: Record<string, Array<Record<string, AttributeValue>>> = { key: [{ key: { S:"A" }}] };
4650
const mapOfArrayOfArrays: Record<string, Array<Array<number>>> = { key: [[1], [2]] };
4751
const arrayOfMaps: Array<Record<string, string>> = [stringMap];
4852
const arrayOfMapOfArrays: Array<Record<string, Array<string>>> = [mapOfArrays];
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
2+
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument;
3+
import ScanCommandOutput = AWS_lib_dynamodb.ScanCommandOutput;
4+
import ScanCommandInput = AWS_lib_dynamodb.ScanCommandInput;
25
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
6+
import DynamoDB = AWS_DynamoDB.DynamoDB;
37

4-
const docClient = AWS_lib_dynamodb.DynamoDBDocument.from(new AWS_DynamoDB.DynamoDB({ region: "us-west-2" }));
8+
const docClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" }));
59

6-
const docClientScanInput: AWS_lib_dynamodb.ScanCommandInput = {
10+
const docClientScanInput: ScanCommandInput = {
711
TableName: "TableName"
812
};
913

10-
const docClientScanOutput: AWS_lib_dynamodb.ScanCommandOutput = await docClient
14+
const docClientScanOutput: ScanCommandOutput = await docClient
1115
.scan(docClientScanInput);
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
2+
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument;
3+
import ScanCommandOutput = AWS_lib_dynamodb.ScanCommandOutput;
4+
import ScanCommandInput = AWS_lib_dynamodb.ScanCommandInput;
25
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
6+
import DynDB = AWS_DynamoDB.DynamoDB;
37

4-
const docClient = AWS_lib_dynamodb.DynamoDBDocument.from(new AWS_DynamoDB.DynamoDB({ region: "us-west-2" }));
8+
const docClient = DynamoDBDocument.from(new DynDB({ region: "us-west-2" }));
59

6-
const docClientScanInput: AWS_lib_dynamodb.ScanCommandInput = {
10+
const docClientScanInput: ScanCommandInput = {
711
TableName: "TableName"
812
};
913

10-
const docClientScanOutput: AWS_lib_dynamodb.ScanCommandOutput = await docClient
14+
const docClientScanOutput: ScanCommandOutput = await docClient
1115
.scan(docClientScanInput);
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
2+
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument;
23
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
4+
import DynamoDB = AWS_DynamoDB.DynamoDB;
35

4-
const documentClient = AWS_lib_dynamodb.DynamoDBDocument.from(new AWS_DynamoDB.DynamoDB({ region: "us-west-2" }));
6+
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" }));
57
const response = await documentClient.scan({ TableName: "TABLE_NAME" });
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
2+
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument;
23
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
4+
import DynamoDBClient = AWS_DynamoDB.DynamoDB;
35

4-
const documentClient = AWS_lib_dynamodb.DynamoDBDocument.from(new AWS_DynamoDB.DynamoDB({ region: "us-west-2" }));
6+
const documentClient = DynamoDBDocument.from(new DynamoDBClient({ region: "us-west-2" }));
57
const response = await documentClient.scan({ TableName: "TABLE_NAME" });
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import AWS_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
2+
import DynamoDBDocument = AWS_lib_dynamodb.DynamoDBDocument;
23
import AWS_DynamoDB = require("@aws-sdk/client-dynamodb");
4+
import DynamoDB = AWS_DynamoDB.DynamoDB;
35

4-
const documentClient = AWS_lib_dynamodb.DynamoDBDocument.from(new AWS_DynamoDB.DynamoDB({ region: "us-west-2" }));
6+
const documentClient = DynamoDBDocument.from(new DynamoDB({ region: "us-west-2" }));
57
const response = await documentClient.scan({ TableName: "TABLE_NAME" });

src/transforms/v2-to-v3/__fixtures__/new-client/global-import-equals.output.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33

44

55
import AWS_AccessAnalyzer = require("@aws-sdk/client-accessanalyzer");
6+
import AccessAnalyzer = AWS_AccessAnalyzer.AccessAnalyzer;
67
import AWS_ACM = require("@aws-sdk/client-acm");
8+
import ACM = AWS_ACM.ACM;
79
import AWS_Discovery = require("@aws-sdk/client-application-discovery-service");
10+
import ApplicationDiscoveryService = AWS_Discovery.ApplicationDiscoveryService;
811

9-
new AWS_ACM.ACM();
10-
new AWS_AccessAnalyzer.AccessAnalyzer();
11-
new AWS_Discovery.ApplicationDiscoveryService();
12+
new ACM();
13+
new AccessAnalyzer();
14+
new ApplicationDiscoveryService();

src/transforms/v2-to-v3/__fixtures__/new-client/service-import-equals-with-name.output.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33

44

55
import AWS_ACM = require("@aws-sdk/client-acm");
6+
import ACMClient = AWS_ACM.ACM;
67
import AWS_AccessAnalyzer = require("@aws-sdk/client-accessanalyzer");
8+
import AccessAnalyzerClient = AWS_AccessAnalyzer.AccessAnalyzer;
79
import AWS_Discovery = require("@aws-sdk/client-application-discovery-service");
10+
import DiscoveryClient = AWS_Discovery.ApplicationDiscoveryService;
811

9-
new AWS_ACM.ACM();
10-
new AWS_AccessAnalyzer.AccessAnalyzer();
11-
new AWS_Discovery.ApplicationDiscoveryService();
12+
new ACMClient();
13+
new AccessAnalyzerClient();
14+
new DiscoveryClient();

0 commit comments

Comments
 (0)