This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add interfaces and stubs for gitlab
Relates to #166
- Loading branch information
1 parent
87f1cce
commit 802623f
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Client, Response } from '../client'; | ||
import { GitlabRepository } from './repository'; | ||
|
||
export class GitlabClient implements Client { | ||
|
||
public async getRepository(_rid: string): Promise<Response<GitlabRepository>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Response } from '../client'; | ||
import { | ||
PullRequest, | ||
MergeBody, | ||
MergeResult, | ||
RequestReviewBody, | ||
CancelReviewBody, | ||
Comment | ||
} from '../pull-request'; | ||
import { GitlabUser } from './user'; | ||
|
||
export class GitlabMergeRequest implements PullRequest { | ||
|
||
public id: number; | ||
public number: number; | ||
public state: 'open' | 'closed'; | ||
public title: string; | ||
public body: string; | ||
public url: string; | ||
public sourceBranch: string; | ||
public targetBranch: string; | ||
public mergeable?: boolean | null | undefined; | ||
|
||
public async getComments(): Promise<Response<Comment[]>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async merge(_body: MergeBody): Promise<Response<MergeResult>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async assign(_assignees: GitlabUser[]): Promise<void> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async unassign(): Promise<void> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async requestReview(_body: RequestReviewBody): Promise<void> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async cancelReview(_body: CancelReviewBody): Promise<void> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Response } from '../client'; | ||
import { Issue } from '../issue'; | ||
import { | ||
Repository, | ||
ListPullRequestsParameters, | ||
CreatePullRequestBody, | ||
IssuesParameters | ||
} from '../repository'; | ||
import { GitlabMergeRequest } from './merge-request'; | ||
|
||
export class GitlabRepository implements Repository { | ||
|
||
public name: string; | ||
public defaultBranch: string; | ||
public allowMergeCommits: boolean; | ||
public allowSquashCommits: boolean; | ||
public allowRebaseCommits: boolean; | ||
public parent: Repository | undefined; | ||
|
||
public async getPullRequests(_parameters?: ListPullRequestsParameters | undefined): | ||
Promise<Response<GitlabMergeRequest[]>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async getPullRequest(_id: number): Promise<Response<GitlabMergeRequest>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async createPullRequest(_body: CreatePullRequestBody): Promise<Response<GitlabMergeRequest>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public async getIssues(_parameters?: IssuesParameters | undefined): Promise<Response<Issue[]>> { | ||
throw new Error('Method not implemented.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { User } from '../user'; | ||
|
||
export class GitlabUser implements User<number> { | ||
public id: number; | ||
} |