import { logger } from '../../logger' ; import { gitlabApi } from './http' ; import type { GitLabMergeRequest , UpdateMergeRequest } from './types' ; export async function getMR ( repository , iid ) { logger . debug ( `getMR(${ iid })` ) ; const url = `projects/${ repository }/merge_requests/${ iid }?include_diverged_commits_count=1` ; return ( await gitlabApi . getJson < GitLabMergeRequest > ( url ) ) . body ; } export async function updateMR ( repository , iid , data ) { logger . debug ( `updateMR(${ iid })` ) ; const url = `projects/${ repository }/merge_requests/${ iid }` ; await gitlabApi . putJson ( url , { body : data , } ) ; }