import { authFetch } from '$lib/auth/apiClient'; export interface CalendarEvent { id: string; subject: string; start: string; // "HH:MM" end: string; // "HH:MM" body: string; attendees: { name: string; email: string }[]; } export async function fetchCalendarEvents(date: string): Promise { const res = await authFetch(`/api/calendar/events?date=${encodeURIComponent(date)}`); if (!res.ok) throw new Error(`calendar fetch failed: ${res.status}`); return res.json() as Promise; }