diff --git a/src/provider/gitlab/client.ts b/src/provider/gitlab/client.ts new file mode 100644 index 00000000..c12acb4f --- /dev/null +++ b/src/provider/gitlab/client.ts @@ -0,0 +1,10 @@ +import { Client, Response } from '../client'; +import { GitlabRepository } from './repository'; + +export class GitlabClient implements Client { + + public async getRepository(_rid: string): Promise> { + throw new Error('Method not implemented.'); + } + +} diff --git a/src/provider/gitlab/merge-request.ts b/src/provider/gitlab/merge-request.ts new file mode 100644 index 00000000..d5cb7ee3 --- /dev/null +++ b/src/provider/gitlab/merge-request.ts @@ -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> { + throw new Error('Method not implemented.'); + } + + public async merge(_body: MergeBody): Promise> { + throw new Error('Method not implemented.'); + } + + public async assign(_assignees: GitlabUser[]): Promise { + throw new Error('Method not implemented.'); + } + + public async unassign(): Promise { + throw new Error('Method not implemented.'); + } + + public async requestReview(_body: RequestReviewBody): Promise { + throw new Error('Method not implemented.'); + } + + public async cancelReview(_body: CancelReviewBody): Promise { + throw new Error('Method not implemented.'); + } +} diff --git a/src/provider/gitlab/repository.ts b/src/provider/gitlab/repository.ts new file mode 100644 index 00000000..982ea73a --- /dev/null +++ b/src/provider/gitlab/repository.ts @@ -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> { + throw new Error('Method not implemented.'); + } + + public async getPullRequest(_id: number): Promise> { + throw new Error('Method not implemented.'); + } + + public async createPullRequest(_body: CreatePullRequestBody): Promise> { + throw new Error('Method not implemented.'); + } + + public async getIssues(_parameters?: IssuesParameters | undefined): Promise> { + throw new Error('Method not implemented.'); + } +} diff --git a/src/provider/gitlab/user.ts b/src/provider/gitlab/user.ts new file mode 100644 index 00000000..e26764f6 --- /dev/null +++ b/src/provider/gitlab/user.ts @@ -0,0 +1,5 @@ +import { User } from '../user'; + +export class GitlabUser implements User { + public id: number; +}