Options
All
  • Public
  • Public/Protected
  • All
Menu

Class APIFetcher

Primary fetcher for GitHub API

Hierarchy

  • APIFetcher

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new APIFetcher(apiAccessToken?: undefined | string): APIFetcher

Properties

gist

gist: GistRoute

Gist route

organization

organization: OrganizationRoute

Organization route

repository

repository: RepositoryRoute

Repository route

user

user: UserRoute

User route

Accessors

apiAccessToken

  • get apiAccessToken(): string
  • set apiAccessToken(apiAccessToken: string): void
  • Set GitHub API access token for client

    Returns string

    GitHub API access token for client

  • Set GitHub API access token for client

    Parameters

    • apiAccessToken: string

      GitHub API access token

    Returns void

    GitHub API access token for client

Methods

fetch

  • Fetches data from GitHub API according to the request taken as argument. Null is returned if a specific resource (e.g. user/organization/repository) was not found.

    throws

    RequestError

    Type parameters

    • T

      Response data type

    Parameters

    Returns Promise<T | null>

pageFetch

  • Fetches the total data of several possible pages from GitHub API according to the request taken as argument. Null is returned if a specific resource (e.g. user/organization/repository) was not found.

    throws

    RequestError

    Type parameters

    • T

      Response data type

    Parameters

    Returns Promise<T[] | null>

Generated using TypeDoc