export class GitLabDiffMetadataFetchGateway {
    executor;
    constructor(executor) {
        this.executor = executor;
    }
    fetchDiffMetadata(projectPath, mergeRequestNumber) {
        const encodedProject = projectPath.replace(/\//g, '%2F');
        const response = this.executor(`glab api projects/${encodedProject}/merge_requests/${mergeRequestNumber}/versions`);
        const versions = JSON.parse(response);
        const latest = versions[versions.length - 1];
        return {
            baseSha: latest.base_commit_sha,
            headSha: latest.head_commit_sha,
            startSha: latest.start_commit_sha,
        };
    }
}
//# sourceMappingURL=diffMetadataFetch.gitlab.gateway.js.map