# new Tusk(config)
Create a new Tusk instance.
Create a new Tusk instance.
Parameters:
Name | Type | Description |
---|---|---|
config |
Object
|
Configuration object. |
Methods
# async delete(path, params) → {Promise.<Object>}
Make a DELETE request to the Mastodon API.
Make a DELETE request to the Mastodon API.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
API endpoint path. |
params |
Object
|
Request parameters. |
- The API response.
Promise.<Object>
# formEncodeParams(params) → {string}
URL-encode request parameters.
URL-encode request parameters.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object
|
Request parameters. |
- URL-encoded parameters.
string
# async get(path, params) → {Promise.<Object>}
Make a GET request to the Mastodon API.
Make a GET request to the Mastodon API.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
API endpoint path. |
params |
Object
|
Request parameters. |
- The API response.
Promise.<Object>
# getAuth() → {Object}
Get the client's authentication tokens.
Get the client's authentication tokens.
- The authentication tokens.
Object
# async patch(path, params) → {Promise.<Object>}
Make a PATCH request to the Mastodon API.
Make a PATCH request to the Mastodon API.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
API endpoint path. |
params |
Object
|
Request parameters. |
- The API response.
Promise.<Object>
# async post(path, params) → {Promise.<Object>}
Make a POST request to the Mastodon API.
Make a POST request to the Mastodon API.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
API endpoint path. |
params |
Object
|
Request parameters. |
- The API response.
Promise.<Object>
# async put(path, params) → {Promise.<Object>}
Make a PUT request to the Mastodon API.
Make a PUT request to the Mastodon API.
Parameters:
Name | Type | Description |
---|---|---|
path |
string
|
API endpoint path. |
params |
Object
|
Request parameters. |
- The API response.
Promise.<Object>
# async request(method, path, params) → {Promise.<Object>}
Make a request to the Mastodon API.
Make a request to the Mastodon API.
Parameters:
Name | Type | Description |
---|---|---|
method |
string
|
HTTP method. |
path |
string
|
API endpoint path. |
params |
Object
|
Request parameters. |
- The API response.
Promise.<Object>
# setAuth(tokens)
Update the client's authentication tokens.
Update the client's authentication tokens.
Parameters:
Name | Type | Description |
---|---|---|
tokens |
Object
|
The new authentication tokens. |