import { ILogService } from '../../log/common/logService'; import { IFetcherService } from '../../networking/common/fetcherService'; import { ITelemetryService } from '../../telemetry/common/telemetry'; export declare enum GraphQLErrorType { Unprocessable = "UNPROCESSABLE" } export interface GraphQLError { extensions?: { code: string; }; type?: GraphQLErrorType; message?: string; } export declare function getErrorCode(e: unknown): string | undefined; export interface PullRequestSearchItem { id: string; number: number; title: string; state: string; isDraft?: boolean; url: string; createdAt: string; updatedAt: string; author: { login: string; } | null; repository: { owner: { login: string; }; name: string; }; additions: number; deletions: number; files: { totalCount: number; }; fullDatabaseId: number; headRefOid: string; baseRefOid?: string; headRefName?: string; baseRefName?: string; body: string; } export type PullRequestState = 'open' | 'closed' | 'merged' | 'draft'; /** * Derives a unified pull request state from the GitHub GraphQL `state` enum * and the `isDraft` boolean. Terminal states (merged, closed) take precedence * over draft — a closed draft PR is reported as 'closed', not 'draft'. */ export declare function derivePullRequestState(pr: Pick): PullRequestState; export interface PullRequestSearchResult { search: { nodes: PullRequestSearchItem[]; pageInfo: { hasNextPage: boolean; endCursor: string | null; }; issueCount: number; }; } export interface AssignableActor { __typename: string; login: string; avatarUrl?: string; url?: string; } export interface AssignableActorsResponse { repository: { suggestedActors?: { nodes: AssignableActor[]; pageInfo: { hasNextPage: boolean; endCursor: string | null; }; }; assignableUsers?: { nodes: AssignableActor[]; pageInfo: { hasNextPage: boolean; endCursor: string | null; }; }; }; } export interface GitHubAPIRequestOptions { body?: unknown; version?: string; type?: 'json' | 'text'; userAgent?: string; accept?: string; additionalHeaders?: { [key: string]: string; }; returnStatusCodeOnError?: boolean; silent404?: boolean; callSite?: string; } export declare function makeGitHubAPIRequest(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, routeSlug: string, method: 'GET' | 'POST', token: string | undefined, options?: GitHubAPIRequestOptions): Promise; export declare function makeGitHubGraphQLRequest(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, query: string, token: string | undefined, variables?: unknown, callSite?: string): Promise; export declare function makeSearchGraphQLRequest(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, token: string | undefined, searchQuery: string, first?: number): Promise; export declare function getPullRequestFromGlobalId(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, token: string | undefined, globalId: string): Promise; export declare function closePullRequest(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, token: string | undefined, owner: string, repo: string, pullNumber: number): Promise; /** * Fetches assignable actors (users/bots) for a repository using suggestedActors API. * This is the preferred API as it filters by capability (CAN_BE_ASSIGNED). */ export declare function getAssignableActorsWithSuggestedActors(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, token: string | undefined, owner: string, repo: string): Promise; /** * Fetches assignable users for a repository using assignableUsers API. * This is a fallback for older GitHub Enterprise Server instances that don't support suggestedActors. */ export declare function getAssignableActorsWithAssignableUsers(fetcherService: IFetcherService, logService: ILogService, telemetry: ITelemetryService, host: string, token: string | undefined, owner: string, repo: string): Promise; //# sourceMappingURL=githubAPI.d.ts.map