import client from './client' export interface KeyFieldEntry { profile: string fields: Record missing: number } export interface KeyListResponse { data: KeyFieldEntry[] } export interface OverwriteResult { profile: string success: boolean } export interface OverwriteResponse { results: OverwriteResult[] } export interface ScanResult { profile: string missing: string[] missing_count: number total: number } export interface ScanResponse { results: ScanResult[] } export interface DiffRow { field: string [profile: string]: string | number } export interface DiffResponse { profiles: string[] rows: DiffRow[] } export const getKeys = (profiles?: string) => client.get('/keys', { params: profiles ? { profiles } : {} }) export const batchOverwrite = (body: { profile_names: string[] key_name: string new_value: string confirmation: string }) => client.post('/keys/batch-overwrite', body) export const batchScan = (profile_names?: string[]) => client.post('/keys/batch-scan', { profile_names }) export const getDiff = (profiles: string) => client.get('/keys/diff', { params: { profiles } }) export const exportCsv = (profiles?: string) => client.get('/keys/export', { params: profiles ? { profiles } : {}, responseType: 'text', }) export const WHITELIST_FIELDS = [ 'DEEPSEEK_API_KEY', 'OPENAI_API_KEY', 'ANTHROPIC_API_KEY', 'GOOGLE_API_KEY', 'FEISHU_APP_ID', 'FEISHU_APP_SECRET', ]