Update flag endpoints

This commit is contained in:
Andrew Kingston 2024-12-10 12:52:53 +00:00
parent 7b01d3cd03
commit 686273048e
No known key found for this signature in database
1 changed files with 9 additions and 5 deletions

View File

@ -1,12 +1,16 @@
import { Flags, SetUserFlagRequest, SetUserFlagResponse } from "@budibase/types" import {
Flags,
GetUserFlagsResponse,
SetUserFlagRequest,
SetUserFlagResponse,
ToggleBetaFeatureResponse,
} from "@budibase/types"
import { BaseAPIClient } from "./types" import { BaseAPIClient } from "./types"
export interface FlagEndpoints { export interface FlagEndpoints {
getFlags: () => Promise<Flags> getFlags: () => Promise<GetUserFlagsResponse>
// Missing request or response types
updateFlag: (flag: string, value: any) => Promise<SetUserFlagResponse> updateFlag: (flag: string, value: any) => Promise<SetUserFlagResponse>
toggleUiFeature: (value: string) => Promise<{ message: string }> toggleUiFeature: (value: string) => Promise<ToggleBetaFeatureResponse>
} }
export const buildFlagEndpoints = (API: BaseAPIClient): FlagEndpoints => ({ export const buildFlagEndpoints = (API: BaseAPIClient): FlagEndpoints => ({