|
1 | 1 | import { Api } from './api' |
2 | 2 | import * as vscode from 'vscode' |
3 | | -import { OrganizationService } from './api/client' |
| 3 | +import { OrganizationService, Provider } from './api/client' |
4 | 4 | import { CodacyCloud, CodacyCloudState } from './git/CodacyCloud' |
5 | 5 |
|
6 | 6 | const ORGANIZATIONS_ITERATION_LIMIT = 5 |
7 | 7 |
|
8 | | -const findOrganization = async (provider: 'bb' | 'gh' | 'gl', organization: string, cursor?: string) => { |
| 8 | +const findOrganization = async (provider: Provider, organization: string, cursor?: string) => { |
9 | 9 | try { |
10 | 10 | let currentCursor = cursor |
11 | 11 | let hasMore = true |
@@ -45,7 +45,7 @@ const pendingJoinOrganizationStatus = async () => { |
45 | 45 | return CodacyCloudState.HasPendingJoinOrganization |
46 | 46 | } |
47 | 47 |
|
48 | | -export const getRepositoryCodacyCloudStatus = async (provider: 'bb' | 'gh' | 'gl', organization: string) => { |
| 48 | +export const getRepositoryCodacyCloudStatus = async (provider: Provider, organization: string) => { |
49 | 49 | const findOrgResult = await findOrganization(provider, organization) |
50 | 50 | if (!findOrgResult.success) { |
51 | 51 | // Organization not found on Codacy; User needs to add the organization |
@@ -191,11 +191,7 @@ export const addRepository = async (codacyCloud: CodacyCloud) => { |
191 | 191 | } |
192 | 192 | } |
193 | 193 |
|
194 | | -export const checkFirstAnalysisStatus = async ( |
195 | | - provider: 'bb' | 'gh' | 'gl', |
196 | | - organization: string, |
197 | | - repository: string |
198 | | -) => { |
| 194 | +export const checkFirstAnalysisStatus = async (provider: Provider, organization: string, repository: string) => { |
199 | 195 | try { |
200 | 196 | const { data } = await Api.Analysis.getFirstAnalysisOverview(provider, organization, repository) |
201 | 197 | return data |
|
0 commit comments