/** * Analytics Types * * Types for analytics and reporting endpoints. */ /** * Activity metrics from the API. */ export interface ActivityMetricsData { xpEarned: number; totalQuestions: number; correctQuestions: number; masteredUnits: number; } /** * Time spent metrics from the API. */ export interface TimeSpentMetricsData { activeSeconds: number; inactiveSeconds: number; wasteSeconds: number; } /** * Metrics for a specific subject on a given day. */ export interface SubjectMetrics { activityMetrics: ActivityMetricsData; timeSpentMetrics: TimeSpentMetricsData; apps: string[]; } /** * Activity data grouped by date, then by subject. * * @example * ```typescript * const activity: DailyActivityMap = { * "2025-12-17": { * "FastMath": { * activityMetrics: { xpEarned: 3.4, totalQuestions: 114, ... }, * timeSpentMetrics: { activeSeconds: 0, ... }, * apps: ["Math Raiders"] * } * } * } * ``` */ export type DailyActivityMap = Record>; /** * Activity data grouped by app, then by date, then by subject. */ export type FactsByAppMap = Record>>; /** * A single fact/event record from the weekly facts endpoint. */ export interface WeeklyFactRecord { id: number; email: string; date: string; datetime: string; username?: string; userGrade?: string; userFamilyName?: string; userGivenName?: string; userId?: string; subject?: string; app?: string; courseId?: string; courseName?: string; campusId?: string; campusName?: string; enrollmentId?: string; activityId?: string; activityName?: string; totalQuestions?: number; correctQuestions?: number; xpEarned?: number; masteredUnits?: number; activeSeconds?: string; inactiveSeconds?: string; wasteSeconds?: string; source: string; alphaLevel?: string; generatedAt?: string; sendTime?: string; sensor?: string; eventType?: string; year: number; month: number; day: number; dayOfWeek: number; } /** * Weekly facts is an array of individual fact records. */ export type WeeklyFacts = WeeklyFactRecord[]; /** * Enrollment facts grouped by date, then by subject. * * Same structure as DailyActivityMap - the enrollment endpoint returns * activity data filtered to a specific enrollment. */ export type EnrollmentFacts = DailyActivityMap; /** * Grade mastery data from various sources. */ export interface GradeMasteryData { ritGrade: number | null; edulasticGrade: string | null; placementGrade: string | null; testOutGrade: string | null; highestGradeOverall: string | null; } /** * Highest grade mastered for a subject. */ export interface HighestGradeMastered { studentId: string; subject: string; grades: GradeMasteryData; } /** * Response from the activity endpoint. */ export interface ActivityResponse { message: string; startDate: string; endDate: string; facts: DailyActivityMap; factsByApp: FactsByAppMap; } /** * Response from the weekly facts endpoint. */ export interface WeeklyFactsResponse { message: string; startDate: string; endDate: string; facts: WeeklyFacts; } /** * Response from the enrollment facts endpoint. */ export interface EnrollmentFactsResponse { message: string; enrollmentId: string; startDate?: string; endDate?: string; facts: EnrollmentFacts; factsByApp: FactsByAppMap; } /** * Aggregated metrics across all dates and subjects. * * Use `aggregateActivityMetrics()` to compute this from a DailyActivityMap. */ export interface AggregatedMetrics { totalXp: number; totalQuestions: number; correctQuestions: number; masteredUnits: number; activeSeconds: number; inactiveSeconds: number; wasteSeconds: number; dayCount: number; subjectCount: number; } //# sourceMappingURL=analytics.d.ts.map