Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for clients.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

apiUrl

apiUrl: string

Optional credentials

credentials: null | Credentials

Methods

Private handleResponse

  • handleResponse<Type>(response: Response, emptyResponse?: boolean): Promise<Type>
  • Handle a response from the API, raising possible errors.

    Type parameters

    • Type

    Parameters

    • response: Response
    • emptyResponse: boolean = false

    Returns Promise<Type>

Protected request

  • request<Type>(method: HttpMethod, endpoint: string, data?: Record<string, any>, __namedParameters?: { emptyResponse?: boolean }): Promise<Type>
  • Make a request to an API endpoint.

    Type parameters

    • Type

    Parameters

    • method: HttpMethod
    • endpoint: string
    • data: Record<string, any> = ...
    • __namedParameters: { emptyResponse?: boolean } = ...
      • Optional emptyResponse?: boolean

    Returns Promise<Type>

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property

Generated using TypeDoc