Constructor
# new Stalks(token)
The part of the API that interacts with the weeks.
Parameters:
Name | Type | Description |
---|---|---|
token |
string | The authorization token. |
Methods
# async createWeek(dateopt) → {Promise.<Week>}
Creates a Week for this week or a specific one.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
date |
DateResolvable |
<optional> |
new Date() | A date in the week. |
Promise.<Week>
# async fetchUserProfile(username)
Fetches a user profile via username.
Useful if you don't have the user as a friend.
Parameters:
Name | Type | Description |
---|---|---|
username |
string |
# async fetchWeek(dateopt, createNewopt) → {Promise.<Week>}
Fetches the current or a specific Week.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
date |
DateResolvable |
<optional> |
new Date() | A date in the week. |
createNew |
boolean |
<optional> |
true | Create a new one if it does not exist. |
Promise.<Week>
# async resetWeekPrices(weekOrDateopt, createNewopt) → {Promise.<Week>}
Resets the prices of the current or a specific week.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
weekOrDate |
Week | DateResolvable |
<optional> |
new Date() | A date in the week or the Week itself. |
createNew |
boolean |
<optional> |
true | Create a new one if it does not exist. (Only works with Date) |
Promise.<Week>