diff options
Diffstat (limited to 'server/sonar-web/src/main/js/api/fix-suggestions.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/fix-suggestions.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/api/fix-suggestions.ts b/server/sonar-web/src/main/js/api/fix-suggestions.ts index f4e582f343f..e0a7049abc2 100644 --- a/server/sonar-web/src/main/js/api/fix-suggestions.ts +++ b/server/sonar-web/src/main/js/api/fix-suggestions.ts @@ -29,6 +29,17 @@ export interface AiIssue { id: string; } +export type SuggestionServiceStatus = + | 'SUCCESS' + | 'TIMEOUT' + | 'UNAUTHORIZED' + | 'CONNECTION_ERROR' + | 'SERVICE_ERROR'; + +export interface SuggestionServiceStatusCheckResponse { + status: SuggestionServiceStatus; +} + export function getSuggestions(data: FixParam): Promise<SuggestedFix> { return axiosToCatch.post<SuggestedFix>('/api/v2/fix-suggestions/ai-suggestions', data); } @@ -36,3 +47,7 @@ export function getSuggestions(data: FixParam): Promise<SuggestedFix> { export function getFixSuggestionsIssues(data: FixParam): Promise<AiIssue> { return axiosToCatch.get(`/api/v2/fix-suggestions/issues/${data.issueId}`); } + +export function checkSuggestionServiceStatus(): Promise<SuggestionServiceStatusCheckResponse> { + return axiosToCatch.post(`/api/v2/fix-suggestions/service-status-checks`); +} |