Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
feat: extend github api
Browse files Browse the repository at this point in the history
Add api call to fetch pull request comments
  • Loading branch information
KnisterPeter committed Jun 12, 2017
1 parent fa12bff commit 094feaa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface GitHub {

issues(owner: string, repo: string, parameters?: IssuesParameters): Promise<GitHubResponse<Issue[]>>;

getPullRequestComments(owner: string, repo: string, number: number): Promise<GitHubResponse<PullRequestComment[]>>;

}

export interface GitHubResponse<T> {
Expand All @@ -35,6 +37,13 @@ export interface GitHubResponse<T> {
body: T;
}

export interface PullRequestComment {
diff_hunk: string;
path: string;
position: number;
body: string;
}

export interface Issue {
html_url: string;
number: number;
Expand Down Expand Up @@ -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 {/* */}
Expand Down Expand Up @@ -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 {/* */}

}
}

0 comments on commit 094feaa

Please sign in to comment.