Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/kd_clients/mod.ts>RepoClient

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

Provides a client for interacting with GitHub repositories.

Constructors

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

Initializes a new instance of the RepoClient class.

Methods

private
getAllReposInternal(page: number, qtyPerPage: number): Promise<[RepoModel[], Response]>

Gets a page of repositories owned by the currently set RepoClient.ownerName with a quantity that matches the given qtyPerPage.

private
getFileContentInternal(ref: string, relativeFilePath: string): Promise<FileContentModel>

Gets the content of a file in a repository with a name that matches the given RepoClient.repoName, on a branch with a name that matches the given ref at the given relativeFilePath.

createFile(
branchName: string,
relativeFilePath: string,
fileContent: string,
commitMessage: string,
): Promise<void>

Creates a new file in a repository with a name that matches the given RepoClient.repoName, on a branch that matches the given branchName, at the given relativeFilePath, and with the given fileContent, with the given commitMessage.

exists(): Promise<boolean>

Checks if a repository with a name that matches the RepoClient.repoName exists.

fileExists(ref: string, relativeFilePath: string): Promise<boolean>

Gets a value indicating whether or not a file exists at the given relativeFilePath in a repository with a name that matches the given RepoClient.repoName.

getAllRepos(page: number, qtyPerPage: number): Promise<RepoModel[]>

Gets a page of repositories owned by the currently set RepoClient.ownerName with a quantity that matches the given qtyPerPage.

getFileContent(ref: string, relativeFilePath: string): Promise<string>

Gets the content of a file at the given relativeFilePath in a repository with a name that matches the given RepoClient.repoName.

getRepo(): Promise<RepoModel>

Gets information about a repository with a name that matches the given RepoClient.repoName.

getVariables(options?: VariableOptions | VariableOptions[]): Promise<GitHubVarModel[]>

Gets a list of all the variables for a repository with a name that matches the given RepoClient.repoName.

updateFile(
branchName: string,
relativeFilePath: string,
fileContent: string,
commitMessage: string,
): Promise<void>

Updates the content of a file in a repository with a name that matches the given RepoClient.repoName, on a branch that matches the given branchName, at the given relativeFilePath, with the given fileContent, and with the given commitMessage.

updateVariable(variableName: string, variableValue: string): Promise<void>

Updates the value of a value to the given variableValue a variable with a name that matches the given variableName in a repository with a name that matches the given RepoClient.repoName.

variableExists(variableName: string): Promise<boolean>

Gets a value indicating whether or not a variable with the given variableName, in a repository with a name that matches the given RepoClient.repoName.