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

x/kd_clients/GitHubClients/PullRequestClient.ts>PullRequestClient

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

Provides a client for interacting with pull requests.

Constructors

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

Initializes a new instance of the PullRequestClient class.

Properties

private
readonly
labelClient: LabelClient

Methods

private
getPullRequestsInternal(
page?,
qtyPerPage?,
mergeState?: MergeState,
labels?: string[] | null,
milestoneNumber?: number,
): Promise<[PullRequestModel[], Response]>

Gets a page of pull requests where the quantity for each page matches the given qtyPerPage, where the pull request has the given state and labels, for a repository with a name that matches the given PullRequestClient.repoName.

private
openOrClosedExists(prNumber: number, state: IssueOrPRState): Promise<boolean>

Checks if a pull request with the given prNumber exists with the given state in a repository with a name that matches the given PullRequestClient.repoName.

private
processPossibleErrors(response: Response): void

Processes any possible errors from the given response.

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

Adds the given label to a pull request with a number that matches the given prNumber, in a repository with a name that matches the given PullRequestClient.repoName.

closedExists(prNumber: number): Promise<boolean>

Returns a value indicating whether or not a closed pull request with the given prNumber exists in a repository that matches the given PullRequestClient.repoName.

createPullRequest(
title: string,
headBranch: string,
baseBranch: string,
description?,
maintainerCanModify?,
isDraft?,
): Promise<PullRequestModel>

Creates a new pull request in a repository with a name that matches the given PullRequestClient.repoName, using the given title, headBranch, baseBranch, and description.

exists(prNumber: number): Promise<boolean>

Checks if a pull request with the given prNumber exists in a repository with a name that matches the given PullRequestClient.repoName.

Gets all of the closed pull requests for a repository with a name that matches the given PullRequestClient.repoName.

Gets all of the open pull requests for a repository with a name that matches the givenPullRequestClient.repoName.

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

Gets all of the labels for a pull request with a number that matches the given prNumber, in a repository with a name that matches the given PullRequestClient.repoName.

getPullRequest(prNumber: number): Promise<PullRequestModel>

Gets a pull request with a number that matches the given prNumber in a repository with a name that matches the given PullRequestClient.repoName.

getPullRequests(
page?,
qtyPerPage?,
mergeState?: MergeState,
labels?: string[] | null,
milestoneNumber?: number,
): Promise<PullRequestModel[]>

Gets a page of pull requests where the quantity for each page matches the given qtyPerPage, where the pull request has the given state and labels, for a repository with a name that matches the given PullRequestClient.repoName.

openExists(prNumber: number): Promise<boolean>

Returns a value indicating whether or not an open pull request with the given prNumber exists in a repository that matches the given PullRequestClient.repoName.

requestReviewers(prNumber: number, reviewers: string | string[]): Promise<void>

Requests a review from a reviewer with a GitHub login name that matches the given reviewers, for a pull request that matches the given prNumber in a repository where the name matches the given PullRequestClient.repoName.

updatePullRequest(prNumber: number, prRequestData: IssueOrPRRequestData): Promise<void>

Updates a pull request with a number that matches the given prNumber, using the given prRequestData, in a repository with a name that matches the given PullRequestClient.repoName.