Options
All
  • Public
  • Public/Protected
  • All
Menu

A wrapper for the Polympics API, in TypeScript.

Hierarchy

  • AuthenticatedClient
    • AppClient

Index

Constructors

constructor

  • new AppClient(__namedParameters?: { apiUrl?: string; credentials?: null | Credentials }): AppClient

Properties

apiUrl

apiUrl: string

Optional credentials

credentials: null | Credentials

Methods

checkSignups

  • checkSignups(): Promise<boolean>
  • Check if signups are open.

    Returns Promise<boolean>

createAccount

  • Create a new account.

    Note that although it accepts an Account object, the createdAt attribute will be ignored if set.

    Parameters

    Returns Promise<Account>

createAward

createSession

createTeam

  • createTeam(name: string): Promise<Team>
  • Create a new team.

    Parameters

    • name: string

    Returns Promise<Team>

deleteAccount

  • deleteAccount(account: Account): Promise<void>

deleteAward

  • deleteAward(award: Award): Promise<void>

deleteTeam

  • deleteTeam(team: Team): Promise<void>

discordAuthenticate

  • discordAuthenticate(token: string): Promise<Session>
  • Create a session from a Discord user token

    Parameters

    • token: string

    Returns Promise<Session>

getAccount

  • getAccount(id: string): Promise<Account>
  • Get an account by Discord ID.

    Parameters

    • id: string

    Returns Promise<Account>

getAward

getSelf

  • getSelf(): Promise<App>

getTeam

  • getTeam(id: number): Promise<Team>

giveAward

listAccounts

listTeams

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>

resetToken

takeAward

updateAccount

updateAward

updateTeam

Legend

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

Generated using TypeDoc