import type { GitLabAuthHeader } from './config.js'; /** * Metadata about a single completed HTTP request, reported to `onResponse`. * Deliberately telemetry-agnostic: the OTel bridge maps these onto HTTP * semantic-convention span attributes, but the client itself has no OTel * dependency. Carries no secrets — the token lives in a request header, not * the URL. */ export interface GitLabResponseInfo { method: string; path: string; url: string; status: number; /** Parsed Content-Length header in bytes, when the response provided one. */ responseContentLength?: number; } export interface GitLabClientOptions { gitlabUrl: string; token: string; authHeader?: GitLabAuthHeader; fetchImpl?: typeof fetch; requestTimeout?: number; /** * Optional instrumentation callback invoked once per completed HTTP response * (success or error status), before any error is thrown. Used to surface HTTP * metadata to diagnostics/OTel without coupling the client to those layers. */ onResponse?: (info: GitLabResponseInfo) => void; } export interface MergeRequest { source_branch: string; target_branch: string; /** MR title — the one-line declared intent of the change. May be empty. */ title?: string; /** MR description — the author's full reasoning / decision log. May be empty or null. */ description?: string | null; } export interface Version { base_commit_sha: string; start_commit_sha: string; head_commit_sha: string; } export interface DiscussionNotePosition { old_path?: string | null; new_path?: string | null; old_line?: number | null; new_line?: number | null; } export interface DiscussionNote { id?: number; body?: string | null; system?: boolean; resolved?: boolean; position?: DiscussionNotePosition; } export interface Discussion { notes: DiscussionNote[]; } export interface MergeRequestNote { id: number; body: string; } export interface DraftNote { id: number; author_id: number; note: string; } export interface CurrentUser { id: number; } export declare class GitLabClient { private readonly base; private readonly token; private readonly authHeader; private readonly fetchImpl; private readonly requestTimeout; private readonly onResponse?; constructor(options: GitLabClientOptions); private reportResponse; url(path: string, query?: Record): string; private headers; private fetchWithTimeout; request(path: string, init?: RequestInit, query?: Record): Promise; paginate(path: string, query?: Record): Promise; getMergeRequest(project: string, mr: string): Promise; getLatestVersion(project: string, mr: string): Promise; getDiscussions(project: string, mr: string): Promise; postDiscussion(project: string, mr: string, payload: unknown): Promise; createMergeRequestNote(project: string, mr: string, body: string): Promise; updateMergeRequestNote(project: string, mr: string, noteId: number, body: string): Promise; /** * Add and remove MR labels in one `PUT`. GitLab applies `add_labels` and * `remove_labels` against the current set, ignores removing an absent label, * and creates a missing project label on add. An empty list is omitted. */ updateMergeRequestLabels(project: string, mr: string, add: string[], remove: string[]): Promise; getCurrentUser(): Promise; listDraftNotes(project: string, mr: string): Promise; createDraftNote(project: string, mr: string, payload: unknown): Promise; deleteDraftNote(project: string, mr: string, id: number): Promise; bulkPublishDraftNotes(project: string, mr: string): Promise; publishDraftNote(project: string, mr: string, id: number): Promise; } //# sourceMappingURL=gitlab.d.ts.map