import type { City } from '../models/City'; import type { Class } from '../models/Class'; import type { Coordinate } from '../models/Coordinate'; import type { Feedback } from '../models/Feedback'; import type { FeedbackComment } from '../models/FeedbackComment'; import type { FeedbackInfo } from '../models/FeedbackInfo'; import type { FeedbackMeta } from '../models/FeedbackMeta'; import type { Limit } from '../models/Limit'; import type { Offset } from '../models/Offset'; import type { RegistrationKeyInfo } from '../models/RegistrationKeyInfo'; import type { Result } from '../models/Result'; import type { Role } from '../models/Role'; import type { School } from '../models/School'; import type { Student } from '../models/Student'; import type { StudentFieldsVisibility } from '../models/StudentFieldsVisibility'; import type { StudentVerbose } from '../models/StudentVerbose'; import type { Visibility } from '../models/Visibility'; export declare class Service { /** * Return a roster containing the students and schools information * @returns any Sucessfully retrieved the roster * @throws ApiError */ static getRoster(): Promise<(Result & { schools: Array<(School & { /** * The unique identifier of the school */ uid: number; students?: Array<(Student & StudentVerbose)>; })>; })>; /** * Handle a login request * @param requestBody * @returns Result Return whether the login is a success * @throws ApiError */ static login(requestBody: ({ password: string; } & ({ /** * When set to true, the identifier will be used as the uid of the student */ use_uid?: boolean; /** * The identifier of the username, which can be the uid, phone number or email */ identifier: string; } | { /** * When set to true, the identifier will be used as the uid of the student */ use_uid?: boolean; /** * The identifier as a student uid */ identifier: number; }))): Promise; /** * Only available in development. Get a list of available users to login * @returns any Successfully return the list of users. * @throws ApiError */ static getDevLogin(): Promise<(Result & { users?: Array<(StudentVerbose & { role: Role; })>; })>; /** * Only available in development. Login using the student with the specified uid, password is not required * @param requestBody * @returns any Return the role of the logged in user * @throws ApiError */ static postDevLogin(requestBody: { /** * The unique identifier of the user */ uid: number; }): Promise<(Result & { role?: Role; })>; /** * Return the information of students. Result is scoped by the user role. For example: a "student" user cannot see others role and visibility settings, but an admin user, like those with the role "class" can. Apart from that, admin users can ignore the visibility settings of the students who are under their administration. * * @param self * @param canUpdateOnly * @param name * @param phoneNumber * @param curriculum * @param city * @param schoolStateProvince * @param schoolCountry * @param limit * @param offset * @returns any Return a list of students * @throws ApiError */ static getStudent(self?: boolean, canUpdateOnly?: boolean, name?: string, phoneNumber?: string, curriculum?: string, city?: string, schoolStateProvince?: string, schoolCountry?: string, limit?: number, offset?: number): Promise<(Result & { students?: Array<(Student & StudentVerbose & School & { role?: Role; visibility?: Visibility; field_visibility?: StudentFieldsVisibility; /** * Indicating whether the current student is the caller */ self?: boolean; })>; })>; /** * Add a new student (registration key is required for new users) * @param requestBody * @returns Result Default response telling whether the request is successful * @throws ApiError */ static postStudent(requestBody: (Student & { name: string; password: string; curriculum?: any; /** * The registration key provided by the maintainer for each class which fills class_number, year, and curriculum for the student */ registration_key: string; } & ({ /** * The registration key provided by the maintainer for each class which fills class_number, year, and curriculum for the student */ registration_key: string; } | { class_number: number; grad_year: number; }))): Promise; /** * Update the information of a student * @param requestBody * @returns Result Default response telling whether the request is successful * @throws ApiError */ static updateStudent(requestBody: (Student & { /** * If not specified, update the current logged in student */ student_uid?: number; visibility?: Visibility; role?: Role; /** * The new password */ password?: string; class_number?: number; grad_year?: number; curriculum?: any; /** * The fields that need to be cleared */ clear?: Array<'email' | 'phone_number' | 'school_uid'>; field_visibility?: StudentFieldsVisibility; })): Promise; /** * Delete a student * @param requestBody * @returns Result Success * @throws ApiError */ static deleteStudent(requestBody: { /** * The unique identifier of the student */ student_uid: number; }): Promise; /** * Validate whether the provided registration key is valid and return corresponding information * @param requestBody * @returns any Tell whether the key is valid and return the related information * @throws ApiError */ static validate(requestBody: { registration_key: string; }): Promise<(Result & RegistrationKeyInfo)>; /** * Search for schools * @param offset * @param limit * @param schoolName * @param schoolCountry * @param schoolStateProvince * @param city * @param uid * @returns any Return the schools that satisfy the constraints * @throws ApiError */ static getSchool(offset: number, limit?: number, schoolName?: string, schoolCountry?: string, schoolStateProvince?: string, city?: string, uid?: number): Promise<(Result & { schools?: Array<(School & { /** * The unique identifier of the school */ uid: number; /** * The alias that matches the queried school_name */ matched_alias?: string; })>; })>; /** * Add a new school * @param requestBody * @returns any Successfully added the school and return the id * @throws ApiError */ static postSchool(requestBody: (School & { /** * The uid of the city */ city_uid?: number; })): Promise<(Result & { school_uid?: number; })>; /** * Delete an existing school * @param requestBody * @returns Result Success * @throws ApiError */ static deleteSchool(requestBody: { school_uid: number; }): Promise; /** * Get the role of the logged in student * @returns any Successfully fetched the role * @throws ApiError */ static getRole(): Promise<(Result & { role?: Role; /** * The privilege level of the student, the higher the greater */ level?: number; description?: string; })>; /** * Get existing cities that match the query params * @param offset * @param limit * @param city * @param stateProvince * @param country * @returns any Return a list of cities that match the query params * @throws ApiError */ static getCity(offset: number, limit?: number, city?: string, stateProvince?: string, country?: string): Promise<(Result & { cities?: Array; })>; /** * Get the registration keys that the current student can access. It is only usable for admin users * @param offset * @param limit * @param notExpired When set to true, only registration keys that haven't expired will be returned * @returns any Return the information about * @throws ApiError */ static getRegistrationKey(offset?: Offset, limit?: Limit, notExpired?: boolean): Promise<(Result & { registration_keys?: Array<(RegistrationKeyInfo & { registration_key?: string; /** * Whether the registration key is activated or deactivated. This is irrelevant to the expiration date */ activated?: boolean; })>; })>; /** * Add a new registration key * @param requestBody If the requestbody is not given, the registration key will be created for the class of the requester * @returns any When the registration key is successfully created or rejected due to duplication or invalid class * @throws ApiError */ static postRegistrationKey(requestBody?: { /** * The class number for the registration key. If not specified, the class number of the requester is used. Only curriculum, year or system admin can specify class numbers other than their current class number */ class_number?: number; /** * The grad year for the registration key. If not specified, the grad year of the requester is used. Only system admin can specify grad year other than their grad year */ grad_year?: number; }): Promise<(Result & RegistrationKeyInfo & { /** * The registration key you have just created */ registration_key?: string; })>; /** * Update the state of the regitration key * @param requestBody * @returns Result Success * @throws ApiError */ static updateRegistrationKey(requestBody: { /** * The registration key */ registration_key?: string; /** * The expiration date is used to identify registration key and it cannot be changed */ expiration_date?: string; /** * Whether to activate or deactivate the registration key */ activate?: boolean; }): Promise; /** * Get classes that are accessible to the current user. * @returns any Return a list of classes * @throws ApiError */ static getClass(): Promise<(Result & { classes: Array; })>; /** * Add a new class. This is only usable for curriculum admins or higher level admins * @param requestBody * @returns Result Success * @throws ApiError */ static postClass(requestBody: Class): Promise; /** * Delete an existing class. This is only usable for curriculum admins or higher level admins * @param requestBody * @returns Result Default response telling whether the request is successful * @throws ApiError */ static deleteClass(requestBody: { class_number: number; grad_year: number; /** * Delete the class anyway even if there are students associated with it. This will delete those students as well */ force: boolean; }): Promise; /** * Query the coordinate of schools * @param keywords * @param page * @param city * @param country * @param provider * @returns any Return a list of possible coordinates * @throws ApiError */ static getLocation(keywords: string, page?: number, city?: string, country?: string, provider?: 'amap' | 'mapbox'): Promise<(Result & { locations: Array<(Coordinate & { name: string; city?: string; address?: string; })>; })>; /** * Fetch feedbacks as a normal user * @returns any Return a list of feedbacks along with associated comments * @throws ApiError */ static viewGetFeedback(): Promise<(Result & { feedbacks?: Array<(Feedback & FeedbackInfo & FeedbackMeta & { comments: Array; })>; })>; /** * Fetch feedbacks as an admin * @returns any Return a list of feedbacks along with associated comments * @throws ApiError */ static manageGetFeedback(): Promise<(Result & { feedbacks?: Array<(Feedback & FeedbackInfo & FeedbackMeta & { comments: Array; })>; })>; /** * Manage feedbacks * @param feedbackUid * @param requestBody * @returns Result Success * @throws ApiError */ static updateFeedback(feedbackUid: string, requestBody: { status: 'resolved' | 'pending' | 'closed'; }): Promise; /** * Manage feedbacks * @param feedbackUid * @param requestBody * @returns Result Success * @throws ApiError */ static commentFeedback(feedbackUid: string, requestBody: { /** * Whether to reveal the sender name or not */ anonymous: boolean; content?: string; }): Promise; /** * Send a new feedback * @param requestBody * @returns any Successfully sent the feedback and return its unique id * @throws ApiError */ static publicReportFeedback(requestBody: (Feedback & FeedbackInfo)): Promise<{ /** * The unique id of the feedback just created */ feedback_uid: string; }>; /** * Send a new feedback as a logged in user * @param requestBody * @returns any Successfully sent the feedback and return its unique id * @throws ApiError */ static userReportFeedback(requestBody: Feedback): Promise<{ /** * The unique id of the feedback just created */ feedback_uid?: string; }>; /** * Logout the current user * @returns Result Successfully logged out and removed the current session * @throws ApiError */ static logout(): Promise; /** * Get the number of likes the site has received * @returns any Return the total number of likes * @throws ApiError */ static getLikes(): Promise<{ /** * The total number of likes */ count: number; }>; /** * Give a like to the developers * @returns Result Success * @throws ApiError */ static like(): Promise; }