Create apis

This commit is contained in:
Adria Navarro 2025-01-02 13:21:36 +01:00
parent 97eb4a2e79
commit 163ca349a9
1 changed files with 28 additions and 7 deletions

View File

@ -19,20 +19,41 @@ interface SearchOptions {
bookmark: null
}
export interface UIFetchAPI {
interface TableAPI {
fetchTableDefinition(tableId: string): Promise<Table>
searchTable(tableId: string, options: SearchOptions): any
}
interface ViewV2API {
fetchDefinition: (datasourceId: string) => Promise<any>
fetch: (datasourceId: string, options: SearchOptions) => any
}
interface UserAPI {
searchUsers: (opts: {
bookmark: null
query:
| SearchFilters
| {
string: {
email: null
}
}
| null
appId: string
paginate: boolean
limit: number
}) => Promise<any>
}
export interface UIFetchAPI extends TableAPI, UserAPI {
definition: UIDatasource
getInitialData: () => Promise<void>
loading: any
loaded: boolean
searchTable(tableId: string, options: SearchOptions): any
viewV2: {
fetchDefinition: (datasourceId: string) => Promise<any>
fetch: (datasourceId: string, options: SearchOptions) => any
}
viewV2: ViewV2API
resetKey: string | null
error: any