Options
All
  • Public
  • Public/Protected
  • All
Menu

SWGoH.help API client class.

Available methods:

  • client.fetchPlayer(payload: PlayerRequest): PlayerResponse
  • client.fetchGuild(payload: GuildRequest): GuildResponse
  • client.fetchUnits(payload: UnitsRequest): UnitsResponse
  • client.fetchEvents(payload: EventsRequest): EventsResponse
  • client.fetchBattles(payload: BattlesRequest): BattlesResponse
  • client.fetchData(payload: DataRequest): DataResponse

Hierarchy

  • Client

Index

Constructors

constructor

  • Creates a SWGoH.help API client.

    Parameters

    Returns Client

Properties

Private battlesUrl

battlesUrl: string

Private dataUrl

dataUrl: string

Private eventsUrl

eventsUrl: string

Private guildUrl

guildUrl: string

Private playerUrl

playerUrl: string

Private settings

settings: Settings

Private signinUrl

signinUrl: string

Private tokenId

tokenId: string

Private unitsUrl

unitsUrl: string

Methods

Protected fetchAPI

  • fetchAPI<T>(url: string, payload: any): T
  • Type parameters

    • T

    Parameters

    • url: string
    • payload: any

    Returns T

fetchBattles

fetchData

fetchEvents

fetchGuild

fetchPlayer

fetchUnits

Private getToken

  • getToken(): string
  • Retrieve the API session token from Google CacheService. The key is a SHA256 digest of the credentials used to access the API. Caching period is one hour.

    If there is no valid API session token, one is created by invoking the login() method.

    Returns string

login

  • login(): string
  • Attempts to log into the SWGoH.help API.

    Returns string

    A SWGoH.help API session token

Private setToken

  • setToken(token: string): void
  • Store the API session token into Google CacheService. The key is a SHA256 digest of the credentials used to access the API. Caching period is one hour.

    Parameters

    • token: string

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc