/** * GraphQL queries for RepositoryRepository. * * Co-locates query strings with their response type interfaces. */ export interface GetPullRequestResponse { repository: { pullRequest: { id: string; state: string; mergeable: string; title: string; headRefName: string; } | null; }; } export interface MergePullRequestResponse { mergePullRequest: { pullRequest: { id: string; state: string; merged: boolean; }; }; } export interface GetBranchMergeStatusResponse { repository: { ref: { name: string; target: { oid: string; }; } | null; defaultBranchRef: { name: string; target: { oid: string; history: { nodes: Array<{ oid: string; }>; }; }; } | null; }; } export interface GetPRReviewsResponse { repository: { pullRequest: { reviews: { nodes: Array<{ id: string; author: { login: string; } | null; state: string; body: string; submittedAt: string; }>; }; } | null; }; } export interface GetDefaultBranchResponse { repository: { id: string; defaultBranchRef: { name: string; target: { oid: string; }; }; }; } export interface CreateRefResponse { createRef: { ref: { id: string; name: string; }; }; } export interface CreatePullRequestResponse { createPullRequest: { pullRequest: { id: string; number: number; url: string; }; }; } export interface ClosePullRequestResponse { closePullRequest: { pullRequest: { id: string; state: string; }; }; } export interface DeleteRefResponse { deleteRef: { clientMutationId: string | null; }; } export interface GetCommitStatusChecksResponse { repository: { pullRequest: { commits: { nodes: Array<{ commit: { statusCheckRollup: { contexts: { nodes: Array<{ __typename: string; name?: string; context?: string; state?: string; conclusion?: string; status?: string; }>; }; } | null; }; }>; }; } | null; }; } export interface CreateCommitOnBranchResponse { createCommitOnBranch: { commit: { oid: string; url: string; }; }; } export interface GetCodeScanningAlertsResponse { repository: { vulnerabilityAlerts: { nodes: Array<{ securityVulnerability: { severity: string; advisory: { summary: string; }; }; }>; }; }; } export declare const GET_PULL_REQUEST = "\n query GetPullRequest($owner: String!, $repo: String!, $prNumber: Int!) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $prNumber) {\n id\n state\n mergeable\n title\n headRefName\n }\n }\n }\n"; export declare const MERGE_PULL_REQUEST = "\n mutation MergePullRequest($pullRequestId: ID!, $mergeMethod: PullRequestMergeMethod!) {\n mergePullRequest(input: {\n pullRequestId: $pullRequestId\n mergeMethod: $mergeMethod\n }) {\n pullRequest {\n id\n state\n merged\n }\n }\n }\n"; export declare const FIND_PR_FOR_ISSUE_REPO = "\n query FindPullRequestForIssueRepo($owner: String!, $repo: String!) {\n repository(owner: $owner, name: $repo) {\n pullRequests(first: 10, states: [OPEN], orderBy: {field: CREATED_AT, direction: DESC}) {\n nodes {\n number\n title\n url\n state\n merged\n headRefName\n body\n closingIssuesReferences(first: 10) {\n nodes {\n number\n }\n }\n }\n }\n }\n }\n"; export declare const GET_BRANCH_MERGE_STATUS = "\n query GetBranchMergeStatus($owner: String!, $name: String!, $branchName: String!) {\n repository(owner: $owner, name: $name) {\n ref(qualifiedName: $branchName) {\n name\n target {\n oid\n }\n }\n defaultBranchRef {\n name\n target {\n oid\n ... on Commit {\n history(first: 100) {\n nodes {\n oid\n }\n }\n }\n }\n }\n }\n }\n"; export declare const GET_PR_REVIEWS = "\n query GetPRReviews($owner: String!, $repo: String!, $prNumber: Int!) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $prNumber) {\n reviews(first: 50) {\n nodes {\n id\n author {\n login\n }\n state\n body\n submittedAt\n }\n }\n }\n }\n }\n"; export declare const GET_DEFAULT_BRANCH = "\n query GetDefaultBranch($owner: String!, $repo: String!) {\n repository(owner: $owner, name: $repo) {\n id\n defaultBranchRef {\n name\n target {\n oid\n }\n }\n }\n }\n"; export declare const CREATE_REF = "\n mutation CreateRef($repositoryId: ID!, $name: String!, $oid: GitObjectID!) {\n createRef(input: { repositoryId: $repositoryId, name: $name, oid: $oid }) {\n ref {\n id\n name\n }\n }\n }\n"; export declare const CREATE_PULL_REQUEST = "\n mutation CreatePullRequest($repositoryId: ID!, $title: String!, $body: String!, $baseRefName: String!, $headRefName: String!) {\n createPullRequest(input: {\n repositoryId: $repositoryId\n title: $title\n body: $body\n baseRefName: $baseRefName\n headRefName: $headRefName\n }) {\n pullRequest {\n id\n number\n url\n }\n }\n }\n"; export declare const CLOSE_PULL_REQUEST = "\n mutation ClosePullRequest($pullRequestId: ID!) {\n closePullRequest(input: { pullRequestId: $pullRequestId }) {\n pullRequest {\n id\n state\n }\n }\n }\n"; export declare const DELETE_REF = "\n mutation DeleteRef($refId: ID!) {\n deleteRef(input: { refId: $refId }) {\n clientMutationId\n }\n }\n"; export declare const GET_COMMIT_STATUS_CHECKS = "\n query GetCommitStatusChecks($owner: String!, $repo: String!, $prNumber: Int!) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $prNumber) {\n commits(last: 1) {\n nodes {\n commit {\n statusCheckRollup {\n contexts(first: 100) {\n nodes {\n __typename\n ... on CheckRun {\n name\n conclusion\n status\n }\n ... on StatusContext {\n context\n state\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n"; export declare const CREATE_COMMIT_ON_BRANCH = "\n mutation CreateCommitOnBranch(\n $repositoryNameWithOwner: String!,\n $branchName: String!,\n $expectedHeadOid: GitObjectID!,\n $headline: String!,\n $fileContents: Base64String!,\n $filePath: String!\n ) {\n createCommitOnBranch(input: {\n branch: {\n repositoryNameWithOwner: $repositoryNameWithOwner\n branchName: $branchName\n }\n message: { headline: $headline }\n expectedHeadOid: $expectedHeadOid\n fileChanges: {\n additions: [{ path: $filePath, contents: $fileContents }]\n }\n }) {\n commit {\n oid\n url\n }\n }\n }\n"; export declare const GET_VULNERABILITY_ALERTS = "\n query GetVulnerabilityAlerts($owner: String!, $repo: String!) {\n repository(owner: $owner, name: $repo) {\n vulnerabilityAlerts(first: 100, states: [OPEN]) {\n nodes {\n securityVulnerability {\n severity\n advisory {\n summary\n }\n }\n }\n }\n }\n }\n"; //# sourceMappingURL=repository-queries.d.ts.map