// YouTube API quota usage: the signed-in user's own totals and the admin cross-user view. // Only touches core's req. import { req } from "./core"; export interface MyUsage { today: number; last_7d: number; last_30d: number; all_time: number; by_action: Record; } export interface AdminQuotaRow { user_id: number | null; email: string; total: number; by_action: Record; } export interface AdminQuota { range_days: number; rows: AdminQuotaRow[]; daily: { day: string; total: number }[]; } export const quotaApi = { myUsage: (): Promise => req("/api/quota/my-usage"), adminQuota: (days = 30): Promise => req(`/api/quota/admin?days=${days}`), };