Update other endpoints

This commit is contained in:
Andrew Kingston 2024-12-05 15:38:53 +00:00
parent ca10a21f83
commit 7806eebc20
No known key found for this signature in database
1 changed files with 9 additions and 4 deletions

View File

@ -1,14 +1,19 @@
import { SystemStatusResponse } from "@budibase/types" import {
FetchBuiltinPermissionsRequest,
FetchIntegrationsResponse,
GetVersionResponse,
SystemStatusResponse,
} from "@budibase/types"
import { BaseAPIClient } from "./types" import { BaseAPIClient } from "./types"
export interface OtherEndpoints { export interface OtherEndpoints {
getSystemStatus: () => Promise<SystemStatusResponse> getSystemStatus: () => Promise<SystemStatusResponse>
getBudibaseVersion: () => Promise<string> getBudibaseVersion: () => Promise<string>
getIntegrations: () => Promise<FetchIntegrationsResponse>
getBasePermissions: () => Promise<FetchBuiltinPermissionsRequest>
// Missing request or response types // Missing request or response types
getEnvironment: () => Promise<Record<string, any>> getEnvironment: () => Promise<Record<string, any>>
getIntegrations: () => Promise<Record<string, any>>
getBasePermissions: () => Promise<any[]>
} }
export const buildOtherEndpoints = (API: BaseAPIClient): OtherEndpoints => ({ export const buildOtherEndpoints = (API: BaseAPIClient): OtherEndpoints => ({
@ -44,7 +49,7 @@ export const buildOtherEndpoints = (API: BaseAPIClient): OtherEndpoints => ({
*/ */
getBudibaseVersion: async () => { getBudibaseVersion: async () => {
return ( return (
await API.get<{ version: string }>({ await API.get<GetVersionResponse>({
url: "/api/dev/version", url: "/api/dev/version",
}) })
).version ).version