2.1.0This class manages the calls to the Habitica API and converts the responses into helpful class types.
The language code to retrieve content for. See https://habitica.com/apidoc/#api-Content-ContentGet for list of allowed values.
Type: string
The xclient header string for this application. See https://habitica.fandom.com/wiki/Guidance_for_Comrades#X-Client_Header for details.
Type: string
The data cache for looking up Habitica content such as items, quests, or appearance information.
Type: object
Fetches a HabiticaUser instance from the api, containing publicly visible user data.
(HabiticaUserID)
The ID of the habitica user.
Promise<HabiticaUser>:
Promise provides a HabiticaUser instance.
Fetches a HabiticaUser instance, including personal information.
(HabiticaUserID)
(HabiticaAPIToken)
Promise<HabiticaUser>:
Promise provides a HabiticaUser instance.
Fetches the list of tasks for a given user.
(HabiticaUserID)
(HabiticaAPIToken)
Promise<HabiticaUserTasksManager>:
Fetches a user and their list of tasks.
(HabiticaUserID)
(HabiticaAPIToken)
Promise<HabiticaUser>:
Promise provides a HabiticaUser instance, with a populated tasks manager.
Make an authenticated GET request to the Habitica API. Data object returned varies based on the API url called.
(string)
the url of the api call.
(HabiticaUserID)
the ID of the user, needed for authentication.
(HabiticaAPIToken)
the API Token for the user, needed for authentication.
(object
= {})
key-value pairs for any parameters needed by the api call.
Promise<String>:
Promise containing the raw API response data as a string.
Make a GET request to the Habitica API. Data object returned varies based on the API url called. For accessing personal data endpoints, use authGetRequest
(string)
the url of the api call.
(object
= {})
key-value pairs for any parameters needed by the api call.
Promise<String>:
Promise containing the raw API response data as a string.
Make a POST request to the Habitica API. Data object returned varies based on the API url called.
(string)
the url of the api call.
(HabiticaUserID)
the ID of the user, needed for authentication.
(HabiticaAPIToken)
the API Token for the user, needed for authentication.
(object
= {})
key-value pairs for any parameters needed by the api call.
Promise<String>:
Promise containing the raw API response data as a string.
The User's ID. See https://habitica.fandom.com/wiki/APIOptions#User_ID.28UID.29
Type: string
The User's API Token. See https://habitica.fandom.com/wiki/API_Options#API_Token
Type: string
A class representing the Habitica User.
(object)
the json data object returned from the habitica API.
The amount of Gold the user owns as a nicely formatted string.
Type: number
The experience points needed to reach the next level.
Type: Number
The number of dailies this user can skip without taking damage. (Rogue Skill)
Type: Number
This user's constitution bonus against daily damage.
Type: Number
The object managing this users tasks, if they have been loaded.
Type: HabiticaUserTasksManager
A class representing the list of tasks for a HabiticaUser.
Calculates the number of unfinished dailies due today, and any incoming damage that the user will take as a result.
(HabiticaUser)
the user's stats are needed to calculate damage correctly.
DailyStats:
Type: object
(Number)
: Count of unfinished dailes that are due today.
(Number)
: Total damage user will receive from missed dailies and boss damage.
(Number)
: Damage user will receive from missed dailies.
(Number)
: Damage entire party will receive from boss due to missed dailies.
(Number)
: Number of unfinished dailes ignored due to Rogue sneakiness.