import { $t as replyToPullRequestReviewThread, Jt as OpenedPullRequest, L as ProviderApiError, Qt as mergePullRequest, Xt as createPullRequest, Yt as commentOnPullRequest, Zt as markPullRequestReady, ct as JsonValue, dn as FetchPrState, en as reviewPullRequest, qt as MergeOutcome } from "../../index-DJ6CHaMc.js"; //#region src/providers/github-http.d.ts /** * GitHub answered a REST call with an error status. Check `status` to handle * one answer, such as 422 when GitHub refuses a request it understood. * * @group Errors */ declare class GitHubApiError extends ProviderApiError { /** The HTTP status, such as 404 or 422. */ readonly status: number; /** GitHub's `message`, or the whole response body when it has none. */ readonly githubMessage: string; /** The response body as GitHub sent it. */ readonly body: string; /** GitHub refused for its rate limit, and the waits for it ran out. */ rateLimited: boolean; constructor(status: number, apiPath: string, body: string, message?: string); } //#endregion //#region src/steps/pull-requests/call.d.ts /** * Call any GitHub REST endpoint as the factory's GitHub App, and return * GitHub's parsed JSON response. Wrap it in your own `"use step"` function. * * @remarks * `path` starts with `/` and is the endpoint's path with its query string, such as * `/repos/acme/app/commits?author=dev@acme.com`. `installationName` names the * App installation, as named on the hub, to call through. `body` is sent as * JSON. An answer with no content, such as 204, returns `undefined`. * * When GitHub answers with an error status, it throws a {@link GitHubApiError} * with the `status` and GitHub's message. Rate-limited calls are retried. A * step can run more than once, so a call that is not safe to repeat has to * accept what a repeat gets back. The App needs whatever permission the * endpoint asks for. * * @example * ```ts * // workflows/review/steps.ts * import { callGitHub } from "@jigs-ai/jigs/steps/pull-requests"; * * export async function closeIssue(repo: string, issue: number) { * "use step"; * await callGitHub("PATCH", `/repos/${repo}/issues/${issue}`, { * installationName: "github-acme", * body: { state: "closed" }, * }); * } * ``` * * @group Any REST endpoint */ declare function callGitHub(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", path: string, options: { installationName: string; body?: JsonValue; }): Promise; //#endregion //#region src/steps/pull-requests/fetch-state.d.ts /** * Read the pull request’s checks, reviews, open review threads and approval. * * @group Read */ declare const fetchPullRequestState: FetchPrState; //#endregion export { GitHubApiError, type MergeOutcome, type OpenedPullRequest, callGitHub, commentOnPullRequest, createPullRequest, fetchPullRequestState, markPullRequestReady, mergePullRequest, replyToPullRequestReviewThread, reviewPullRequest };