Class

Stalks

Stalks(token)

Constructor

# new Stalks(token)

The part of the API that interacts with the weeks.
Parameters:
Name Type Description
token string The authorization token.

View Source structures/stalks/Stalks.js, line 13

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.

View Source structures/stalks/Stalks.js, line 108

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

View Source structures/stalks/Stalks.js, line 198

# 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.

View Source structures/stalks/Stalks.js, line 62

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)

View Source structures/stalks/Stalks.js, line 184

Promise.<Week>

# async updateWeek(week, forceopt) → {Promise.<Week>}

Updates a given week.
Parameters:
Name Type Attributes Default Description
week Week Week to update current week with.
force boolean <optional>
false Force the current version, even if it is older.

View Source structures/stalks/Stalks.js, line 143

Promise.<Week>