Skip to content

Commit 6fe1b48

Browse files
authored
refactor(apigateway): migrate to aws sdk v3 (#8042)
## Problem AWS SDK V2 is at EOL. All clients should migrate to V3. ## Solution Migrate API Gateway client to V3 --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 1eb4a28 commit 6fe1b48

File tree

7 files changed

+9
-14
lines changed

7 files changed

+9
-14
lines changed

packages/core/src/awsService/apigateway/commands/copyUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as picker from '../../../shared/ui/picker'
1111
import * as vscode from 'vscode'
1212
import { ProgressLocation } from 'vscode'
1313

14-
import { Stage } from 'aws-sdk/clients/apigateway'
14+
import { Stage } from '@aws-sdk/client-api-gateway'
1515
import { ApiGatewayClient } from '../../../shared/clients/apiGateway'
1616
import { defaultDnsSuffix, RegionProvider } from '../../../shared/regions/regionProvider'
1717
import { getLogger } from '../../../shared/logger/logger'

packages/core/src/awsService/apigateway/explorer/apiGatewayNodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
1212
import { PlaceholderNode } from '../../../shared/treeview/nodes/placeholderNode'
1313
import { compareTreeItems, makeChildrenNodes } from '../../../shared/treeview/utils'
1414
import { ApiGatewayClient } from '../../../shared/clients/apiGateway'
15-
import { RestApi } from 'aws-sdk/clients/apigateway'
15+
import { RestApi } from '@aws-sdk/client-api-gateway'
1616
import { toArrayAsync, toMap, updateInPlace } from '../../../shared/utilities/collectionUtils'
1717
import { RestApiNode } from './apiNodes'
1818

packages/core/src/awsService/apigateway/explorer/apiNodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { AWSResourceNode } from '../../../shared/treeview/nodes/awsResourceNode'
77
import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
8-
import { RestApi } from 'aws-sdk/clients/apigateway'
8+
import { RestApi } from '@aws-sdk/client-api-gateway'
99

1010
export class RestApiNode extends AWSTreeNodeBase implements AWSResourceNode {
1111
public override id!: string

packages/core/src/awsService/apigateway/vue/invokeRemoteRestApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { RestApiNode } from '../explorer/apiNodes'
88
import { getLogger, Logger } from '../../../shared/logger/logger'
99

1010
import { toArrayAsync } from '../../../shared/utilities/collectionUtils'
11-
import { Resource } from 'aws-sdk/clients/apigateway'
11+
import { Resource } from '@aws-sdk/client-api-gateway'
1212
import { localize } from '../../../shared/utilities/vsCodeUtils'
1313
import { Result } from '../../../shared/telemetry/telemetry'
1414
import { VueWebview } from '../../../webviews/main'

packages/core/src/awsService/appBuilder/explorer/nodes/deployedNode.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import { getLogger } from '../../../../shared/logger/logger'
1313
import { DefaultLambdaClient } from '../../../../shared/clients/lambdaClient'
1414
import globals from '../../../../shared/extensionGlobals'
1515
import { defaultPartition } from '../../../../shared/regions/regionProvider'
16-
import { Lambda, APIGateway } from 'aws-sdk'
16+
import { Lambda } from 'aws-sdk'
17+
import { RestApi } from '@aws-sdk/client-api-gateway'
1718
import { LambdaNode } from '../../../../lambda/explorer/lambdaNodes'
1819
import { LambdaFunctionNode } from '../../../../lambda/explorer/lambdaFunctionNode'
1920
import { S3Client, toBucket } from '../../../../shared/clients/s3'
@@ -118,12 +119,7 @@ export async function generateDeployedNode(
118119
const apiParentNode = new ApiGatewayNode(partitionId, regionCode)
119120
const apiNodes = await apiParentNode.getChildren()
120121
const apiNode = apiNodes.find((node) => node.id === deployedResource.PhysicalResourceId)
121-
newDeployedResource = new RestApiNode(
122-
apiParentNode,
123-
partitionId,
124-
regionCode,
125-
apiNode as APIGateway.RestApi
126-
)
122+
newDeployedResource = new RestApiNode(apiParentNode, partitionId, regionCode, apiNode as RestApi)
127123
break
128124
}
129125
default:

packages/core/src/codewhispererChat/view/connector/connector.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { Timestamp } from 'aws-sdk/clients/apigateway'
76
import { MessagePublisher } from '../../../amazonq/messages/messagePublisher'
87
import { EditorContextCommandType } from '../../commands/registerCommands'
98
import { AuthFollowUpType } from '../../../amazonq/auth/model'
@@ -97,7 +96,7 @@ interface StackOverflowMetadata {
9796
readonly answerCount: number
9897
readonly isAccepted: boolean
9998
readonly score: number
100-
readonly lastActivityDate: Timestamp
99+
readonly lastActivityDate: Date
101100
}
102101

103102
export class SearchView extends UiMessage {

packages/core/src/test/awsService/apigateway/commands/invokeRemoteRestApi.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import assert from 'assert'
77
import { listValidMethods } from '../../../../awsService/apigateway/vue/invokeRemoteRestApi'
8-
import { Resource } from 'aws-sdk/clients/apigateway'
8+
import { Resource } from '@aws-sdk/client-api-gateway'
99

1010
describe('listValidMethods', function () {
1111
const allMethods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT']

0 commit comments

Comments
 (0)