Users
(users)
Overview
Available Operations
- activateUser - Activate a user
- adminGetUser - Get a user by id
- adminListUsers - Get a list of users
- anonymizeUser - Anonymize a user
- changePassword - Change password
- createUser - Creates a user
- deactivateUser - Deactivate a user
- deleteUser - Delete a user
- getUser - Get a single user by username
- getUserEmails - Get email addresses belonging to a user
- getUserExternalId - Get a user by external_id
- getUserIdentiyProviderExternalId - Get a user by identity provider external ID
- listUserActions - Get a list of user actions
- listUserBadges - List badges for a user
- listUsersPublic - Get a public list of users
- logOutUser - Log a user out
- refreshGravatar - Refresh gravatar
- sendPasswordResetEmail - Send password reset email
- silenceUser - Silence a user
- suspendUser - Suspend a user
- updateAvatar - Update avatar
- updateEmail - Update email
- updateUser - Update a user
- updateUsername - Update username
activateUser
Activate a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.activateUser(203554);
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersActivateUser } from "@lukehagar/discoursejs/funcs/usersActivateUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersActivateUser(sdk, 203554);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ActivateUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
adminGetUser
Get a user by id
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.adminGetUser(386776);
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersAdminGetUser } from "@lukehagar/discoursejs/funcs/usersAdminGetUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersAdminGetUser(sdk, 386776);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.AdminGetUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
adminListUsers
Get a list of users
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.adminListUsers({
flag: "new",
});
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersAdminListUsers } from "@lukehagar/discoursejs/funcs/usersAdminListUsers.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersAdminListUsers(sdk, {
flag: "new",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AdminListUsersRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.AdminListUsersResponseBody[]>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
anonymizeUser
Anonymize a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.anonymizeUser(418778);
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersAnonymizeUser } from "@lukehagar/discoursejs/funcs/usersAnonymizeUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersAnonymizeUser(sdk, 418778);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.AnonymizeUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
changePassword
Change password
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.users.changePassword("<value>");
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersChangePassword } from "@lukehagar/discoursejs/funcs/usersChangePassword.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersChangePassword(sdk, "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token |
string | ✔️ | N/A |
requestBody |
operations.ChangePasswordRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
createUser
Creates a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.createUser("<value>", "<value>");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersCreateUser } from "@lukehagar/discoursejs/funcs/usersCreateUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersCreateUser(sdk, "<value>", "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
requestBody |
operations.CreateUserRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.CreateUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
deactivateUser
Deactivate a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.deactivateUser(143950);
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersDeactivateUser } from "@lukehagar/discoursejs/funcs/usersDeactivateUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersDeactivateUser(sdk, 143950);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeactivateUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
deleteUser
Delete a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.deleteUser(251343);
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersDeleteUser } from "@lukehagar/discoursejs/funcs/usersDeleteUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersDeleteUser(sdk, 251343);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
requestBody |
operations.DeleteUserRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.DeleteUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
getUser
Get a single user by username
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.getUser("<value>", "<value>", "Ned56");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersGetUser } from "@lukehagar/discoursejs/funcs/usersGetUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersGetUser(sdk, "<value>", "<value>", "Ned56");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
username |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
getUserEmails
Get email addresses belonging to a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.getUserEmails("Winifred_OConner64");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersGetUserEmails } from "@lukehagar/discoursejs/funcs/usersGetUserEmails.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersGetUserEmails(sdk, "Winifred_OConner64");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetUserEmailsResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
getUserExternalId
Get a user by external_id
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.getUserExternalId("<value>", "<value>", "<value>");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersGetUserExternalId } from "@lukehagar/discoursejs/funcs/usersGetUserExternalId.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersGetUserExternalId(sdk, "<value>", "<value>", "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
externalId |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetUserExternalIdResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
getUserIdentiyProviderExternalId
Get a user by identity provider external ID
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.getUserIdentiyProviderExternalId("<value>", "<value>", "<value>", "<value>");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersGetUserIdentiyProviderExternalId } from "@lukehagar/discoursejs/funcs/usersGetUserIdentiyProviderExternalId.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersGetUserIdentiyProviderExternalId(sdk, "<value>", "<value>", "<value>", "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
externalId |
string | ✔️ | N/A |
provider |
string | ✔️ | Authentication provider name. Can be found in the provider callback URL: /auth/{provider}/callback |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.GetUserIdentiyProviderExternalIdResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
listUserActions
Get a list of user actions
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.listUserActions("<value>", 620550, "Deondre75");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersListUserActions } from "@lukehagar/discoursejs/funcs/usersListUserActions.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersListUserActions(sdk, "<value>", 620550, "Deondre75");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
filter |
string | ✔️ | N/A |
offset |
number | ✔️ | N/A |
username |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListUserActionsResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
listUserBadges
List badges for a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.listUserBadges("Faustino28");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersListUserBadges } from "@lukehagar/discoursejs/funcs/usersListUserBadges.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersListUserBadges(sdk, "Faustino28");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListUserBadgesResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
listUsersPublic
Get a public list of users
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.listUsersPublic("topic_count", "monthly");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersListUsersPublic } from "@lukehagar/discoursejs/funcs/usersListUsersPublic.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersListUsersPublic(sdk, "topic_count", "monthly");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order |
operations.Order | ✔️ | N/A |
period |
operations.Period | ✔️ | N/A |
asc |
operations.Asc | ➖ | N/A |
page |
number | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.ListUsersPublicResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
logOutUser
Log a user out
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.logOutUser(379568);
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersLogOutUser } from "@lukehagar/discoursejs/funcs/usersLogOutUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersLogOutUser(sdk, 379568);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LogOutUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
refreshGravatar
Refresh gravatar
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.refreshGravatar("Frances39");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersRefreshGravatar } from "@lukehagar/discoursejs/funcs/usersRefreshGravatar.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersRefreshGravatar(sdk, "Frances39");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.RefreshGravatarResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
sendPasswordResetEmail
Send password reset email
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.sendPasswordResetEmail();
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersSendPasswordResetEmail } from "@lukehagar/discoursejs/funcs/usersSendPasswordResetEmail.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersSendPasswordResetEmail(sdk);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SendPasswordResetEmailRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SendPasswordResetEmailResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
silenceUser
Silence a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.silenceUser(606247, {
postAction: "delete",
silencedTill: "2022-06-01T08:00:00.000Z",
});
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersSilenceUser } from "@lukehagar/discoursejs/funcs/usersSilenceUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersSilenceUser(sdk, 606247, {
postAction: "delete",
silencedTill: "2022-06-01T08:00:00.000Z",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
requestBody |
operations.SilenceUserRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SilenceUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
suspendUser
Suspend a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.suspendUser(970832, {
postAction: "delete",
reason: "<value>",
suspendUntil: "2121-02-22",
});
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersSuspendUser } from "@lukehagar/discoursejs/funcs/usersSuspendUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersSuspendUser(sdk, 970832, {
postAction: "delete",
reason: "<value>",
suspendUntil: "2121-02-22",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
number | ✔️ | N/A |
requestBody |
operations.SuspendUserRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.SuspendUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
updateAvatar
Update avatar
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.updateAvatar("Kadin32");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersUpdateAvatar } from "@lukehagar/discoursejs/funcs/usersUpdateAvatar.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateAvatar(sdk, "Kadin32");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | ✔️ | N/A |
requestBody |
operations.UpdateAvatarRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.UpdateAvatarResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
updateEmail
Update email
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.users.updateEmail("Hobart_Lakin34");
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersUpdateEmail } from "@lukehagar/discoursejs/funcs/usersUpdateEmail.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateEmail(sdk, "Hobart_Lakin34");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | ✔️ | N/A |
requestBody |
operations.UpdateEmailRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
updateUser
Update a user
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.users.updateUser("<value>", "<value>", "Dandre.Jast32");
// Handle the result
console.log(result)
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersUpdateUser } from "@lukehagar/discoursejs/funcs/usersUpdateUser.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateUser(sdk, "<value>", "<value>", "Dandre.Jast32");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
username |
string | ✔️ | N/A |
requestBody |
operations.UpdateUserRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.UpdateUserResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
updateUsername
Update username
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
await sdk.users.updateUsername("Avis_Tremblay74");
}
run();
Standalone function
The standalone function version of this method:
import { SDKCore } from "@lukehagar/discoursejs/core.js";
import { usersUpdateUsername } from "@lukehagar/discoursejs/funcs/usersUpdateUsername.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore();
async function run() {
const res = await usersUpdateUsername(sdk, "Avis_Tremblay74");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | ✔️ | N/A |
requestBody |
operations.UpdateUsernameRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |