Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Connection

Index

Constructors

constructor

  • new Connection(baseURL: string, wsURL: string, useWebSockets?: boolean): Connection

Properties

Private $baseURL

$baseURL: string

Private Optional $user

$user: User

Private Optional $ws

Methods

Private checkForErrors

  • checkForErrors(status: HttpErrorCodes, parsedResponse?: Record<string, unknown>): void

Private createUrl

  • createUrl(endpoint: string): string

getWebSocket

request

  • request<T>(method: HttpMethod, endpoint: string, data?: Data, allowedScopes?: Scopes[], skipParsing?: boolean): Promise<T>
  • Type parameters

    • T

    Parameters

    • method: HttpMethod
    • endpoint: string
    • Optional data: Data
    • Optional allowedScopes: Scopes[]
    • Optional skipParsing: boolean

    Returns Promise<T>

Private setBearerTokenIfRequired

  • setBearerTokenIfRequired(headers: any, scopes?: Scopes[]): void

setUser

  • setUser(user?: User): void

upload

  • upload<T>(endpoint: string, body: FormData, allowedScopes: Scopes[]): Promise<T>
  • Type parameters

    • T

    Parameters

    • endpoint: string
    • body: FormData
    • allowedScopes: Scopes[]

    Returns Promise<T>

Generated using TypeDoc