import { Gitlab } from '@gitbeaker/rest'; import { ContentModifications } from '../../../rhtap/modification/contentModification'; import { GitLabProject, GitLabProjectSearchParams, GitLabBranch, GitLabCommit, GitLabCommitSearchParams, GitLabMergeRequest, CreateMergeRequestOptions, MergeMergeRequestOptions, MergeResult, GitLabPipeline, GitLabPipelineSearchParams, GitLabWebhook, CreateWebhookOptions, GitLabFile, GitLabFileOperationResult, FileAction, CommitResult, GitLabVariable, CreateVariableOptions, ProjectIdentifier, ContentExtractionResult, } from '../types/gitlab.types'; /** * Interface for GitLab project operations */ export interface IGitLabProjectService { getProjects(params?: GitLabProjectSearchParams): Promise; getProject(projectId: ProjectIdentifier): Promise; setEnvironmentVariable( projectId: number, key: string, value: string, options?: CreateVariableOptions ): Promise; } /** * Interface for GitLab repository operations (branches, commits, files) */ export interface IGitLabRepositoryService { // Branch operations getBranches(projectId: ProjectIdentifier): Promise; getBranch(projectId: ProjectIdentifier, branch: string): Promise; createBranch(projectId: ProjectIdentifier, branchName: string, ref: string): Promise; // Commit operations getCommits(projectId: ProjectIdentifier, params?: GitLabCommitSearchParams): Promise; createCommit( projectId: ProjectIdentifier, branch: string, commitMessage: string, actions: FileAction[], startBranch?: string ): Promise; // File operations getFileContent( projectId: ProjectIdentifier, filePath: string, branch?: string ): Promise; createFile( projectId: ProjectIdentifier, filePath: string, branch: string, content: string, commitMessage: string ): Promise; updateFile( projectId: ProjectIdentifier, filePath: string, branch: string, content: string, commitMessage: string ): Promise; extractContentByRegex( projectId: ProjectIdentifier, filePath: string, searchPattern: RegExp, branch?: string ): Promise; } /** * Interface for GitLab merge request operations */ export interface IGitLabMergeRequestService { createMergeRequest( projectId: ProjectIdentifier, sourceBranch: string, targetBranch: string, title: string, options?: CreateMergeRequestOptions, contentModifications?: ContentModifications ): Promise; mergeMergeRequest( projectId: ProjectIdentifier, mergeRequestId: number, options?: MergeMergeRequestOptions ): Promise; } /** * Interface for GitLab pipeline operations */ export interface IGitLabPipelineService { getPipelines( projectPath: string, params?: GitLabPipelineSearchParams ): Promise; getAllPipelines(projectPath: string): Promise; getPipelineById(projectPath: string, pipelineId: number): Promise; getPipelineLogs(projectPath: string, jobId: number): Promise; cancelPipeline(projectPath: string, pipelineId: number): Promise; } /** * Interface for GitLab webhook operations */ export interface IGitLabWebhookService { configWebhook( owner: string, repo: string, webhookUrl: string, options?: CreateWebhookOptions ): Promise; } /** * Interface for the core GitLab client */ export interface IGitLabCoreClient { getClient(): InstanceType; }