/** * User Types * * Types for user management. */ import type { Grade, GUIDRef, GUIDRefBase, Role, Status } from './base'; /** * User identifier (external ID). */ export interface UserId { type: string; identifier: string; } /** * User role assignment. */ export interface UserRole { roleType: 'primary' | 'secondary'; role: Role; org: GUIDRefBase; userProfile?: string; metadata?: Record | null; beginDate?: string | null; endDate?: string | null; } /** * Application credentials for a user. */ export interface UserCredential { id: string; type: string; username: string; password?: string | null; } /** * Application info within a user profile. */ export interface UserApp { sourcedId: string; name: string; description?: string | null; domain: string[]; metadata?: Record | null; } /** * User profile for an application. */ export interface UserProfile { profileId: string; profileType: string; vendorId: string; applicationId: string; description?: string | null; app: UserApp; credentials: UserCredential[]; } /** * Primary organization reference. */ export interface PrimaryOrg { sourcedId: string; name: string; } /** * Biological sex, mirroring the server's `GenderSchema`. */ export type DemographicsSex = 'male' | 'female' | 'other' | 'unspecified'; /** * Stringified boolean demographics flag, mirroring the server's * `booleanToString()` output. */ export type DemographicsFlag = 'true' | 'false'; /** * Student demographics. * * Fields mirror the server's `DemographicsSchema` from * `beyond-timeback-api-2/src/modules/demographics/schema.ts`. The race and * ethnicity flags are emitted as the literal strings `"true"` / `"false"` (not * booleans) after the server converts its boolean database columns via * `booleanToString()`. Unlike the other nullable fields, those flags are * always present when a demographics object exists because the serializer * falls back to `"false"` when the DB value is `null`. Other nullable fields * may be omitted after the server's `sanitizeData` strips `null` values. */ export interface Demographics { sourcedId: string; status: Status; dateLastModified: string; metadata?: Record | null; /** ISO-8601 date (YYYY-MM-DD). */ birthDate?: string | null; sex?: DemographicsSex | null; americanIndianOrAlaskaNative: DemographicsFlag; asian: DemographicsFlag; blackOrAfricanAmerican: DemographicsFlag; nativeHawaiianOrOtherPacificIslander: DemographicsFlag; white: DemographicsFlag; demographicRaceTwoOrMoreRaces: DemographicsFlag; hispanicOrLatinoEthnicity: DemographicsFlag; countryOfBirthCode?: string | null; stateOfBirthAbbreviation?: string | null; cityOfBirth?: string | null; publicSchoolResidenceStatus?: string | null; } /** * A user in the system. * * Fields mirror the server's `UserSchema` / `synthesizeUser` output from * `beyond-timeback-api-2/src/modules/users/schema.ts`. Nullability tracks * `.nullable()` / `.optional()` on the server schema. */ export interface User { sourcedId: string; status: Status; dateLastModified: string; metadata?: Record | null; userMasterIdentifier?: string | null; username?: string | null; userIds: UserId[]; enabledUser: boolean; givenName: string; familyName: string; middleName?: string | null; roles: UserRole[]; agents: GUIDRef[]; userProfiles: UserProfile[]; primaryOrg?: PrimaryOrg; identifier?: string | null; email: string; preferredFirstName?: string | null; preferredMiddleName?: string | null; preferredLastName?: string | null; pronouns?: string | null; grades?: Grade[]; password?: string | null; sms?: string | null; phone?: string | null; /** * Student demographics, when present. Typically only populated for users * with the `student` role. Absent when the underlying record is null. * * NOTE: the server's `synthesizeUser` also attempts to attach a `resources` * array, but `resources` is not declared on the server's `UserSchema` and * is therefore stripped by Zod's default strip mode before the response is * sent. Consumers that need a user's resources should query them via a * dedicated resources endpoint. */ demographics?: Demographics | null; } //# sourceMappingURL=users.d.ts.map