From 094feaa4364edfc0f0293aa109eb4f3adac30509 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Mon, 12 Jun 2017 10:42:30 +0200 Subject: [PATCH] feat: extend github api Add api call to fetch pull request comments --- src/github.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/github.ts b/src/github.ts index 726018eb..38dfce59 100644 --- a/src/github.ts +++ b/src/github.ts @@ -27,6 +27,8 @@ export interface GitHub { issues(owner: string, repo: string, parameters?: IssuesParameters): Promise>; + getPullRequestComments(owner: string, repo: string, number: number): Promise>; + } export interface GitHubResponse { @@ -35,6 +37,13 @@ export interface GitHubResponse { body: T; } +export interface PullRequestComment { + diff_hunk: string; + path: string; + position: number; + body: string; +} + export interface Issue { html_url: string; number: number; @@ -210,7 +219,7 @@ namespace impl { @Headers('Accept: application/vnd.github.polaris-preview') @Get('/repos/:owner/:repo') - public getRepository(_owner: string, _repo: string): any {/* */} + public getRepository(): any {/* */} @Get('/repos/:owner/:repo/pulls/:number') public getPullRequest(): any {/* */} @@ -245,5 +254,8 @@ namespace impl { @Get('/repos/:owner/:repo/issues', true) public issues(): any {/* */} + @Get('/repos/:owner/:repo/pulls/:number/comments') + public getPullRequestComments(): any {/* */} + } }