Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

GIFBox API Client

Hierarchy

  • Client

Index

Constructors

Properties

#axios: ClientAxios

Instance of Axios.

#bearerToken: null | string = null

Currently used Bearer authorization token.

#clientUser: null | ClientUser = null

User the client is authorized as.

Accessors

  • get token(): null | string

Methods

  • #updateClientUser(): Promise<void>
  • createSession(email: string, password: string, sessionName: string): Promise<void>
  • Login as existent user if there is no token present yet.

    Parameters

    • email: string
    • password: string
    • sessionName: string

      Name of the new session, will be displayed to the user.

    Returns Promise<void>

  • deleteSession(sessionId: string): Promise<void>
  • Delete an existing session.

    Parameters

    • sessionId: string

    Returns Promise<void>

  • loginBearer(token: string): Promise<void>
  • Login with an already existent session token.

    Parameters

    • token: string

    Returns Promise<void>

  • logout(): Promise<void>
  • Log out, then reset token and client user to null.

    Returns Promise<void>

  • Set a new avatar. avatar should be a common-format image that {@link FormData} understands.

    Parameters

    • avatar: any

    Returns Promise<GenericSuccess>

Generated using TypeDoc