import { ITGitRequestConfig } from '..'; import { ProjectId, IBranch, IPerPageParams } from '../base'; import { IProtect, IProtectRules } from './protected'; export interface IBranches { ( params: { id: ProjectId; search?: string; order_by?: 'name' | 'updated'; sort?: 'asc' | 'desc'; } & IPerPageParams, requestOptions?: ITGitRequestConfig, ): Promise; get: IBranchesGet; add: IBranchesAdd; edit: IBranchesEdit; delete: IBranchesDelete; lifecycle: IBranchesLifecycle; protect: ISetProtect; protected_branch_rules: ISetProtectRule; unprotect: IUnprotect; settings: ISettings; merge_base: IMergeBase; } export type IBranchesGet = ( params: { id: ProjectId; branch: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type IBranchesAdd = ( params: { id: ProjectId; branch_name: string; ref: string; description?: string; branch_type?: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type IBranchesEdit = ( params: { id: ProjectId; branch: string; description?: string; branch_type?: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type IBranchesDelete = ( params: { id: ProjectId; branch: string; }, requestOptions?: ITGitRequestConfig, ) => Promise<{ branch_name: string; }>; export type IBranchesLifecycle = (params: { id: ProjectId; branch_name: string }) => Promise< Array<{ create_date: string; creator: string; delete_date: string | null; delete_user: string | null; last_push_date: string | null; last_pusher: string | null; ref_name: string; }> >; export type ISetProtect = ( params: { id: ProjectId; branch: string; developers_can_push?: boolean; developers_can_merge?: boolean; push_access_level?: 0 | 30 | 40; merge_access_level?: 0 | 30 | 40; commit_force?: boolean; commit_reset?: boolean; creator_can_approve?: boolean; push_create_review?: boolean; rule_modify?: boolean; note_label?: boolean; approver_rule?: number; necessary_approver_rule?: number; suggestion_reviewer?: string; necessary_reviewer?: string; path_reviewer?: string; mr_template?: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type ISetProtectRule = ( params: { id: ProjectId; branch: string; rule_id: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type IUnprotect = ( params: { id: ProjectId; branch: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type ISettings = ( params: { id: ProjectId; auto_protect_branches?: string; branch_name_regex?: string; }, requestOptions?: ITGitRequestConfig, ) => Promise<{ limit_size: number; limit_file_size: number; limit_lfs_size: number; limit_lfs_file_size: number; branch_name_regex: string; auto_protect_branches: string; tag_name_regex: string; tag_create_push_level: number; }>; export type IMergeBase = (params: { id: ProjectId; source_project_id?: number; target_project_id?: number; source_branch: string; target_branch?: string; source_commit?: string; target_commit?: string; }) => Promise;