Download src/lib/api/dashboard.ts from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/lib/api/dashboard.ts
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/src/lib/api/dashboard.ts
-
curl -L -o dashboard.ts https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/src/lib/api/dashboard.ts
1.41 kB
| import { apiGet } from "@/lib/api/client"; | |
| export type DashboardMaterials = { | |
| total: number; | |
| ready: number; | |
| processing: number; | |
| needs_review: number; | |
| }; | |
| export type DashboardSource = { | |
| id: string; | |
| title: string; | |
| subject: string; | |
| status: "ready"; | |
| material_type?: string | null; | |
| source_type?: string | null; | |
| }; | |
| export type DashboardResult = { | |
| id: string; | |
| label: string; | |
| source_title: string; | |
| created_at: string | null; | |
| }; | |
| export type DashboardStudyFocus = { | |
| exam: string | null; | |
| subject: string | null; | |
| time_left: string | null; | |
| goal: string | null; | |
| weak_areas: string[]; | |
| }; | |
| export type DashboardVideoLessons = { | |
| total: number; | |
| ready: number; | |
| in_progress: number; | |
| }; | |
| export type DashboardRecommendedAction = { | |
| kind: "upload" | "wait" | "revise" | "generate" | "practice"; | |
| label: string; | |
| }; | |
| export type StudentDashboard = { | |
| materials: DashboardMaterials; | |
| recent_source: DashboardSource | null; | |
| recent_results: DashboardResult[]; | |
| study_focus: DashboardStudyFocus; | |
| video_lessons: DashboardVideoLessons; | |
| recommended_action: DashboardRecommendedAction; | |
| }; | |
| /** Fetch the aggregated student dashboard snapshot. User-scoped. */ | |
| export async function getStudentDashboard(options?: { | |
| signal?: AbortSignal; | |
| }): Promise<StudentDashboard> { | |
| return apiGet<StudentDashboard>("/dashboard/student", { | |
| signal: options?.signal, | |
| timeoutMs: 15000, | |
| }); | |
| } | |