import { apiGet, apiPut } from './client';

export interface MacSyncSettings {
  serverURL: string;
  webServerPort: number;
  serviceToken?: string;
  deviceName?: string;
  imessageOwnAddresses?: string[];
  imailOwnAddresses?: string[];
}

export function getSettings(): Promise<MacSyncSettings> {
  return apiGet<MacSyncSettings>('/api/settings');
}

export function putSettings(updates: Partial<MacSyncSettings>): Promise<MacSyncSettings> {
  return apiPut<MacSyncSettings>('/api/settings', updates);
}
