Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/codecatalyst/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Ides } from 'aws-sdk/clients/codecatalyst'
import { Ide } from '@aws-sdk/client-codecatalyst'
import * as vscode from 'vscode'
import { CodeCatalystResource, getCodeCatalystConfig } from '../shared/clients/codecatalystClient'
import { pushIf } from '../shared/utilities/collectionUtils'
Expand Down Expand Up @@ -55,6 +55,6 @@ export function openCodeCatalystUrl(o: CodeCatalystResource) {
}

/** Returns true if the dev env has a "vscode" IDE runtime. */
export function isDevenvVscode(ides: Ides | undefined): boolean {
export function isDevenvVscode(ides: Ide[] | undefined): boolean {
return ides !== undefined && ides.some((ide) => ide.name === 'VSCode')
}
2 changes: 1 addition & 1 deletion packages/core/src/codecatalyst/vue/create/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { CancellationError } from '../../../shared/utilities/timeoutUtils'
import { telemetry } from '../../../shared/telemetry/telemetry'
import { isNonNullable } from '../../../shared/utilities/tsUtils'
import { createOrgPrompter, createProjectPrompter } from '../../wizards/selectResource'
import { GetSourceRepositoryCloneUrlsRequest } from 'aws-sdk/clients/codecatalyst'
import { GetSourceRepositoryCloneUrlsRequest } from '@aws-sdk/client-codecatalyst'
import { QuickPickPrompter } from '../../../shared/ui/pickerPrompter'

interface LinkedResponse {
Expand Down
21 changes: 10 additions & 11 deletions packages/core/src/shared/clients/codecatalystClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ import {
} from '../utilities/tsUtils'
import { AsyncCollection, toCollection } from '../utilities/asyncCollection'
import { joinAll, pageableToCollection } from '../utilities/collectionUtils'
import { CodeCatalyst } from 'aws-sdk'
import { ToolkitError } from '../errors'
import { Uri } from 'vscode'
import { GetSourceRepositoryCloneUrlsRequest } from 'aws-sdk/clients/codecatalyst'
import {
CodeCatalystClient as CodeCatalystSDKClient,
CreateAccessTokenCommand,
Expand All @@ -53,15 +51,18 @@ import {
GetProjectCommandOutput,
GetProjectRequest,
GetSourceRepositoryCloneUrlsCommand,
GetSourceRepositoryCloneUrlsRequest,
GetSourceRepositoryCloneUrlsResponse,
GetSpaceCommand,
GetSpaceCommandOutput,
GetSpaceRequest,
GetSubscriptionCommand,
GetSubscriptionRequest,
GetSubscriptionResponse,
GetUserDetailsCommand,
GetUserDetailsCommandOutput,
GetUserDetailsRequest,
GetUserDetailsResponse,
ListDevEnvironmentsCommand,
ListDevEnvironmentsRequest,
ListDevEnvironmentsResponse,
Expand All @@ -73,6 +74,7 @@ import {
ListSourceRepositoriesRequest,
ListSourceRepositoriesResponse,
ListSourceRepositoryBranchesCommand,
ListSourceRepositoryBranchesItem,
ListSourceRepositoryBranchesRequest,
ListSpacesCommand,
ListSpacesRequest,
Expand Down Expand Up @@ -152,14 +154,14 @@ export interface DevEnvironment extends CodeCatalystDevEnvironmentSummary {

/** CodeCatalyst developer environment session. */
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface CodeCatalystDevEnvSession extends CodeCatalyst.StartDevEnvironmentResponse {}
export interface CodeCatalystDevEnvSession extends StartDevEnvironmentResponse {}

export interface CodeCatalystOrg extends SpaceSummary {
readonly type: 'org'
readonly name: string
}

export interface CodeCatalystProject extends CodeCatalyst.ProjectSummary {
export interface CodeCatalystProject extends ProjectSummary {
readonly type: 'project'
readonly name: string
readonly org: Pick<CodeCatalystOrg, 'name'>
Expand All @@ -172,7 +174,7 @@ export interface CodeCatalystRepo extends ListSourceRepositoriesItem {
readonly project: Pick<CodeCatalystProject, 'name'>
}

export interface CodeCatalystBranch extends CodeCatalyst.ListSourceRepositoryBranchesItem {
export interface CodeCatalystBranch extends ListSourceRepositoryBranchesItem {
readonly type: 'branch'
readonly name: string
readonly repo: Pick<CodeCatalystRepo, 'name'>
Expand Down Expand Up @@ -200,7 +202,7 @@ function toBranch(
org: string,
project: string,
repo: string,
branch: CodeCatalyst.ListSourceRepositoryBranchesItem
branch: ListSourceRepositoryBranchesItem
): CodeCatalystBranch {
assertHasProps(branch, 'name')

Expand Down Expand Up @@ -229,10 +231,7 @@ function createCodeCatalystClient(
})
}

export type UserDetails = RequiredProps<
CodeCatalyst.GetUserDetailsResponse,
'userId' | 'userName' | 'displayName' | 'primaryEmail'
>
export type UserDetails = RequiredProps<GetUserDetailsResponse, 'userId' | 'userName' | 'displayName' | 'primaryEmail'>

// CodeCatalyst client has two variants: 'logged-in' and 'not logged-in'
// The 'not logged-in' variant is a subtype and has restricted functionality
Expand Down Expand Up @@ -421,7 +420,7 @@ class CodeCatalystClientInternal extends ClientWrapper<CodeCatalystSDKClient> {
}
}

public async getSubscription(request: GetSubscriptionRequest): Promise<CodeCatalyst.GetSubscriptionResponse> {
public async getSubscription(request: GetSubscriptionRequest): Promise<GetSubscriptionResponse> {
return this.call(GetSubscriptionCommand, request, false)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/test/shared/sshConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
connectScriptPrefix,
getCodeCatalystSsmEnv,
} from '../../codecatalyst/model'
import { StartDevEnvironmentSessionRequest } from 'aws-sdk/clients/codecatalyst'
import { StartDevEnvironmentSessionRequest } from '@aws-sdk/client-codecatalyst'
import { mkdir, readFile } from 'fs/promises'
import fs from '../../shared/fs/fs'
import { globals } from '../../shared'
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/testE2E/codecatalyst/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import globals from '../../shared/extensionGlobals'
import { CodeCatalystCreateWebview, SourceResponse } from '../../codecatalyst/vue/create/backend'
import { waitUntil } from '../../shared/utilities/timeoutUtils'
import { AccessDeniedException } from '@aws-sdk/client-sso-oidc'
import { GetDevEnvironmentRequest } from 'aws-sdk/clients/codecatalyst'
import { GetDevEnvironmentRequest, _InstanceType } from '@aws-sdk/client-codecatalyst'
import { getTestWindow } from '../../test/shared/vscode/window'
import { patchObject, registerAuthHook, skipTest, using } from '../../test/setupUtil'
import { isExtensionInstalled } from '../../shared/utilities/vsCodeUtils'
Expand All @@ -37,7 +37,6 @@ import {
SsoConnection,
} from '../../auth/connection'
import { hasKey } from '../../shared/utilities/tsUtils'
import { _InstanceType } from '@aws-sdk/client-codecatalyst'

let spaceName: CodeCatalystOrg['name']
let projectName: CodeCatalystProject['name']
Expand Down Expand Up @@ -615,6 +614,9 @@ describe('Test how this codebase uses the CodeCatalyst API', function () {
): Promise<void> {
const result = await waitUntil(
async function () {
if (!devEnv.spaceName || !devEnv.projectName) {
return false
}
const devEnvData = await client.getDevEnvironment({
spaceName: devEnv.spaceName,
projectName: devEnv.projectName,
Expand Down