Update config endpoints

This commit is contained in:
Andrew Kingston 2024-12-10 12:50:57 +00:00
parent f20c07a146
commit 7b01d3cd03
No known key found for this signature in database
1 changed files with 13 additions and 14 deletions

View File

@ -1,30 +1,29 @@
import { import {
Config, Config,
ConfigChecklistResponse,
ConfigType, ConfigType,
DeleteConfigResponse,
FindConfigResponse,
GetPublicOIDCConfigResponse, GetPublicOIDCConfigResponse,
GetPublicSettingsResponse, GetPublicSettingsResponse,
OIDCLogosConfig, OIDCLogosConfig,
SaveConfigRequest,
SaveConfigResponse,
UploadConfigFileResponse,
} from "@budibase/types" } from "@budibase/types"
import { BaseAPIClient } from "./types" import { BaseAPIClient } from "./types"
export interface ConfigEndpoints { export interface ConfigEndpoints {
getConfig: <T>(type: ConfigType) => Promise<Config<T>> getConfig: (type: ConfigType) => Promise<FindConfigResponse>
getTenantConfig: (tentantId: string) => Promise<GetPublicSettingsResponse> getTenantConfig: (tentantId: string) => Promise<GetPublicSettingsResponse>
getOIDCConfig: (tenantId: string) => Promise<GetPublicOIDCConfigResponse> getOIDCConfig: (tenantId: string) => Promise<GetPublicOIDCConfigResponse>
getOIDCLogos: () => Promise<Config<OIDCLogosConfig>> getOIDCLogos: () => Promise<Config<OIDCLogosConfig>>
saveConfig: (config: SaveConfigRequest) => Promise<SaveConfigResponse>
// Missing request or response types deleteConfig: (id: string, rev: string) => Promise<DeleteConfigResponse>
saveConfig: <T>( getChecklist: (tenantId: string) => Promise<ConfigChecklistResponse>
config: Config<T> uploadLogo: (data: any) => Promise<UploadConfigFileResponse>
) => Promise<{ type: ConfigType; _id: string; _rev: string }> uploadFavicon: (data: any) => Promise<UploadConfigFileResponse>
deleteConfig: (id: string, rev: string) => Promise<{ message: string }> uploadOIDCLogo: (name: string, data: any) => Promise<UploadConfigFileResponse>
getChecklist: (tenantId: string) => Promise<any>
uploadLogo: (data: any) => Promise<{ message: string; url: string }>
uploadFavicon: (data: any) => Promise<{ message: string; url: string }>
uploadOIDCLogo: (
name: string,
data: any
) => Promise<{ message: string; url: string }>
} }
export const buildConfigEndpoints = (API: BaseAPIClient): ConfigEndpoints => ({ export const buildConfigEndpoints = (API: BaseAPIClient): ConfigEndpoints => ({