/** * OneRoster Rostering Types * * Types for rostering entities: users, orgs, courses, classes, enrollments, terms. */ import type { TimebackGrade, TimebackSubject } from '../../primitives'; import type { Base, Ref, RefWithHref } from './base'; import type { OneRosterUserRole, OrganizationType } from './primitives'; /** * An organization such as a school, district, or department. * * Organizations form a hierarchy with parent/child relationships. * Schools are a specific type of organization. */ export interface Organization extends Base { /** Display name of the organization */ name: string; /** Type of organization (school, district, department, etc.) */ type: OrganizationType; /** External identifier (e.g., state school ID) */ identifier?: string; /** Reference to parent organization */ parent?: RefWithHref | null; /** References to child organizations */ children?: RefWithHref[] | null; } /** * An external user identifier from another system. */ export interface UserId { /** Type of identifier (e.g., "SIS", "LDAP") */ type: string; /** The identifier value */ identifier: string; } /** * A role assignment for a user at a specific organization. */ export interface UserRole { /** Whether this is the user's primary or secondary role */ roleType: 'primary' | 'secondary'; /** The role type (student, teacher, administrator, etc.) */ role: OneRosterUserRole; /** The organization where this role applies */ org: RefWithHref; /** Associated user profile identifier */ userProfile?: string; /** Role-specific metadata */ metadata?: Record | null; /** When this role assignment begins */ beginDate?: string | null; /** When this role assignment ends */ endDate?: string | null; } /** @internal */ export interface UserProfileCredential { id: string; type: string; username: string; password?: string | null; } /** @internal */ export interface UserProfileApp { sourcedId: string; name: string; description?: string | null; domain: string[]; metadata?: Record | null; } /** @internal */ export interface UserProfile { profileId: string; profileType: string; vendorId: string; applicationId: string; description?: string | null; app: UserProfileApp; credentials: UserProfileCredential[]; } /** * A user in the OneRoster system. * * Users can be students, teachers, parents, administrators, or other roles. * A user may have multiple roles at different organizations. */ export interface User extends Base { /** Master identifier for cross-system user matching */ userMasterIdentifier?: string | null; /** Login username */ username?: string | null; /** External identifiers from other systems */ userIds?: UserId[]; /** Whether the user account is enabled */ enabledUser: boolean; /** User's first name */ givenName: string; /** User's last name */ familyName: string; /** User's middle name */ middleName?: string | null; /** External identifier */ identifier?: string | null; /** User's email address */ email?: string; /** Role assignments at organizations */ roles: UserRole[]; /** References to related users (e.g., parents for students) */ agents?: RefWithHref[]; /** Application-specific profiles */ userProfiles?: UserProfile[]; /** User's primary organization */ primaryOrg?: RefWithHref & { name?: string | null; }; /** Preferred first name */ preferredFirstName?: string | null; /** Preferred middle name */ preferredMiddleName?: string | null; /** Preferred last name */ preferredLastName?: string | null; /** User's pronouns */ pronouns?: string | null; /** Grade levels associated with the user */ grades?: TimebackGrade[]; /** Password (write-only, not returned in responses) */ password?: string | null; /** SMS phone number */ sms?: string | null; /** Phone number */ phone?: string | null; /** Demographic information */ demographics?: Demographics | null; } /** * Demographic information for a user. * * Contains sensitive PII data including birth date, race, and ethnicity. */ export interface Demographics extends Base { /** Birth date in YYYY-MM-DD format */ birthDate?: string | null; /** Biological sex */ sex?: 'male' | 'female' | 'other' | 'unspecified' | null; americanIndianOrAlaskaNative?: string | null; asian?: string | null; blackOrAfricanAmerican?: string | null; nativeHawaiianOrOtherPacificIslander?: string | null; white?: string | null; demographicRaceTwoOrMoreRaces?: string | null; hispanicOrLatinoEthnicity?: string | null; countryOfBirthCode?: string | null; stateOfBirthAbbreviation?: string | null; cityOfBirth?: string | null; publicSchoolResidenceStatus?: string | null; } /** * Daily learning goals for a course or enrollment. */ export interface CourseGoals { /** Target XP to earn per day */ dailyXp?: number; /** Target lessons to complete per day */ dailyLessons?: number; /** Target active learning minutes per day */ dailyActiveMinutes?: number; /** Target accuracy percentage */ dailyAccuracy?: number; /** Target mastered units per day */ dailyMasteredUnits?: number; } /** * Aggregate metrics for a course. */ export interface CourseMetrics { /** Total XP available in the course */ totalXp?: number; /** Total number of lessons/activities */ totalLessons?: number; /** Total grade levels covered */ totalGrades?: number; /** Course classification type */ courseType?: 'base' | 'hole-filling' | 'optional' | 'Base' | 'Hole-Filling' | 'Optional'; /** Whether this is supplemental content */ isSupplemental?: boolean; } /** * Extended metadata for courses. */ export interface CourseMetadata extends Record { /** Course classification (base, hole-filling, optional) */ courseType?: 'base' | 'hole-filling' | 'optional'; /** Whether this is supplemental content */ isSupplemental?: boolean; /** Whether this is a custom course for a specific student */ isCustom?: boolean; /** Publication status of the course */ publishStatus?: 'draft' | 'testing' | 'published' | 'deactivated'; /** Contact email for course issues */ contactEmail?: string; /** Primary application identifier */ primaryApp?: string; /** Daily learning goals */ goals?: CourseGoals; /** Aggregate metrics */ metrics?: CourseMetrics; } /** * A course in the curriculum. * * Courses define the content to be taught and can have multiple classes * (sections) associated with them. */ export interface Course extends Omit { /** Course-specific metadata */ metadata?: CourseMetadata | null; /** Course title */ title: string; /** Course code (e.g., "MATH101") */ courseCode?: string; /** Grade levels for this course */ grades?: TimebackGrade[]; /** Subject areas */ subjects?: TimebackSubject[]; /** Subject codes */ subjectCodes?: string[]; /** Organization offering this course */ org: Ref; /** Course level (e.g., "AP", "Honors") */ level?: string; /** Grading scheme identifier */ gradingScheme?: string; /** Associated academic session */ academicSession?: Ref; /** School year reference */ schoolYear?: RefWithHref; /** Learning resources for this course */ resources?: RefWithHref[]; } /** * A single item in a QTI-derived course structure. * * Represents metadata about a lesson/skill from QTI test content. */ export interface CourseStructureItem { /** URL to the QTI content */ url: string; /** Skill code identifier */ skillCode: string; /** Lesson code identifier */ lessonCode: string; /** Title of the lesson/skill */ title: string; /** Title of the containing unit */ 'unit-title': string; /** Status of the content */ status: string; /** Experience points value */ xp: number; /** Optional stimulus content */ stimulus?: { title: string; identifier: string; }; /** Optional video content */ video?: { url: string; title: string; }; } /** * A component or module within a course. */ export interface CourseComponent extends Base { /** Display title */ title: string; /** Parent course reference */ course: Ref; /** Nested course component reference */ courseComponent?: Ref | null; /** Parent component reference */ parent?: Ref | null; /** Display order */ sortOrder?: number; /** Prerequisite component IDs */ prerequisites?: string[]; /** Whether all or any prerequisites are required */ prerequisiteCriteria?: 'ALL' | 'ANY'; /** Date when component becomes available */ unlockDate?: string; } /** * A class (section) where students and teachers meet. * * Classes are instances of courses for specific terms and locations. */ export interface Class extends Base { /** Class title */ title: string; /** Class code/section identifier */ classCode?: string | null; /** Type of class */ classType?: 'homeroom' | 'scheduled'; /** Physical location */ location?: string | null; /** Grade levels */ grades?: TimebackGrade[]; /** Subject areas */ subjects?: TimebackSubject[]; /** Subject codes */ subjectCodes?: string[]; /** Period/time slot identifiers */ periods?: string[]; /** Associated terms */ terms?: RefWithHref[]; /** Course this class is a section of */ course?: RefWithHref | null; /** School where this class is held */ school?: RefWithHref | null; /** Learning resources for this class */ resources?: RefWithHref[]; } /** * Goals for an individual enrollment. */ export interface EnrollmentGoals { dailyXp?: number; dailyLessons?: number; dailyActiveMinutes?: number; dailyAccuracy?: number; dailyMasteredUnits?: number; } /** * Metrics for an enrollment. */ export interface EnrollmentMetrics { totalXp?: number; totalLessons?: number; totalGrades?: number; courseType?: string; isSupplemental?: boolean; } /** * Extended metadata for enrollments. */ export interface EnrollmentMetadata extends Record { /** Individual learning goals */ goals?: EnrollmentGoals; /** Progress metrics */ metrics?: EnrollmentMetrics; } /** * An enrollment linking a user to a class. * * Enrollments define the relationship between users and classes, * including their role (student, teacher) and the time period. */ export interface Enrollment extends Omit { /** Enrollment-specific metadata with goals and metrics */ metadata?: EnrollmentMetadata | null; /** The enrolled user */ user: RefWithHref & { name?: string; }; /** The class the user is enrolled in */ class: RefWithHref & { name?: string; }; /** The school */ school: RefWithHref & { name?: string; }; /** The course */ course: RefWithHref & { name?: string; }; /** Role in this enrollment (student, teacher, etc.) */ role: OneRosterUserRole; /** Whether this is the user's primary class ("true"/"false") */ primary?: string | null; /** Start date of enrollment */ beginDate?: string | null; /** End date of enrollment */ endDate?: string | null; } /** * An academic session such as a term, semester, or school year. * * Academic sessions define time periods for scheduling and can be * nested (e.g., terms within a school year). */ export interface AcademicSession extends Base { /** Session title (e.g., "Fall 2024") */ title: string; /** Start date in YYYY-MM-DD format */ startDate: string; /** End date in YYYY-MM-DD format */ endDate: string; /** Type of session */ type: 'gradingPeriod' | 'semester' | 'schoolYear' | 'term'; /** Parent session reference */ parent?: RefWithHref | null; /** School year as a number (e.g., 2024) */ schoolYear: number; /** Organization this session belongs to */ org: RefWithHref; /** Child sessions */ children?: RefWithHref[] | null; } /** * A term within an academic year. * Alias for AcademicSession with type 'term'. */ export type Term = AcademicSession; /** * A grading period within a term or semester. * Alias for AcademicSession with type 'gradingPeriod'. */ export type GradingPeriod = AcademicSession; /** * Response from creating user credentials. */ export interface CredentialCreateResponse { /** The user profile ID */ userProfileId: string; /** The created credential ID */ credentialId: string; /** Status message */ message: string; } /** * Response from decrypting user credentials. */ export interface DecryptedCredential { /** The decrypted password */ password: string; } //# sourceMappingURL=rostering.d.ts.map