Skip to main content
Module

x/kd_clients/mod.ts>RepoClient

Various HTTP clients for miscellaneous use.
Go to Latest
class RepoClient
extends GitHubClient
import { RepoClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.6/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
getFileContentResult(branchName: 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 branchName 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(branchName: 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.

getFileContent(branchName: 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.

getOwnerRepos(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.

getRepo(): Promise<RepoModel>

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

getVariables(): Promise<GitHubVarModel[]>

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

repoVariableExists(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.

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.