Update types for datasource endpoints

This commit is contained in:
Andrew Kingston 2024-12-05 15:29:28 +00:00
parent 7d4974a266
commit 78f1690cb9
No known key found for this signature in database
1 changed files with 10 additions and 3 deletions

View File

@ -4,8 +4,10 @@ import {
CreateDatasourceRequest, CreateDatasourceRequest,
CreateDatasourceResponse, CreateDatasourceResponse,
Datasource, Datasource,
DeleteDatasourceResponse,
FetchDatasourceInfoRequest, FetchDatasourceInfoRequest,
FetchDatasourceInfoResponse, FetchDatasourceInfoResponse,
FetchExternalSchemaResponse,
UpdateDatasourceRequest, UpdateDatasourceRequest,
UpdateDatasourceResponse, UpdateDatasourceResponse,
VerifyDatasourceRequest, VerifyDatasourceRequest,
@ -17,7 +19,7 @@ export interface DatasourceEndpoints {
getDatasources: () => Promise<Datasource[]> getDatasources: () => Promise<Datasource[]>
buildDatasourceSchema: ( buildDatasourceSchema: (
datasourceId: string, datasourceId: string,
tablesFilter?: BuildSchemaFromSourceRequest["tablesFilter"] tablesFilter?: string[]
) => Promise<BuildSchemaFromSourceResponse> ) => Promise<BuildSchemaFromSourceResponse>
createDatasource: ( createDatasource: (
data: CreateDatasourceRequest data: CreateDatasourceRequest
@ -25,14 +27,19 @@ export interface DatasourceEndpoints {
updateDatasource: ( updateDatasource: (
datasource: Datasource datasource: Datasource
) => Promise<UpdateDatasourceResponse> ) => Promise<UpdateDatasourceResponse>
deleteDatasource: (id: string, rev: string) => Promise<void> deleteDatasource: (
id: string,
rev: string
) => Promise<DeleteDatasourceResponse>
validateDatasource: ( validateDatasource: (
datasource: Datasource datasource: Datasource
) => Promise<VerifyDatasourceResponse> ) => Promise<VerifyDatasourceResponse>
fetchInfoForDatasource: ( fetchInfoForDatasource: (
datasource: Datasource datasource: Datasource
) => Promise<FetchDatasourceInfoResponse> ) => Promise<FetchDatasourceInfoResponse>
fetchExternalSchema: (datasourceId: string) => Promise<{ schema: string }> fetchExternalSchema: (
datasourceId: string
) => Promise<FetchExternalSchemaResponse>
} }
export const buildDatasourceEndpoints = ( export const buildDatasourceEndpoints = (