diff options
Diffstat (limited to 'server/sonar-web/src/main/js/api/components.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/components.ts | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index 361713b815d..42e3b05ea6e 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -150,7 +150,32 @@ export function getMyProjects(data: RequestData): Promise<any> { return getJSON(url, data); } -export function searchProjects(data: RequestData): Promise<any> { +export interface Paging { + pageIndex: number; + pageSize: number; + total: number; +} + +export interface Component { + organization: string; + id: string; + key: string; + name: string; + isFavorite?: boolean; + analysisDate?: string; + tags: string[]; + visibility: string; + leakPeriodDate?: string; +} + +export interface Facet { + property: string; + values: Array<{ val: string; count: number }>; +} + +export function searchProjects( + data: RequestData +): Promise<{ components: Component[]; facets: Facet[]; paging: Paging }> { const url = '/api/components/search_projects'; return getJSON(url, data); } |