-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use v3 client name when input code does not use local name (#594)
- Loading branch information
Showing
22 changed files
with
112 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"aws-sdk-js-codemod": minor | ||
--- | ||
|
||
Use v3 client name when input code does not use local name |
5 changes: 4 additions & 1 deletion
5
scripts/generateNewClientTests/getV3ClientsNewExpressionCode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { CLIENT_NAMES_MAP } from "../../src/transforms/v2-to-v3/config"; | ||
|
||
export const getV3ClientsNewExpressionCode = (clientsToTest: string[]) => { | ||
let content = ``; | ||
for (const clientName of clientsToTest) { | ||
content += `new ${clientName}();\n`; | ||
const clientConstructorName = CLIENT_NAMES_MAP[clientName] ?? clientName; | ||
content += `new ${clientConstructorName}();\n`; | ||
} | ||
return content; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/multiple-declarators/global.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const { | ||
ApplicationDiscoveryService: Discovery | ||
ApplicationDiscoveryService | ||
} = require("@aws-sdk/client-application-discovery-service"), | ||
{ | ||
DynamoDB | ||
} = require("@aws-sdk/client-dynamodb"), | ||
ddbClient = new DynamoDB(), | ||
discoveryClient = new Discovery(); | ||
discoveryClient = new ApplicationDiscoveryService(); | ||
|
||
const ddbResponse = await ddbClient.listTables(); | ||
const discoveryResponse = await discoveryClient.describeAgents(); |
4 changes: 2 additions & 2 deletions
4
src/transforms/v2-to-v3/__fixtures__/multiple-declarators/service-named.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const { | ||
ApplicationDiscoveryService: Discovery | ||
ApplicationDiscoveryService | ||
} = require("@aws-sdk/client-application-discovery-service"), | ||
{ | ||
DynamoDB | ||
} = require("@aws-sdk/client-dynamodb"), | ||
ddbClient = new DynamoDB(), | ||
discoveryClient = new Discovery(); | ||
discoveryClient = new ApplicationDiscoveryService(); | ||
|
||
const ddbResponse = await ddbClient.listTables(); | ||
const discoveryResponse = await discoveryClient.describeAgents(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.