All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
14 lines
1.4 KiB
TypeScript
14 lines
1.4 KiB
TypeScript
import { api } from './http-client'
|
|
|
|
export interface AppConfigItem { id: string; key: string; value: string; description: string | null; environment: string; updatedAt: string }
|
|
export interface FeatureFlagItem { id: string; name: string; enabled: boolean; description: string | null; rolloutPct: number; whitelist?: string | null }
|
|
export interface ChangeLogItem { id: string; entityType: string; entityId: string; field: string; oldValue: string | null; newValue: string | null; changedBy: string | null; createdAt: string }
|
|
|
|
export function getConfig(): Promise<{ configs: AppConfigItem[]; flags: FeatureFlagItem[] }> { return api.get('/admin-api/config') }
|
|
export function setConfig(key: string, value: string): Promise<any> { return api.post('/admin-api/config', { key, value }) }
|
|
export function updateConfig(key: string, value: string): Promise<any> { return api.patch(`/admin-api/config/${key}`, { value }) }
|
|
export function deleteConfig(key: string): Promise<any> { return api.delete(`/admin-api/config/${key}`) }
|
|
export function toggleFlag(name: string, enabled: boolean): Promise<any> { return api.post(`/admin-api/config/flags/${name}`, { enabled }) }
|
|
export function setFlagWhitelist(name: string, whitelist: string): Promise<any> { return api.post(`/admin-api/config/flags/${name}`, { whitelist }) }
|
|
export function getChangeLog(): Promise<ChangeLogItem[]> { return api.get('/admin-api/config/changelog') }
|