import api from './client' import { downloadBlob } from '../utils/download' export const reportsApi = { get: (runId: string) => api.get(`/reports/${runId}`), download: async (runId: string, format: 'html' | 'json' | 'markdown') => { const ext = format === 'markdown' ? 'md' : format const res = await api.get(`/reports/${runId}/${format}`, { responseType: 'blob' }) downloadBlob(res.data as Blob, `report-${runId.slice(0, 8)}.${ext}`) }, compare: (run1: string, run2: string) => api.get(`/reports/compare`, { params: { run1, run2 } }), }