@@ -98,7 +98,7 @@ import {
98
98
import { SsoConnection } from '../../auth/connection'
99
99
import { DevSettings } from '../settings'
100
100
import { getServiceEnvVarConfig } from '../vscode/env'
101
- import { AwsCommand } from '../awsClientBuilderV3'
101
+ import { AwsCommand , AwsCommandConstructor } from '../awsClientBuilderV3'
102
102
import { ClientWrapper } from './clientWrapper'
103
103
import { ServiceException } from '@aws-sdk/smithy-client'
104
104
import { AccessDeniedException } from '@aws-sdk/client-sso-oidc'
@@ -218,6 +218,7 @@ function createCodeCatalystClient(
218
218
regionCode : string ,
219
219
endpoint : string
220
220
) : CodeCatalystSDKClient {
221
+ // Avoid using cached client so that we can inject fresh bearer token provider.
221
222
return globals . sdkClientBuilderV3 . createAwsService ( {
222
223
serviceClient : CodeCatalystSDKClient ,
223
224
clientOptions : {
@@ -276,7 +277,7 @@ export async function createClient(
276
277
277
278
// TODO: move this to sso auth folder?
278
279
function getTokenProvider ( connection : SsoConnection ) : TokenIdentityProvider {
279
- return async ( _props ) => {
280
+ return async ( _ ) => {
280
281
const token = await connection . getToken ( )
281
282
return {
282
283
token : token . accessToken ,
@@ -322,7 +323,7 @@ class CodeCatalystClientInternal extends ClientWrapper<CodeCatalystSDKClient> {
322
323
this . log = logger . getLogger ( )
323
324
}
324
325
325
- protected override getClient ( ignoreCache ?: boolean ) : CodeCatalystSDKClient {
326
+ protected override getClient ( ) : CodeCatalystSDKClient {
326
327
return this . sdkClientV3
327
328
}
328
329
@@ -340,7 +341,7 @@ class CodeCatalystClientInternal extends ClientWrapper<CodeCatalystSDKClient> {
340
341
CommandOptions extends CommandInput ,
341
342
Command extends AwsCommand < CommandInput , CommandOutput > ,
342
343
> (
343
- cmd : new ( o : CommandInput ) => Command ,
344
+ cmd : AwsCommandConstructor < CommandInput , Command > ,
344
345
commandOptions : CommandOptions ,
345
346
silent : true ,
346
347
defaultVal : CommandOutput
@@ -350,14 +351,18 @@ class CodeCatalystClientInternal extends ClientWrapper<CodeCatalystSDKClient> {
350
351
CommandOutput extends object ,
351
352
CommandOptions extends CommandInput ,
352
353
Command extends AwsCommand < CommandInput , CommandOutput > ,
353
- > ( cmd : new ( o : CommandInput ) => Command , commandOptions : CommandOptions , silent : false ) : Promise < CommandOutput >
354
+ > (
355
+ cmd : AwsCommandConstructor < CommandInput , Command > ,
356
+ commandOptions : CommandOptions ,
357
+ silent : false
358
+ ) : Promise < CommandOutput >
354
359
private async call <
355
360
CommandInput extends object ,
356
361
CommandOutput extends object ,
357
362
CommandOptions extends CommandInput ,
358
363
Command extends AwsCommand < CommandInput , CommandOutput > ,
359
364
> (
360
- cmd : new ( o : CommandInput ) => Command ,
365
+ cmd : AwsCommandConstructor < CommandInput , Command > ,
361
366
commandOptions : CommandOptions ,
362
367
silent : boolean ,
363
368
defaultVal ?: CommandOutput
0 commit comments