Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/kd_clients/core/GitHubClient.ts>GitHubClient

Various HTTP clients for miscellaneous use.
Latest
class GitHubClient
extends WebApiClient
Abstract
import { GitHubClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.13/core/GitHubClient.ts";

Provides a base class for HTTP clients.

Constructors

new
GitHubClient(
ownerName: string,
repoName: string,
token?: string,
)

Initializes a new instance of the WebAPIClient class.

Properties

private
_ownerName: string
private
_repoName: string
private
headerParser: LinkHeaderParser
ownerName: string

Gets the name of the owner of the repository.

repoName: string

Gets the name of the repository.

Methods

private
createAlternatePagesGroups(totalPages: number): [number[], number[]]

Creates 2 groups of pages from the given totalPages.

Returns a value indicating whether the given error is a valid GitHub error.

protected
containsToken(): boolean

Returns a value indicating whether or not a token was provided.

protected
getAllData<T>(
getData: GetDataFunc<T>,
page?,
qtyPerPage?,
): Promise<T[]>

Gets all data starting at the given page with a quantity for each page using the given qtyPerPage.

protected
getAllDataUntil<T>(
getData: GetDataFunc<T>,
page?,
qtyPerPage?,
until: (pageOfData: T[]) => boolean,
): Promise<T[]>

Gets all data starting at the given page with a quantity for each page using the given qtyPerPage, until the given getData predicate returns true.

protected
getAllFilteredData<T>(
getData: GetDataFunc<T>,
page?,
qtyPerPage?,
filter: (pageOfData: T[]) => T[],
): Promise<T[]>

Gets all data starting at the given page with a quantity for each using the given qtyPerPage, with each page of data being filtered with the given getData function.