Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface OAuthDriver

interface

OAuthDriver

description

This interface defines the fields and methods of an OAuth driver which determines communication, transport and process that are used to connect and integrate to custom providers.

since

v0.3.0

Hierarchy

  • OAuthDriver

Implemented by

Index

Accessors

  • get codeField(): string
  • get dataField(): string
  • get usesUTCSecondsToEpoch(): boolean
  • Getter that determines whether this driver uses seconds (rather than milliseconds) to express a timestamp in UTC format.

    access

    public

    var

    {boolean}

    Returns boolean

Methods

  • executeRequest(accessToken: string, endpointUri: string, method?: HttpMethod, body?: any, options?: any, headers?: any): Promise<ResponseStatusDTO>
  • Method to execute a request calling the driver's provider API.

    access

    public

    async

    Parameters

    • accessToken: string

      The access token attached as a Bearer token to the request.

    • endpointUri: string

      The endpoint URI of the driver's provider API.

    • Optional method: HttpMethod

      (Optional) The HTTP method used for the request, e.g. "GET". Defaults to "GET".

    • Optional body: any

      (Optional) The body of the request, as used with "POST" or "PUT" requests. Defaults to an empty object.

    • Optional options: any

      (Optional) An options object that is directly passed to axios before request execution. Defaults to an empty object.

    • Optional headers: any

    Returns Promise<ResponseStatusDTO>

    A promise containing the response and status in ResponseStatusDTO.

  • getAuthorizeURL(extra: string): string
  • Method to return the authorize url of this driver's provider.

    access

    public

    Parameters

    • extra: string

      The data field value to include in this query.

    Returns string

    The full authorize url to send request to.

  • Method to transform an entity as described by the data provider API. Typically, this method is used to handle the transformation of remote objects (from data provider API) to internal objects in the backend runtime's database.

    e.g. This method is used to transform activity data as defined by the Strava API, into ActivityData as defined internally.

    access

    public

    Parameters

    Returns OAuthEntity

    A parsed entity object.

Generated using TypeDoc