Methods
(inner) avatar(userId, trueopt) → {Promise}
Retrieve a users avatar image.
Example
const { meta, data } = await pnut.avatar("me");
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | Number | A user id | |
true |
boolean |
<optional> |
Should the return value be prebuffered via the fetch API? |
Returns:
- Type
- Promise
(inner) block(userId) → {Promise}
Block a user.
Example
const { meta, data } = await pnut.block(1);
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | Number | id of the user to block. |
Returns:
- Type
- Promise
(inner) blocked(paramsopt) → {Promise}
Retrieve a list of blocked users.
Example
const { meta, data } = await pnut.blocked();
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) cover(userId, trueopt) → {Promise}
Retrieve a users cover image.
Example
const { meta, data } = await pnut.cover("me");
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | Number | A user id | |
true |
boolean |
<optional> |
Should the return value be prebuffered via the fetch API? |
Returns:
- Type
- Promise
(inner) follow(userId) → {Promise}
Follow a user.
Example
const { meta, data } = await pnut.follow(1);
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | Number | id of user to follow |
Returns:
- Type
- Promise
(inner) followers(userId, paramsopt) → {Promise}
Retrieve a list of user objects that are following the specified user.
Example
const { meta, data } = await pnut.followers(1);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | Number | A user id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) following(userId, paramsopt) → {Promise}
Retrieve a list of user objects that the specified user is following.
Example
const { meta, data } = await pnut.following(1);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | Number | A user id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) mentions(userid, paramsopt) → {Promise}
Retrieve posts mentioning the specified user.
Example
const { meta, data } = await pnut.mentions(1);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userid |
string | Number | A user id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) mute(userId) → {Promise}
Mute a user.
Example
const { meta, data } = await pnut.mute(1);
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | Number | id of the user to mute |
Returns:
- Type
- Promise
(inner) muted(paramsopt) → {Promise}
Retrieve a list of muted users.
Example
const { meta, data } = await pnut.muted();
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) postsFrom(userId, paramsopt) → {Promise}
Retrieve posts created by a specific user.
Example
const { meta, data } = pnut.postsFrom(1);
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | Number | A user id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) presence(paramsopt) → {Promise}
Retrieve all users' presence statuses that are not "offline".
Example
const { meta, data } = await pnut.presence();
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) presenceOf(userId, paramsopt) → {Promise}
Retrieve a user's presence.
const { meta, data } = await presenceOf("me");
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | A user id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) replaceProfile(profile) → {Promise}
Replaces the authenticated user's profile. Anything not included is removed.
Example
const { meta, data } = await pnut.replaceProfile({
timezone: "Europe/Berlin",
name: "Robert"
});
Parameters:
Name | Type | Description |
---|---|---|
profile |
Object | Object with the required API parameters |
Returns:
- Type
- Promise
(inner) searchUsers(params)
Retrieve a list of users filtered by the given criteria.
Example
const { meta, data } = await pnut.searchUsers({
q: "news",
types: "feed"
});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
(inner) unblock(userId) → {Promise}
Unblock a user.
Example
const { meta, data } = await pnut.unblock(1);
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | id of the user to unblock. |
Returns:
- Type
- Promise
(inner) unfollow(userId) → {Promise}
Unfollow a user.
Example
const { meta, data } = await const { meta, data } = await pnut.unfollow(1);
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | Number | id of the user to unfollow |
Returns:
- Type
- Promise
(inner) unmute(userId) → {Promise}
Unmute a user.
Example
const { meta, data } = await pnut.unmute(1);
Parameters:
Name | Type | Description |
---|---|---|
userId |
string | Number | id of the user to unmute |
Returns:
- Type
- Promise
(inner) updatePresence(msg) → {Promise}
Update a user's presence.
const { meta, data } = await updatePresence("my status");
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | An optional status message |
Returns:
- Type
- Promise
(inner) updateProfile(profile) → {Promise}
Updates only specified parts of the authenticated user's profile.
Example
const { meta, data } = await pnut.updateProfile({
timezone: "Europe/Berlin",
name: "Robert"
});
Parameters:
Name | Type | Description |
---|---|---|
profile |
Object | Object with the require API parameters |
Returns:
- Type
- Promise
(inner) uploadAvatar(form) → {Promise}
Upload a new avatar image
// TODO: Client side form example
Parameters:
Name | Type | Description |
---|---|---|
form |
object | A valid DOM node of a form with a file field named "avatar" |
Returns:
- Type
- Promise
(inner) uploadCover(form) → {Promise}
Upload a new cover image
// TODO: Client side form example
Parameters:
Name | Type | Description |
---|---|---|
form |
object | A valid DOM node of a form with a file field named "cover" |
Returns:
- Type
- Promise
(inner) user(userId, paramsopt) → {Promise}
Retrieve a user object.
Example
const { meta, data } = await pnut.user("me");
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string | Number | A user id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) users(userIds) → {Promise}
Retrieve a list of specified user objects. Only retrieves the first 200 found.
Example
const { meta, data } pnut.users(1,15,127);
Parameters:
Name | Type | Description |
---|---|---|
userIds |
string | Number | 1 or more user ids |
Returns:
- Type
- Promise