import { z } from 'zod'; import { CreateRepositoryOptionsSchema, CreateIssueOptionsSchema, CreateMergeRequestOptionsSchema, CreateBranchOptionsSchema, type GitLabFork, type GitLabReference, type GitLabRepository, type GitLabIssue, type GitLabMergeRequest, type MergeRequestApprovalState, type GitLabContent, type GitLabCreateUpdateFileResponse, type GitLabSearchResponse, type GitLabGroupProjectsResponse, type GitLabCommit, type GitLabEventsResponse, type GitLabCommitsResponse, type GitLabIssuesResponse, type GitLabMergeRequestsResponse, type GitLabWikiPage, type GitLabWikiPagesResponse, type GitLabWikiAttachment, type WikiPageFormat, type FileOperation, type GitLabMembersResponse, type GitLabNote, type GitLabNotesResponse, type GitLabDiscussionsResponse, type GitLabDiscussion, type GitLabPipeline, type GitLabPipelinesResponse, type GitLabJob, type GitLabJobsResponse, type GitLabEnvironment, type GitLabEnvironmentsResponse, type GitLabBranchesResponse, type GitLabTag, type GitLabTagsResponse, type GitLabCompareResult, type GitLabTreeResponse, type GitLabRelease, type GitLabReleasesResponse, type GitLabLabel, type GitLabLabelsResponse, type GitLabMilestone, type GitLabMilestonesResponse, type GitLabMergeRequestChanges, type GitLabProtectedBranch, type GitLabProtectedBranchesResponse, type GitLabProjectDetail, type GitLabUserDetail, type GitLabUsersResponse, type GitLabGroup, type GitLabGroupsResponse } from './schemas.js'; /** * GitLab API client configuration */ export interface GitLabApiConfig { apiUrl: string; token: string; } /** * Stage status mirrors GitLab's aggregation vocabulary. */ export type StageStatus = 'failed' | 'running' | 'pending' | 'manual' | 'skipped' | 'canceled' | 'success'; /** * Discriminated union for pipeline failure pattern analysis. * * Variants: * - `no_failures`: zero failed jobs in the pipeline. * - `single`: exactly one failed job. `reason` is `null` when GitLab returned no * `failure_reason` (or an empty string). `job_id` lets the caller fetch the log. * - `shared_reason`: N≥2 failed jobs that all carry the same `failure_reason`. * `count` is the number of jobs carrying the reason. `unreasoned_count` is the * number of failed jobs with no `failure_reason` populated (≥0). When * `unreasoned_count === 0` every failure matches the diagnosis; when > 0, some * failures could not be characterized. * - `mixed`: N≥2 failed jobs with at least two distinct `failure_reason` values. * `reasons` maps each reason to its count. `unreasoned_count` is the number of * failed jobs whose `failure_reason` was missing/empty and could not be * bucketed into `reasons` (≥0); `sum(reasons) + unreasoned_count` equals the * total number of failed jobs. * - `unknown`: N≥2 failed jobs where every `failure_reason` is missing/empty. * GitLab gave us nothing to characterize; `count` is the total failure count. */ export type FailurePattern = { kind: 'no_failures'; } | { kind: 'single'; reason: string | null; job_id: number; } | { kind: 'shared_reason'; reason: string; count: number; unreasoned_count: number; } | { kind: 'mixed'; reasons: Record; unreasoned_count: number; } | { kind: 'unknown'; count: number; }; /** * Response type for get_pipeline_summary tool. */ export interface PipelineSummaryResponse { pipeline: GitLabPipeline; stages: Array<{ name: string; status: StageStatus; jobs: Array; }>; truncated: boolean; summary: { total_jobs: number; passed: number; failed: number; skipped: number; manual: number; canceled: number; failure_pattern: FailurePattern; log_fetch_errors?: Array<{ job_id: number; error: string; }>; /** * Present when `failed > max_failed_jobs_with_logs` and the helper * intentionally skipped fetching logs for the trailing failures (cap * default 5). `fetched` is how many had logs attached; `total_failed` * is the full failure count. Absence means no cap-skipping happened. */ log_fetch_capped?: { fetched: number; total_failed: number; }; }; } /** * Response type for get_job_log_smart tool. */ export interface JobLogSmartResponse { job_id: number; log: string; line_count: number; truncated: boolean; sections_found: string[]; section_matched: boolean | null; error_lines_matched: number | null; } /** * GitLab API client for interacting with GitLab resources */ export declare class GitLabApi { private apiUrl; private token; constructor(config: GitLabApiConfig); /** * Forks a GitLab project to a specified namespace. * * @param projectId - The ID or URL-encoded path of the project to fork * @param namespace - Optional namespace to fork the project into * @returns A promise that resolves to the forked project details * @throws Will throw an error if the GitLab API request fails */ forkProject(projectId: string, namespace?: string): Promise; /** * Creates a new branch in a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Options for creating the branch, including name and ref * @returns A promise that resolves to the created branch details * @throws Will throw an error if the GitLab API request fails */ createBranch(projectId: string, options: z.infer): Promise; /** * Retrieves the default branch reference for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @returns A promise that resolves to the default branch reference * @throws Will throw an error if the GitLab API request fails */ getDefaultBranchRef(projectId: string): Promise; /** * Retrieves the contents of a file from a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param filePath - The path of the file within the project * @param ref - The name of the branch, tag, or commit * @returns A promise that resolves to the file contents * @throws Will throw an error if the GitLab API request fails */ getFileContents(projectId: string, filePath: string, ref: string): Promise; /** * Creates or updates a file in a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param filePath - The path of the file within the project * @param content - The content of the file * @param commitMessage - The commit message for the change * @param branch - The branch to commit the change to * @param previousPath - Optional previous path if the file is being renamed * @returns A promise that resolves to the created or updated file details * @throws Will throw an error if the GitLab API request fails */ createOrUpdateFile(projectId: string, filePath: string, content: string, commitMessage: string, branch: string, previousPath?: string): Promise; /** * Creates a commit in a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param message - The commit message * @param branch - The branch to commit the changes to * @param actions - An array of file operations to include in the commit * @returns A promise that resolves to the created commit details * @throws Will throw an error if the GitLab API request fails */ createCommit(projectId: string, message: string, branch: string, actions: FileOperation[]): Promise; /** * Searches for GitLab projects based on a query. * * @param query - The search query * @param page - The page number to retrieve (default is 1) * @param perPage - The number of results per page (default is 20) * @returns A promise that resolves to the search results * @throws Will throw an error if the GitLab API request fails */ searchProjects(query: string, page?: number, perPage?: number): Promise; /** * Lists all projects (repositories) within a specific GitLab group. * * @param groupId - The ID or URL-encoded path of the group * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the list of group projects * @throws Will throw an error if the GitLab API request fails */ listGroupProjects(groupId: string, options?: { archived?: boolean; visibility?: 'public' | 'internal' | 'private'; order_by?: 'id' | 'name' | 'path' | 'created_at' | 'updated_at' | 'last_activity_at'; sort?: 'asc' | 'desc'; search?: string; simple?: boolean; include_subgroups?: boolean; page?: number; per_page?: number; }): Promise; /** * Retrieves events for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the events response * @throws Will throw an error if the GitLab API request fails */ getProjectEvents(projectId: string, options?: { action?: string; target_type?: string; before?: string; after?: string; sort?: "asc" | "desc"; page?: number; per_page?: number; }): Promise; /** * Retrieves commits for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the commits response * @throws Will throw an error if the GitLab API request fails */ listCommits(projectId: string, options?: { sha?: string; since?: string; until?: string; path?: string; all?: boolean; with_stats?: boolean; first_parent?: boolean; page?: number; per_page?: number; }): Promise; /** * Retrieves issues for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the issues response * @throws Will throw an error if the GitLab API request fails */ listIssues(projectId: string, options?: { iid?: number | string; state?: "opened" | "closed" | "all"; labels?: string; milestone?: string; scope?: "created_by_me" | "assigned_to_me" | "all"; author_id?: number; assignee_id?: number; search?: string; created_after?: string; created_before?: string; updated_after?: string; updated_before?: string; order_by?: string; sort?: "asc" | "desc"; page?: number; per_page?: number; }): Promise; /** * Retrieves merge requests for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the merge requests response * @throws Will throw an error if the GitLab API request fails */ listMergeRequests(projectId: string, options?: { state?: "opened" | "closed" | "locked" | "merged" | "all"; order_by?: "created_at" | "updated_at"; sort?: "asc" | "desc"; milestone?: string; labels?: string; created_after?: string; created_before?: string; updated_after?: string; updated_before?: string; scope?: "created_by_me" | "assigned_to_me" | "all"; author_id?: number; assignee_id?: number; search?: string; source_branch?: string; target_branch?: string; wip?: "yes" | "no"; page?: number; per_page?: number; }): Promise; /** * Creates a new issue in a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Options for creating the issue, including title, description, assignee IDs, milestone ID, and labels * @returns A promise that resolves to the created issue details * @throws Will throw an error if the GitLab API request fails */ createIssue(projectId: string, options: z.infer): Promise; /** * Creates a new merge request in a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Options for creating the merge request, including title, description, source branch, target branch, allow collaboration, and draft status * @returns A promise that resolves to the created merge request details * @throws Will throw an error if the GitLab API request fails */ createMergeRequest(projectId: string, options: z.infer): Promise; /** * Creates a new repository in GitLab. * * @param options - Options for creating the repository, including name, description, visibility, and initialization with README * @returns A promise that resolves to the created repository details * @throws Will throw an error if the GitLab API request fails */ createRepository(options: z.infer): Promise; /** * Lists all wiki pages for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Optional parameters for the request * @returns A promise that resolves to the wiki pages response * @throws Will throw an error if the GitLab API request fails */ listProjectWikiPages(projectId: string, options?: { with_content?: boolean; }): Promise; /** * Gets a specific wiki page for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param slug - The slug of the wiki page * @param options - Optional parameters for the request * @returns A promise that resolves to the wiki page * @throws Will throw an error if the GitLab API request fails */ getProjectWikiPage(projectId: string, slug: string, options?: { render_html?: boolean; version?: string; }): Promise; /** * Creates a new wiki page for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param options - Options for creating the wiki page * @returns A promise that resolves to the created wiki page * @throws Will throw an error if the GitLab API request fails */ createProjectWikiPage(projectId: string, options: { title: string; content: string; format?: WikiPageFormat; }): Promise; /** * Edits an existing wiki page for a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param slug - The slug of the wiki page * @param options - Options for editing the wiki page * @returns A promise that resolves to the edited wiki page * @throws Will throw an error if the GitLab API request fails */ editProjectWikiPage(projectId: string, slug: string, options: { title?: string; content?: string; format?: WikiPageFormat; }): Promise; /** * Deletes a wiki page from a GitLab project. * * @param projectId - The ID or URL-encoded path of the project * @param slug - The slug of the wiki page * @returns A promise that resolves when the wiki page is deleted * @throws Will throw an error if the GitLab API request fails */ deleteProjectWikiPage(projectId: string, slug: string): Promise; /** * Uploads an attachment to a GitLab project wiki. * * @param projectId - The ID or URL-encoded path of the project * @param options - Options for uploading the attachment * @returns A promise that resolves to the uploaded attachment details * @throws Will throw an error if the GitLab API request fails */ uploadProjectWikiAttachment(projectId: string, options: { file_path: string; content: string; content_encoding?: 'utf8' | 'base64'; branch?: string; }): Promise; /** * Lists all wiki pages for a GitLab group. * * @param groupId - The ID or URL-encoded path of the group * @param options - Optional parameters for the request * @returns A promise that resolves to the wiki pages response * @throws Will throw an error if the GitLab API request fails */ listGroupWikiPages(groupId: string, options?: { with_content?: boolean; }): Promise; /** * Gets a specific wiki page for a GitLab group. * * @param groupId - The ID or URL-encoded path of the group * @param slug - The slug of the wiki page * @param options - Optional parameters for the request * @returns A promise that resolves to the wiki page * @throws Will throw an error if the GitLab API request fails */ getGroupWikiPage(groupId: string, slug: string, options?: { render_html?: boolean; version?: string; }): Promise; /** * Creates a new wiki page for a GitLab group. * * @param groupId - The ID or URL-encoded path of the group * @param options - Options for creating the wiki page * @returns A promise that resolves to the created wiki page * @throws Will throw an error if the GitLab API request fails */ createGroupWikiPage(groupId: string, options: { title: string; content: string; format?: WikiPageFormat; }): Promise; /** * Edits an existing wiki page for a GitLab group. * * @param groupId - The ID or URL-encoded path of the group * @param slug - The slug of the wiki page * @param options - Options for editing the wiki page * @returns A promise that resolves to the edited wiki page * @throws Will throw an error if the GitLab API request fails */ editGroupWikiPage(groupId: string, slug: string, options: { title?: string; content?: string; format?: WikiPageFormat; }): Promise; /** * Deletes a wiki page from a GitLab group. * * @param groupId - The ID or URL-encoded path of the group * @param slug - The slug of the wiki page * @returns A promise that resolves when the wiki page is deleted * @throws Will throw an error if the GitLab API request fails */ deleteGroupWikiPage(groupId: string, slug: string): Promise; /** * Uploads an attachment to a GitLab group wiki. * * @param groupId - The ID or URL-encoded path of the group * @param options - Options for uploading the attachment * @returns A promise that resolves to the uploaded attachment details * @throws Will throw an error if the GitLab API request fails */ uploadGroupWikiAttachment(groupId: string, options: { file_path: string; content: string; content_encoding?: 'utf8' | 'base64'; branch?: string; }): Promise; /** * Lists members of a GitLab project (including inherited members). * * @param projectId - The ID or URL-encoded path of the project * @param options - Options for listing members * @returns A promise that resolves to the members response * @throws Will throw an error if the GitLab API request fails */ listProjectMembers(projectId: string, options?: { query?: string; page?: number; per_page?: number; }): Promise; /** * Lists members of a GitLab group (including inherited members). * * @param groupId - The ID or URL-encoded path of the group * @param options - Options for listing members * @returns A promise that resolves to the members response * @throws Will throw an error if the GitLab API request fails */ listGroupMembers(groupId: string, options?: { query?: string; page?: number; per_page?: number; }): Promise; /** * Retrieves notes for a GitLab issue. * * @param projectId - The ID or URL-encoded path of the project * @param issueIid - The internal ID of the issue * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the notes response * @throws Will throw an error if the GitLab API request fails */ getIssueNotes(projectId: string, issueIid: number, options?: { sort?: "asc" | "desc"; order_by?: "created_at" | "updated_at"; page?: number; per_page?: number; }): Promise; /** * Retrieves discussions for a GitLab issue. * * @param projectId - The ID or URL-encoded path of the project * @param issueIid - The internal ID of the issue * @param options - Optional parameters for pagination * @returns A promise that resolves to the discussions response * @throws Will throw an error if the GitLab API request fails */ getIssueDiscussions(projectId: string, issueIid: number, options?: { page?: number; per_page?: number; }): Promise; /** * Approves a merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param sha - Optional SHA to ensure the MR hasn't changed * @returns A promise that resolves to the merge request details * @throws Will throw an error if the GitLab API request fails */ approveMergeRequest(projectId: string, mergeRequestIid: number, sha?: string): Promise; /** * Removes approval from a merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @returns A promise that resolves to the approval state object returned by GitLab * @throws Will throw an error if the GitLab API request fails */ unapproveMergeRequest(projectId: string, mergeRequestIid: number): Promise; /** * Merges a merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param options - Optional merge options * @returns A promise that resolves to the merge request details * @throws Will throw an error if the GitLab API request fails */ mergeMergeRequest(projectId: string, mergeRequestIid: number, options?: { merge_commit_message?: string; squash_commit_message?: string; squash?: boolean; should_remove_source_branch?: boolean; sha?: string; }): Promise; /** * Sets a merge request to merge when the pipeline succeeds (auto-merge). * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param options - Optional merge options * @returns A promise that resolves to the merge request details * @throws Will throw an error if the GitLab API request fails */ setAutoMerge(projectId: string, mergeRequestIid: number, options?: { merge_commit_message?: string; squash_commit_message?: string; squash?: boolean; should_remove_source_branch?: boolean; sha?: string; }): Promise; /** * Cancels auto-merge for a merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @returns A promise that resolves to the merge request details * @throws Will throw an error if the GitLab API request fails */ cancelAutoMerge(projectId: string, mergeRequestIid: number): Promise; /** * Retrieves notes for a GitLab merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param options - Optional parameters for filtering and pagination * @returns A promise that resolves to the notes response * @throws Will throw an error if the GitLab API request fails */ getMergeRequestNotes(projectId: string, mergeRequestIid: number, options?: { sort?: "asc" | "desc"; order_by?: "created_at" | "updated_at"; page?: number; per_page?: number; }): Promise; /** * Creates a note on a GitLab merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param body - The content of the note * @param internal - Whether the note is internal (optional) * @returns A promise that resolves to the created note * @throws Will throw an error if the GitLab API request fails */ createMergeRequestNote(projectId: string, mergeRequestIid: number, body: string, internal?: boolean): Promise; /** * Updates a note on a GitLab merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param noteId - The ID of the note to update * @param body - The updated content of the note * @returns A promise that resolves to the updated note * @throws Will throw an error if the GitLab API request fails */ updateMergeRequestNote(projectId: string, mergeRequestIid: number, noteId: number, body: string): Promise; /** * Retrieves discussions for a GitLab merge request. * * @param projectId - The ID or URL-encoded path of the project * @param mergeRequestIid - The internal ID of the merge request * @param options - Optional parameters for pagination * @returns A promise that resolves to the discussions response * @throws Will throw an error if the GitLab API request fails */ getMergeRequestDiscussions(projectId: string, mergeRequestIid: number, options?: { page?: number; per_page?: number; }): Promise; listPipelines(projectId: string, options?: { status?: string; ref?: string; sha?: string; yaml_errors?: boolean; username?: string; updated_after?: string; updated_before?: string; order_by?: string; sort?: string; page?: number; per_page?: number; }): Promise; getPipeline(projectId: string, pipelineId: number): Promise; triggerPipeline(projectId: string, ref: string, variables?: Array<{ key: string; value: string; variable_type?: string; }>): Promise; retryPipeline(projectId: string, pipelineId: number): Promise; cancelPipeline(projectId: string, pipelineId: number): Promise; listPipelineJobs(projectId: string, pipelineId: number, options?: { scope?: string[]; include_retried?: boolean; page?: number; per_page?: number; }): Promise; getJob(projectId: string, jobId: number): Promise; getJobLog(projectId: string, jobId: number): Promise; retryJob(projectId: string, jobId: number): Promise; cancelJob(projectId: string, jobId: number): Promise; /** Strip ANSI escape codes from a log string. */ private stripAnsi; /** * Strip GitLab CI section markers from a log string. * * GitLab markers occupy their own line in the format * `section_*:NNN:name\r\x1B[0K\n` * The regex tail `\r?(?:\x1B\[[0-9;]*[a-zA-Z])*\n?` consumes the optional * CR, any number of inline ANSI clear-control sequences (typically the * single `\x1B[0K` GitLab emits), and the trailing LF. This works whether * `stripAnsi` was called first (the `\x1B[NNN]` group matches zero times) * or NOT (the group consumes the orphan clear-control before the LF) - * so `get_job_log_smart` with `strip_ansi: false` no longer leaks * `\x1B[0K\n` fragments into the cleaned log. */ private stripSections; /** Strip ISO timestamp prefixes from log lines. */ private stripTimestamps; /** * Return the last `n` lines of `log`. A single trailing `\n` is treated * as the line terminator via the `endIdx` bound (NOT via a full * `log.slice(0, -1)` copy) so the memory footprint stays O(tail) instead * of the O(N) regression that allocating a normalized copy would cause. * Without the bound, `tail: 1` on `"ERROR\n"` returns `""` (codex R5). */ private logTail; /** * Return the first `n` lines of `log`. Mirrors `logTail`: trailing `\n` * is treated as terminator via `endIdx`, and the `nl >= endIdx` guard * keeps a stray `\n` at position `endIdx` from being consumed as a * meaningful line separator. O(head) memory via `indexOf`. */ private logHead; /** * Count meaningful lines in `log` without allocating substrings. * A trailing `\n` is treated as the terminator of the last line, not as * the start of a new empty line - so `"ERROR\n"` reports 1 line, matching * the contract `logTail` returns. Empty string reports 0 (avoiding the * `''.split('\n').length === 1` JS quirk). */ private countLines; /** * Clean a raw job log: strip ANSI codes, section markers, and timestamps. */ private cleanLog; /** * Analyze a set of failed jobs and return a discriminated FailurePattern. * `failure_reason` values that are null, undefined, or empty string are * treated as "unreasoned" - they do not contribute to the reason histogram * but their count is preserved via `unreasoned_count` on shared_reason or * the `unknown` variant. */ private analyzeFailurePattern; /** * Derive stage status from its jobs, mirroring GitLab's aggregation logic: * - `allow_failure: true` jobs that failed do NOT poison the stage to 'failed' * - mixed success+skipped+canceled+allow_failure-failed all collapse to 'success' * - The final safety branch is unreachable in practice when jobs are validated * by `JobStatusEnum` (closed enum at src/schemas.ts). It exists as a * schema-drift canary: if GitLab ever returns a new status value AND the * schema is relaxed to accept it, the unrecognized mix is logged via * `console.error` and the function conservatively returns 'success' rather * than throwing. */ private deriveStageStatus; /** * Fetch a pipeline summary with jobs grouped by stage and optional log tails * for failed jobs. Resolves pipeline from ref or pipeline_id. */ getPipelineSummary(projectId: string, options?: { pipeline_id?: number; ref?: string; include_logs?: boolean; log_tail_lines?: number; max_failed_jobs_with_logs?: number; }): Promise; /** * Get a job's log with intelligent filtering — strip ANSI codes, * section markers, timestamps, and extract relevant portions. */ getJobLogSmart(projectId: string, jobId: number, options?: { section?: string; tail?: number; head?: number; strip_ansi?: boolean; strip_timestamps?: boolean; error_only?: boolean; }): Promise; /** * Fetch log tails for jobs (used by list_pipeline_jobs extension). * Returns results map and any errors encountered. */ getJobLogTails(projectId: string, jobIds: number[], logLines?: number): Promise<{ tails: Map; errors: Array<{ job_id: number; error: string; }>; }>; listEnvironments(projectId: string, options?: { name?: string; search?: string; states?: string; page?: number; per_page?: number; }): Promise; getEnvironment(projectId: string, environmentId: number): Promise; listBranches(projectId: string, options?: { search?: string; regex?: string; page?: number; per_page?: number; }): Promise; deleteBranch(projectId: string, branch: string): Promise; compareBranches(projectId: string, from: string, to: string, straight?: boolean): Promise; listTags(projectId: string, options?: { search?: string; order_by?: string; sort?: string; page?: number; per_page?: number; }): Promise; createTag(projectId: string, tagName: string, ref: string, message?: string, releaseDescription?: string): Promise; getRepositoryTree(projectId: string, options?: { path?: string; ref?: string; recursive?: boolean; page?: number; per_page?: number; }): Promise; listReleases(projectId: string, options?: { order_by?: string; sort?: string; include_html_description?: boolean; page?: number; per_page?: number; }): Promise; createRelease(projectId: string, tagName: string, options?: { name?: string; description?: string; ref?: string; milestones?: string[]; released_at?: string; }): Promise; updateIssue(projectId: string, issueIid: number, options: { title?: string; description?: string; assignee_ids?: number[]; milestone_id?: number | null; labels?: string[]; state_event?: string; due_date?: string | null; confidential?: boolean; }): Promise; createIssueNote(projectId: string, issueIid: number, body: string, internal?: boolean): Promise; listLabels(projectId: string, options?: { search?: string; include_ancestor_groups?: boolean; page?: number; per_page?: number; }): Promise; createLabel(projectId: string, name: string, color: string, description?: string, priority?: number): Promise; updateLabel(projectId: string, labelId: number, options: { new_name?: string; color?: string; description?: string; priority?: number | null; }): Promise; listMilestones(projectId: string, options?: { iids?: number[]; state?: string; title?: string; search?: string; include_parent_milestones?: boolean; page?: number; per_page?: number; }): Promise; createMilestone(projectId: string, title: string, options?: { description?: string; due_date?: string; start_date?: string; }): Promise; updateMilestone(projectId: string, milestoneId: number, options: { title?: string; description?: string; due_date?: string | null; start_date?: string | null; state_event?: string; }): Promise; getMergeRequestChanges(projectId: string, mergeRequestIid: number, accessRawDiffs?: boolean): Promise; getMergeRequestCommits(projectId: string, mergeRequestIid: number, options?: { page?: number; per_page?: number; }): Promise; updateMergeRequest(projectId: string, mergeRequestIid: number, options: { title?: string; description?: string; target_branch?: string; assignee_ids?: number[]; reviewer_ids?: number[]; labels?: string[]; milestone_id?: number | null; state_event?: string; remove_source_branch?: boolean; squash?: boolean; draft?: boolean; }): Promise; rebaseMergeRequest(projectId: string, mergeRequestIid: number, skipCi?: boolean): Promise<{ rebase_in_progress: boolean; }>; createMergeRequestDiscussion(projectId: string, mergeRequestIid: number, body: string, position?: { base_sha: string; start_sha: string; head_sha: string; position_type: string; old_path?: string; new_path?: string; old_line?: number | null; new_line?: number | null; }): Promise; listProtectedBranches(projectId: string, options?: { search?: string; page?: number; per_page?: number; }): Promise; protectBranch(projectId: string, name: string, options?: { push_access_level?: number; merge_access_level?: number; allow_force_push?: boolean; code_owner_approval_required?: boolean; }): Promise; unprotectBranch(projectId: string, name: string): Promise; getProject(projectId: string, options?: { statistics?: boolean; license?: boolean; with_custom_attributes?: boolean; }): Promise; updateProject(projectId: string, options: { name?: string; description?: string; default_branch?: string; visibility?: string; issues_enabled?: boolean; merge_requests_enabled?: boolean; wiki_enabled?: boolean; jobs_enabled?: boolean; archived?: boolean; }): Promise; getCurrentUser(): Promise; listUsers(options?: { username?: string; search?: string; active?: boolean; blocked?: boolean; external?: boolean; order_by?: string; sort?: string; page?: number; per_page?: number; }): Promise; getUser(userId: number): Promise; listGroups(options?: { search?: string; owned?: boolean; min_access_level?: number; top_level_only?: boolean; order_by?: string; sort?: string; page?: number; per_page?: number; }): Promise; getGroup(groupId: string, options?: { with_custom_attributes?: boolean; with_projects?: boolean; }): Promise; listGroupSubgroups(groupId: string, options?: { search?: string; owned?: boolean; min_access_level?: number; order_by?: string; sort?: string; page?: number; per_page?: number; }): Promise; createGroup(name: string, path: string, options?: { description?: string; visibility?: string; parent_id?: number; project_creation_level?: string; subgroup_creation_level?: string; }): Promise; updateGroup(groupId: string, options: { name?: string; path?: string; description?: string; visibility?: string; project_creation_level?: string; subgroup_creation_level?: string; }): Promise; deleteGroup(groupId: string): Promise; }