Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AuthAPI

api

public AuthAPI - provides methods to interact with the Auth API

Hierarchy

Index

Constructors

constructor

Properties

Protected _api

Protected _endpoint

_endpoint: string

Protected _headers

_headers: object

Protected _okuna

_okuna: Client

Defines an API request.

param

Protected _params

_params: RequestParams

Protected _paths

_paths: string[] = []

Protected _url

_url: string

requiresToken

requiresToken: boolean = true

Methods

_constructFormdata

  • _constructFormdata(opts?: object | null): FormData
  • constructFormdata() Constructs a FormData instance from an object.

    Parameters

    • Default value opts: object | null = null

      the object to generate the FormData from

    Returns FormData

acceptGuidelines

  • acceptGuidelines(): Promise<any>
  • POST /api/auth/user/accept-guidelines/ - Promises to accept the user guidelines

    Returns Promise<any>

blockUserWithName

  • blockUserWithName(username: string): Promise<any>
  • POST /api/auth/users/:username/block/ - Promises to block a user by username

    Parameters

    • username: string

      The username of the user to block

    Returns Promise<any>

createUser

  • POST /api/auth/register/ (urlencoded) - Promises to create a user

    Parameters

    Returns Promise<any>

    • the created user

Protected delete

  • delete(): Promise<any>

generateHeaders

  • generateHeaders(contentType?: string | null): object
  • generateHeaders() A function used to generate the headers that need to be passed to the request performee.

    Parameters

    • Default value contentType: string | null = null

    Returns object

Protected get

  • get(): Promise<any>

getAllLanguages

  • getAllLanguages(): Promise<any>
  • GET /auth/auth/user/languages/ - Promises to get the user's languages

    Returns Promise<any>

getAuthenticatedUserNotificationSettings

  • getAuthenticatedUserNotificationSettings(): Promise<any>
  • GET /api/auth/user/notifications-settings/ - Promises to retrieve the user's notification settings

    Returns Promise<any>

getBlockedUsers

  • getBlockedUsers(opts: LimitationParams, authenticatedRequest?: boolean): Promise<any>
  • GET /api/auth/blocked-users/ - Promises to get an array of blocked users

    Parameters

    • opts: LimitationParams

      Query limitation parameters

    • Default value authenticatedRequest: boolean = true

      Checks whether the request is authenticated

    Returns Promise<any>

getFollowers

  • getFollowers(opts: LimitationParams, authenticatedRequest?: boolean): Promise<any>
  • GET /api/auth/followers/ - Promises to get an array of followers

    Parameters

    • opts: LimitationParams

      Query limitation parameters

    • Default value authenticatedRequest: boolean = true

      Checks whether the request is authenticated

    Returns Promise<any>

getFollowings

  • getFollowings(opts: LimitationParams, authenticatedRequest?: boolean): Promise<any>
  • GET /api/auth/followings/ - Promises to get an array of followings

    Parameters

    • opts: LimitationParams

      Query limitation parameters

    • Default value authenticatedRequest: boolean = true

      Checks whether the request is authenticated

    Returns Promise<any>

getLinkedUsers

  • getLinkedUsers(opts: IGetLinkedUsers, authenticatedRequest?: boolean): Promise<any>
  • GET /api/auth/linked-users/ - Promises to get an array of linked users

    Parameters

    • opts: IGetLinkedUsers
    • Default value authenticatedRequest: boolean = true

      Checks whether the request is authenticated

    Returns Promise<any>

getUserWithAuthToken

  • getUserWithAuthToken(authToken: string): Promise<any>
  • GET /api/auth/user/ - Promises to get a user by auth token

    Parameters

    • authToken: string

      The authentication token

    Returns Promise<any>

getUserWithUsername

  • getUserWithUsername(username: string, authenticatedRequest?: boolean): Promise<any>
  • GET /api/auth/user/ - Promises to get a user by username

    Parameters

    • username: string

      The username to search for

    • Default value authenticatedRequest: boolean = true

      Checks whether the request is authenticated

    Returns Promise<any>

getUsersWithQuery

  • getUsersWithQuery(query: string, authenticatedRequest?: boolean): Promise<any>
  • GET /api/auth/user/ - Promises to get a user by a certain query

    Parameters

    • query: string

      The search query

    • Default value authenticatedRequest: boolean = true

      Checks whether the request is authenticated

    Returns Promise<any>

isEmailAvailable

  • isEmailAvailable(email: string): Promise<unknown>
  • POST /api/auth/email-check/ - Promises to check if an email address is available

    Parameters

    • email: string

      The desired email address

    Returns Promise<unknown>

    • a boolean

isUsernameAvailable

  • isUsernameAvailable(username: string): Promise<unknown>
  • POST /api/auth/username-check/ - Promises to check if a username is available

    Parameters

    • username: string

      The desired username

    Returns Promise<unknown>

    • a boolean

login

  • login(username: string, password: string): Promise<any>
  • POST /api/auth/login/ - Promises to log a user in

    Parameters

    • username: string

      The username of the user

    • password: string

      The password of the user

    Returns Promise<any>

Protected patch

  • patch(body: object): Promise<any>

Protected patchFormdata

  • patchFormdata(body: object): Promise<any>

Protected post

  • post(body: object): Promise<any>

Protected postFormdata

  • postFormdata(body: object): Promise<any>

Protected put

  • put(body: object): Promise<any>

Protected putFormdata

  • putFormdata(body: object): Promise<any>

reportUser

  • POST /api/auth/users/:username/report/ - Promises to report a user

    Parameters

    Returns Promise<any>

requestPasswordReset

searchBlockedUsers

  • searchBlockedUsers(query: string, count?: number | undefined): Promise<any>
  • GET /api/auth/blocked-users/search/ - Promises to search between blocked users

    Parameters

    • query: string

      The search query

    • Default value count: number | undefined = undefined

      The max number of results

    Returns Promise<any>

searchFollowers

searchFollowings

searchLinkedUsers

setNewLanguage

  • setNewLanguage(languageId: number): Promise<any>
  • POST /api/auth/user/languages/ - Promises to set a new user language

    Parameters

    • languageId: number

      The id of the desired language

    Returns Promise<any>

subscribeUserWithUsername

  • subscribeUserWithUsername(username: string): Promise<any>
  • PUT /api/auth/users/:username/notifications/subscribe - Promises to subscribe a user to notifications

    Parameters

    • username: string

      The username of the user to subscribe

    Returns Promise<any>

unblockUserWithName

  • unblockUserWithName(username: string): Promise<any>
  • POST /api/auth/users/:username/unblock/ - Promises to unblock a user by username

    Parameters

    • username: string

      The username of the user to unblock

    Returns Promise<any>

unsubscribeUserWithUsername

  • unsubscribeUserWithUsername(username: string): Promise<any>
  • DELETE /api/auth/users/:username/notifications/subscribe - Promises to unsubscribe a user from notifications

    Parameters

    • username: string

      The username of the user to unsubscribe

    Returns Promise<any>

updateAuthenticatedUserNotificationSettings

updateUser

  • PATCH /api/auth/user/ (urlencoded) - Promises to create a user

    Parameters

    Returns Promise<any>

    • the updated user

updateUserEmail

  • updateUserEmail(email: string): Promise<any>
  • PATCH /api/auth/user/settings/ (urlencoded) - Promises to update the user's email

    Parameters

    • email: string

      The desired email address

    Returns Promise<any>

updateUserPassword

  • updateUserPassword(currentPassword: string, newPassword: string): Promise<any>
  • PATCH /api/auth/user/settings/ (urlencoded) - Promises to update the user's passord

    Parameters

    • currentPassword: string

      The user's current password

    • newPassword: string

      The user's desired new password

    Returns Promise<any>

verifyEmailWithToken

  • verifyEmailWithToken(token: string): Promise<any>
  • POST /api/auth/email/verify/ - Promises to verify a user's email

    Parameters

    • token: string

      The verification token

    Returns Promise<any>

verifyPasswordReset

verifyRegisterToken

  • verifyRegisterToken(token: string): Promise<any>
  • POST /api/auth/register/verify-token - Promises to verify a user token

    Parameters

    • token: string

      the token to verify

    Returns Promise<any>

Generated using TypeDoc