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

Commit 802623f

Browse files
committed
feat: add interfaces and stubs for gitlab
Relates to #166
1 parent 87f1cce commit 802623f

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

src/provider/gitlab/client.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Client, Response } from '../client';
2+
import { GitlabRepository } from './repository';
3+
4+
export class GitlabClient implements Client {
5+
6+
public async getRepository(_rid: string): Promise<Response<GitlabRepository>> {
7+
throw new Error('Method not implemented.');
8+
}
9+
10+
}

src/provider/gitlab/merge-request.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Response } from '../client';
2+
import {
3+
PullRequest,
4+
MergeBody,
5+
MergeResult,
6+
RequestReviewBody,
7+
CancelReviewBody,
8+
Comment
9+
} from '../pull-request';
10+
import { GitlabUser } from './user';
11+
12+
export class GitlabMergeRequest implements PullRequest {
13+
14+
public id: number;
15+
public number: number;
16+
public state: 'open' | 'closed';
17+
public title: string;
18+
public body: string;
19+
public url: string;
20+
public sourceBranch: string;
21+
public targetBranch: string;
22+
public mergeable?: boolean | null | undefined;
23+
24+
public async getComments(): Promise<Response<Comment[]>> {
25+
throw new Error('Method not implemented.');
26+
}
27+
28+
public async merge(_body: MergeBody): Promise<Response<MergeResult>> {
29+
throw new Error('Method not implemented.');
30+
}
31+
32+
public async assign(_assignees: GitlabUser[]): Promise<void> {
33+
throw new Error('Method not implemented.');
34+
}
35+
36+
public async unassign(): Promise<void> {
37+
throw new Error('Method not implemented.');
38+
}
39+
40+
public async requestReview(_body: RequestReviewBody): Promise<void> {
41+
throw new Error('Method not implemented.');
42+
}
43+
44+
public async cancelReview(_body: CancelReviewBody): Promise<void> {
45+
throw new Error('Method not implemented.');
46+
}
47+
}

src/provider/gitlab/repository.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Response } from '../client';
2+
import { Issue } from '../issue';
3+
import {
4+
Repository,
5+
ListPullRequestsParameters,
6+
CreatePullRequestBody,
7+
IssuesParameters
8+
} from '../repository';
9+
import { GitlabMergeRequest } from './merge-request';
10+
11+
export class GitlabRepository implements Repository {
12+
13+
public name: string;
14+
public defaultBranch: string;
15+
public allowMergeCommits: boolean;
16+
public allowSquashCommits: boolean;
17+
public allowRebaseCommits: boolean;
18+
public parent: Repository | undefined;
19+
20+
public async getPullRequests(_parameters?: ListPullRequestsParameters | undefined):
21+
Promise<Response<GitlabMergeRequest[]>> {
22+
throw new Error('Method not implemented.');
23+
}
24+
25+
public async getPullRequest(_id: number): Promise<Response<GitlabMergeRequest>> {
26+
throw new Error('Method not implemented.');
27+
}
28+
29+
public async createPullRequest(_body: CreatePullRequestBody): Promise<Response<GitlabMergeRequest>> {
30+
throw new Error('Method not implemented.');
31+
}
32+
33+
public async getIssues(_parameters?: IssuesParameters | undefined): Promise<Response<Issue[]>> {
34+
throw new Error('Method not implemented.');
35+
}
36+
}

src/provider/gitlab/user.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { User } from '../user';
2+
3+
export class GitlabUser implements User<number> {
4+
public id: number;
5+
}

0 commit comments

Comments
 (0)