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

x/kd_clients/GitHubClients/ReleaseClient.ts>ReleaseClient

Various HTTP clients for miscellaneous use.
Go to Latest
class ReleaseClient
extends GitHubClient
import { ReleaseClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.12/GitHubClients/ReleaseClient.ts";

Provides a client for interacting with GitHub releases.

Constructors

new
ReleaseClient(
ownerName: string,
repoName: string,
token: string,
)

Initializes a new instance of the ReleaseClient class.

Methods

private
getAllReleases(page: number, qtyPerPage: number): Promise<[ReleaseModel[], Response]>

Gets the given page where each page quantity is the given qtyPerPage, for a repository with a name that matches the given ReleaseClient.this.repoName,

private
normalizePath(path: string): string

Normalizes the given path by removing any trailing slashes and converting backslashes to forward slashes.

private
uploadAssetInternal(filePath: string, releaseId: number): Promise<void>

Uploads a file as a release asset at the given filePath to a release that matches the given releaseId.

assetExists(releaseIdOrTag: number | string, assetIdOrName: number | string): Promise<boolean>

Returns a value indicating whether a release with an id or tag matches the given releaseIdOrTag, and a release asset with an id or name matches the given assetIdOrName.

deleteAsset(
releaseIdOrTag: number | string,
assetIdOrName: number | string,
errorWhenNotFound?: boolean,
): Promise<void>

Deletes an asset with an id or name that matches the given assetIdOrName, from a release with an id or tag that matches the given releaseIdOrTag.

downloadAllAssetsByReleaseName(
name: string,
dirPath: string,
overwrite?: boolean,
): Promise<void>

Downloads all assets for a release with the given tagName to the given dirPath.

downloadAllAssetsByReleaseTag(
tagName: string,
dirPath: string,
overwrite?: boolean,
): Promise<void>

Downloads all assets for a release with the given tagName to the given dirPath.

downloadAssetById(
assetId: number,
dirPath: string,
fileName: string,
overwrite?: boolean,
): Promise<void>

Downloads an asset with an id that matches the given assetId to the given dirPath.

getAllAssetsByTag(releaseTagName: string): Promise<AssetModel[]>

Gets all assets for a release with the given releaseTagName.

getAsset(releaseIdOrTag: number | string, assetIdOrName: number | string): Promise<AssetModel>

Gets a single asset with an id or name that matches the given assetIdOrName, for a release with an id or tag that matches the given releaseIdOrTag.

Gets the latest release.

getReleaseById(releaseId: number): Promise<ReleaseModel>

Gets a release with and id that matches the given releaseId.

getReleaseByName(name: string): Promise<ReleaseModel>

Gets a release with a name that matches the given release name.

getReleaseByTag(tagName: string): Promise<ReleaseModel>

Gets a release with and id that matches the given releaseId.

getReleases(page: number, qtyPerPage: number): Promise<ReleaseModel[]>

Gets the given page where each page quantity is the given qtyPerPage, for a repository with a name that matches the given ReleaseClient.this.repoName,

releaseExists(tagName: string): Promise<boolean>

Returns a value indicating whether or not a release is tied to a tag that matches the given tagName, for a repository with a name that matches the given ReleaseClient.this.repoName.

uploadAsset(
releaseIdOrTag: number | string,
filePath: string,
overwrite?: boolean,
): Promise<void>

Uploads an asset to a release that matches a tag or id by the given releaseIdOrTag.

uploadAssetsByReleaseName(name: string, filePaths: string[]): Promise<void>

Uploads one or more assets to a release with a name that matches the given name.

uploadAssetsByReleaseTag(tag: string, filePaths: string[]): Promise<void>

Uploads one or more assets to a release with a name that matches the given tag.