Skip to main content
Module

x/kd_clients/mod.ts>IssueClient

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

Provides a client for interacting with issues.

Constructors

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

Initializes a new instance of the IssueClient class.

Properties

private
readonly
isInitialized: boolean
private
readonly
labelClient: LabelClient
writeonly
ownerName: string

Sets the name of the owner of the repository.

writeonly
repoName: string

Sets the name of the repository.

Methods

private
openOrClosedIssueExists(issueNumber: number, state: IssueOrPRState): Promise<boolean>

Checks if an issue with the given issueNumber exists with the given state in a repository with a name that matches the given IssueClient.repoName.

addLabel(issueNumber: number, label: string): Promise<void>

Adds the given label to an issue that matches the given issueNumber in a repository with a name that matches the given IssueClient.repoName.

closedIssueExists(issueNumber: number): Promise<boolean>

Returns a value indicating whether or not a closed issue with the given issueNumber exists in a repository with a name that matches the given IssueClient.repoName.

getAllClosedIssues(): Promise<IssueModel[]>

Gets all of the closed issues in a repository with a name that matches the given IssueClient.repoName.

getAllOpenIssues(): Promise<IssueModel[]>

Gets all of the open issues in a repository with a name that matches the given IssueClient.repoName.

getIssue(issueNumber: number): Promise<IssueModel>

Gets an issue with the given issueNumber from a repository with a name that matches given IssueClient.repoName.

getIssues(
page?,
qtyPerPage?,
state?: IssueOrPRState,
labels?: string[] | null,
milestoneNumber?: number | null,
): Promise<[IssueModel[], Response]>

Gets the given page of issues where the page quantity matches the given qtyPerPage, in a repository with a name that matches the given IssueClient.repoName, with the given issue state, labels, and in a milestone with a number that matches the given milestoneNumber.

getLabels(issueNumber: number): Promise<string[]>

Gets all of the labels for an issue that matches the given issueNumber in a repository with a name that matches the given IssueClient.repoName.

issueExists(issueNumber: number): Promise<boolean>

Returns a value indicating whether or not an issue with the given issueNumber exists regardless of its state, in a repository with a name that matches the given IssueClient.repoName.

openIssueExists(issueNumber: number): Promise<boolean>

Returns a value indicating whether or not an open issue with the given issueNumber exists in a repository with a name that matches the given IssueClient.repoName.

updateIssue(issueNumber: number, issueData: IssueOrPRRequestData): Promise<void>

Updates an issue with the given issueNumber and issueData, in a repository with a name that matches the given IssueClient.repoName.