export class GitHubDiffStatsFetchGateway {
    executor;
    constructor(executor) {
        this.executor = executor;
    }
    fetchDiffStats(projectPath, mergeRequestNumber) {
        try {
            const response = this.executor(`gh api repos/${projectPath}/pulls/${mergeRequestNumber}`);
            const pullRequest = JSON.parse(response);
            if (typeof pullRequest.additions !== 'number' ||
                typeof pullRequest.deletions !== 'number' ||
                typeof pullRequest.commits !== 'number') {
                return null;
            }
            return {
                commitsCount: pullRequest.commits,
                additions: pullRequest.additions,
                deletions: pullRequest.deletions,
            };
        }
        catch {
            return null;
        }
    }
}
//# sourceMappingURL=diffStatsFetch.github.gateway.js.map