import { apiFetch } from "./auth"; export interface DataExportRequest { id: string; status: "PENDING" | "PROCESSING" | "READY" | "FAILED" | "EXPIRED"; downloadUrl: string | null; expiresAt: string | null; completedAt: string | null; createdAt: string; } export interface AccountDeletionRequest { id: string; status: "PENDING" | "SCHEDULED" | "COMPLETED" | "CANCELLED"; scheduledFor: string; completedAt: string | null; createdAt: string; } export async function requestDataExport(): Promise { return apiFetch("/account/compliance/export", { method: "POST", }); } export async function listDataExports(): Promise<{ exports: DataExportRequest[] }> { return apiFetch("/account/compliance/export"); } export async function requestAccountDeletion( confirmEmail: string, ): Promise { return apiFetch("/account/compliance/deletion", { method: "POST", body: JSON.stringify({ confirmEmail }), }); } export async function getAccountDeletionStatus(): Promise { return apiFetch("/account/compliance/deletion"); } export async function cancelAccountDeletion(): Promise { return apiFetch("/account/compliance/deletion", { method: "DELETE", }); }