/** * Users Resource * * Access all users regardless of role. */ import { OneRosterCredentialInput } from '@timeback/types/zod'; import { Paginator } from '../../lib'; import type { z } from 'zod/v4'; import type { AgentInput } from '@timeback/types/zod'; import type { Class, ClassFilterFields, CredentialCreateResponse, DecryptedCredential, ListParamsNoSearch, OneRosterTransportLike, Resource, ResourceFilterFields, StudentsCallable, TeachersCallable, User, UsersCallable } from '../../types'; /** * Scoped resource for operations on a specific user. * * Access via `client.users(userId)`. * * @example * ```typescript * const user = await client.users(userId).get() * const resources = await client.users(userId).resources() * ``` */ export declare class ScopedUserResource { private readonly transport; private readonly basePath; private readonly userId; constructor(transport: OneRosterTransportLike, userId: string); /** * Get the user details. * @returns The user object */ get(): Promise; /** * Check whether this user exists. * @returns True if found, false for 404 */ exists(): Promise; /** * Get the user with their demographic information. * * Returns the user object with the `demographics` field populated. * * @returns The user object with demographics */ demographics(): Promise; /** * List resources for this user. * @param params - Optional `where` clause and pagination parameters * @returns Promise resolving to resource array */ resources(params?: ListParamsNoSearch): Promise; /** * Stream resources with lazy pagination. * @param params - Optional `where` clause and pagination parameters * @returns Paginator for streaming resources */ streamResources(params?: ListParamsNoSearch): Paginator; /** * List classes for this user. * @param params - Optional `where` clause and pagination parameters * @returns Promise resolving to class array */ classes(params?: ListParamsNoSearch): Promise; /** * Stream classes with lazy pagination. * @param params - Optional `where` clause and pagination parameters * @returns Paginator for streaming classes */ streamClasses(params?: ListParamsNoSearch): Paginator; /** * Get users that this user is an agent (guardian/parent) for. * * For example, if this user is a parent, returns their children. * * @returns Array of users this user represents */ agentFor(): Promise; /** * Get agents (guardians/parents) for this user. * * For example, if this user is a student, returns their parents/guardians. * * @returns Array of agent users */ agents(): Promise; /** * Add an agent (guardian/parent) relationship for this user. * * @param data - Agent input with the agent user reference * @returns Promise resolving when complete * @throws {InputValidationError} If agentSourcedId is empty */ addAgent(data: AgentInput): Promise; /** * Remove an agent (guardian/parent) relationship from this user. * * @param agentSourcedId - The sourcedId of the agent to remove * @returns Promise resolving when complete * @throws {InputValidationError} If agentSourcedId is empty */ removeAgent(agentSourcedId: string): Promise; /** * Register credentials for this user for a third-party application. * * @param input - Application name and credentials (username + password) * @returns Response with userProfileId, credentialId, and message * @throws {InputValidationError} If required fields are empty */ registerCredential(input: z.input): Promise; /** * Decrypt a user's credential to retrieve the password. * * @param credentialId - The credential ID to decrypt * @returns Decrypted credential with password * @throws {InputValidationError} If credentialId is empty */ decryptCredential(credentialId: string): Promise; } /** * Create a callable users resource. * @param transport - OneRoster transport instance * @returns Callable resource for users */ export declare function createUsersResource(transport: OneRosterTransportLike): UsersCallable; /** * Scoped resource for operations on a specific student. * * Access via `client.students(studentId)`. * * @example * ```typescript * const student = await client.students(studentId).get() * const classes = await client.students(studentId).classes() * ``` */ export declare class ScopedStudentResource { private readonly transport; private readonly basePath; constructor(transport: OneRosterTransportLike, studentId: string); /** * Get the student details. * @returns The user object */ get(): Promise; /** * Check whether this student exists. * @returns True if found, false for 404 */ exists(): Promise; /** * List classes this student is enrolled in. * @param params - Optional `where` clause and pagination parameters * @returns Promise resolving to class array */ classes(params?: ListParamsNoSearch): Promise; /** * Stream classes with lazy pagination. * @param params - Optional `where` clause and pagination parameters * @returns Paginator for streaming classes */ streamClasses(params?: ListParamsNoSearch): Paginator; } /** * Scoped resource for operations on a specific teacher. * * Access via `client.teachers(teacherId)`. * * @example * ```typescript * const teacher = await client.teachers(teacherId).get() * const classes = await client.teachers(teacherId).classes() * ``` */ export declare class ScopedTeacherResource { private readonly transport; private readonly basePath; constructor(transport: OneRosterTransportLike, teacherId: string); /** * Get the teacher details. * @returns The user object */ get(): Promise; /** * Check whether this teacher exists. * @returns True if found, false for 404 */ exists(): Promise; /** * List classes this teacher is assigned to. * @param params - Optional `where` clause and pagination parameters * @returns Promise resolving to class array */ classes(params?: ListParamsNoSearch): Promise; /** * Stream classes with lazy pagination. * @param params - Optional `where` clause and pagination parameters * @returns Paginator for streaming classes */ streamClasses(params?: ListParamsNoSearch): Paginator; } /** * Create a callable students resource. * @param transport - OneRoster transport instance * @returns Callable resource for students */ export declare function createStudentsResource(transport: OneRosterTransportLike): StudentsCallable; /** * Create a callable teachers resource. * @param transport - OneRoster transport instance * @returns Callable resource for teachers */ export declare function createTeachersResource(transport: OneRosterTransportLike): TeachersCallable; //# sourceMappingURL=users.d.ts.map