Constructor
# new UserService(cookie)
Creates an instance of UserService.
Parameters:
Name | Type | Description |
---|---|---|
cookie |
string
|
The cookie value. |
Methods
# async getAllStudentInfo() → {Promise.<Partial.<IUser>>}
Retrieves all available information about the student.
A promise that resolves to an object containing various student information.
Promise.<Partial.<IUser>>
# async getInfo() → {Promise.<AxiosResponse>}
Retrieves user information from the API.
A promise that resolves to the Axios response.
Promise.<AxiosResponse>
# async getPicture() → {Promise.<string>}
Retrieves the user's picture.
If the user has no picture.
Error
A promise that resolves to the URL of the user's picture.
Promise.<string>
# async getStaticInfos() → {Promise.<IUser>}
Retrieves static user information.
If the user information has not been fetched yet, it calls the API to fetch it.
A promise that resolves to the static user information.
Promise.<IUser>
# async getStudentCredits() → {Promise.<number>}
Retrieves the user's credits.
A promise that resolves to the user's credits or 0 if it is not available.
Promise.<number>
# async getStudentCycle() → {Promise.<string>}
Retrieves the user's cycle.
A promise that resolves to the user's cycle or "Unknown" if it is not available.
Promise.<string>
# async getStudentEmail() → {Promise.<string>}
Retrieves the user's internal email.
A promise that resolves to the user's internal email.
Promise.<string>
# async getStudentGPA() → {Promise.<string>}
Retrieves the user's GPA.
A promise that resolves to the user's GPA or "Unknown" if it is not available.
Promise.<string>
# async getStudentGroups() → {Promise.<Array.<string>>}
Retrieves the user's groups.
A promise that resolves to an array of the user's group names or an empty array if there are no groups.
Promise.<Array.<string>>
# async getStudentLocation() → {Promise.<string>}
Retrieves the user's location.
A promise that resolves to the user's location.
Promise.<string>
# async getStudentName() → {Promise.<string>}
Retrieves the user's full name.
A promise that resolves to the user's full name.
Promise.<string>
# async getStudentNetsoul() → {Promise.<number>}
Retrieves the user's Netsoul active status.
A promise that resolves to the user's Netsoul active status.
Promise.<number>
# async getStudentNetsoulNorm() → {Promise.<number>}
Retrieves the user's Netsoul norm.
A promise that resolves to the user's Netsoul norm.
Promise.<number>
# async getStudentPhone() → {Promise.<string>}
Retrieves the user's phone number.
A promise that resolves to the user's phone number.
Promise.<string>
# async getStudentPromo() → {Promise.<number>}
Retrieves the user's promo.
A promise that resolves to the user's promo.
Promise.<number>
# async getStudentYear() → {Promise.<number>}
Retrieves the user's student year.
If the user has no student year.
Error
A promise that resolves to the user's student year.
Promise.<number>
# setUser(user) → {void}
Sets the user object.
Parameters:
Name | Type | Description |
---|---|---|
user |
IUser
|
null
|
The user object to set. |
void