Type logs, migrations and other endpoints
This commit is contained in:
parent
20384673f2
commit
99c3955e6d
|
@ -1,4 +1,10 @@
|
|||
export const buildLogsEndpoints = API => ({
|
||||
import { BaseAPIClient } from "./types"
|
||||
|
||||
export interface LogEndpoints {
|
||||
getSystemLogs: () => Promise<any>
|
||||
}
|
||||
|
||||
export const buildLogsEndpoints = (API: BaseAPIClient): LogEndpoints => ({
|
||||
/**
|
||||
* Gets a stream for the system logs.
|
||||
*/
|
|
@ -1,10 +0,0 @@
|
|||
export const buildMigrationEndpoints = API => ({
|
||||
/**
|
||||
* Gets the info about the current app migration
|
||||
*/
|
||||
getMigrationStatus: async () => {
|
||||
return await API.get({
|
||||
url: "/api/migrations/status",
|
||||
})
|
||||
},
|
||||
})
|
|
@ -0,0 +1,18 @@
|
|||
import { BaseAPIClient } from "./types"
|
||||
|
||||
export interface MigrationEndpoints {
|
||||
getMigrationStatus: () => Promise<{ migrated: boolean }>
|
||||
}
|
||||
|
||||
export const buildMigrationEndpoints = (
|
||||
API: BaseAPIClient
|
||||
): MigrationEndpoints => ({
|
||||
/**
|
||||
* Gets the info about the current app migration
|
||||
*/
|
||||
getMigrationStatus: async () => {
|
||||
return await API.get({
|
||||
url: "/api/migrations/status",
|
||||
})
|
||||
},
|
||||
})
|
|
@ -1,4 +1,17 @@
|
|||
export const buildOtherEndpoints = API => ({
|
||||
import { SystemStatusResponse } from "@budibase/types"
|
||||
import { BaseAPIClient } from "./types"
|
||||
|
||||
export interface OtherEndpoints {
|
||||
getSystemStatus: () => Promise<SystemStatusResponse>
|
||||
getBudibaseVersion: () => Promise<string>
|
||||
|
||||
// Missing request or response types
|
||||
getEnvironment: () => Promise<Record<string, any>>
|
||||
getIntegrations: () => Promise<Record<string, any>>
|
||||
getBasePermissions: () => Promise<any[]>
|
||||
}
|
||||
|
||||
export const buildOtherEndpoints = (API: BaseAPIClient): OtherEndpoints => ({
|
||||
/**
|
||||
* Gets the current environment details.
|
||||
*/
|
||||
|
@ -31,7 +44,7 @@ export const buildOtherEndpoints = API => ({
|
|||
*/
|
||||
getBudibaseVersion: async () => {
|
||||
return (
|
||||
await API.get({
|
||||
await API.get<{ version: string }>({
|
||||
url: "/api/dev/version",
|
||||
})
|
||||
).version
|
||||
|
@ -45,14 +58,4 @@ export const buildOtherEndpoints = API => ({
|
|||
url: "/api/permission/builtin",
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if they are part of the budibase beta program.
|
||||
*/
|
||||
checkBetaAccess: async email => {
|
||||
return await API.get({
|
||||
url: `/api/beta/access?email=${email}`,
|
||||
external: true,
|
||||
})
|
||||
},
|
||||
})
|
|
@ -14,6 +14,9 @@ import { FlagEndpoints } from "./flags"
|
|||
import { GroupEndpoints } from "./groups"
|
||||
import { LayoutEndpoints } from "./layouts"
|
||||
import { LicensingEndpoints } from "./licensing"
|
||||
import { LogEndpoints } from "./logs"
|
||||
import { MigrationEndpoints } from "./migrations"
|
||||
import { OtherEndpoints } from "./other"
|
||||
|
||||
export enum HTTPMethod {
|
||||
POST = "POST",
|
||||
|
@ -99,4 +102,7 @@ export type APIClient = BaseAPIClient &
|
|||
FlagEndpoints &
|
||||
GroupEndpoints &
|
||||
LayoutEndpoints &
|
||||
LicensingEndpoints & { [key: string]: any }
|
||||
LicensingEndpoints &
|
||||
LogEndpoints &
|
||||
MigrationEndpoints &
|
||||
OtherEndpoints & { [key: string]: any }
|
||||
|
|
Loading…
Reference in New Issue