diff --git a/src/types.ts b/src/types.ts index 84e17e1f..f641d4ed 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 StApps + * Copyright (C) 2018, 2019 StApps * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, version 3. @@ -12,6 +12,65 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ + +/** + * Scope of membership + */ +export enum MembershipScope { + GROUPS = 'groups', + PROJECTS = 'projects', +} + +/** + * Scope + */ +export enum Scope { + ISSUES = 'issues', + MERGE_REQUESTS = 'merge_requests', +} + +/** + * Merge request state + */ +export enum MergeRequestState { + CLOSED = 'closed', + LOCKED = 'locked', + MERGED = 'merged', + OPENED = 'opened', +} + +/** + * Issue state + */ +export enum IssueState { + CLOSED = 'closed', + OPENED = 'opened', + REOPENED = 'reopened', +} + +/** + * Milestone state + */ +export enum MilestoneState { + ACTIVE = 'active', + CLOSED = 'closed', +} + +/** + * User state + */ +export enum UserState { + ACTIVE = 'active', + BLOCKED = 'blocked', +} + +/** + * Merge request merge status + */ +export enum MergeRequestMergeStatus { + CAN_BE_MERGED = 'can_be_merged', +} + /** * GitLab label */ @@ -138,7 +197,7 @@ export interface Milestone { iid: number; project_id: number; start_date: string; - state: string; + state: MilestoneState; title: string; updated_at: string; } @@ -162,7 +221,7 @@ export interface User { avatar_url: string; id: number; name: string; - state: string; + state: UserState; username: string; web_url: string; } @@ -186,7 +245,7 @@ export interface Issue extends ThingWithTimeStats { labels: string[]; milestone: Milestone | null; project_id: number; - state: string; + state: IssueState; title: string; updated_at: string; upvotes: number; @@ -209,7 +268,7 @@ export interface MergeRequest extends ThingWithTimeStats { iid: number; labels: Label[]; merge_commit_sha: string; - merge_status: string; + merge_status: MergeRequestMergeStatus; merge_when_pipeline_succeeds: boolean; milestone: Milestone; project_id: number; @@ -217,7 +276,7 @@ export interface MergeRequest extends ThingWithTimeStats { should_remove_source_branch: boolean; source_branch: string; source_project_id: number; - state: string; + state: MergeRequestState; target_branch: string; target_project_id: number; title: string;