feat: add types for discussions

This commit is contained in:
Karl-Philipp Wulfert
2019-02-25 17:10:56 +01:00
parent 58bb6f805b
commit 7c9b56f678

View File

@@ -72,7 +72,21 @@ export enum MergeRequestMergeStatus {
} }
/** /**
* GitLab label * A note type
*/
export enum NoteType {
DIFF_NOTE = 'DiffNote',
}
/**
* A type of a noteable thing
*/
export enum NoteableType {
MERGE_REQUST = 'MergeRequest',
}
/**
* A label
*/ */
export interface Label { export interface Label {
color: string; color: string;
@@ -81,7 +95,7 @@ export interface Label {
} }
/** /**
* GitLab commit * A commit
*/ */
export interface Commit { export interface Commit {
author_email: string; author_email: string;
@@ -96,7 +110,7 @@ export interface Commit {
} }
/** /**
* GitLab tag * A tag
*/ */
export interface Tag { export interface Tag {
commit: Commit; commit: Commit;
@@ -106,7 +120,7 @@ export interface Tag {
} }
/** /**
* GitLab namespace * A namespace
*/ */
export interface Namespace { export interface Namespace {
full_path: string; full_path: string;
@@ -117,7 +131,7 @@ export interface Namespace {
} }
/** /**
* GitLab project * A project
*/ */
export interface Project { export interface Project {
archived: boolean; archived: boolean;
@@ -157,7 +171,7 @@ export interface Project {
} }
/** /**
* GitLab tree file * A tree file
*/ */
export interface TreeFile { export interface TreeFile {
id: string; id: string;
@@ -176,7 +190,7 @@ export interface Member extends User {
} }
/** /**
* Available GitLab access levels * Available access levels
*/ */
export enum AccessLevel { export enum AccessLevel {
Guest = 10, Guest = 10,
@@ -187,7 +201,7 @@ export enum AccessLevel {
} }
/** /**
* A GitLab milestone * A milestone
*/ */
export interface Milestone { export interface Milestone {
created_at: string; created_at: string;
@@ -203,7 +217,7 @@ export interface Milestone {
} }
/** /**
* A GitLab branch * A branch
*/ */
export interface Branch { export interface Branch {
commit: Commit; commit: Commit;
@@ -215,7 +229,7 @@ export interface Branch {
} }
/** /**
* A GitLab user * A user
*/ */
export interface User { export interface User {
avatar_url: string; avatar_url: string;
@@ -227,7 +241,7 @@ export interface User {
} }
/** /**
* A GitLab issue * A issue
*/ */
export interface Issue extends ThingWithTimeStats { export interface Issue extends ThingWithTimeStats {
assignee: User; assignee: User;
@@ -254,7 +268,7 @@ export interface Issue extends ThingWithTimeStats {
} }
/** /**
* A GitLab merge request * A merge request
*/ */
export interface MergeRequest extends ThingWithTimeStats { export interface MergeRequest extends ThingWithTimeStats {
assignee: User; assignee: User;
@@ -308,7 +322,7 @@ export interface MergeRequestApproval {
} }
/** /**
* A GitLab thing with time stats * A thing with time stats
*/ */
export interface ThingWithTimeStats { export interface ThingWithTimeStats {
time_stats: { time_stats: {
@@ -320,7 +334,7 @@ export interface ThingWithTimeStats {
} }
/** /**
* A GitLab group * A group
*/ */
export interface Group { export interface Group {
avatar_url: string; avatar_url: string;
@@ -338,3 +352,42 @@ export interface Group {
visibility: string; visibility: string;
web_url: string; web_url: string;
} }
/**
* A discussion
*/
export interface Discussion {
id: string;
individual_note: boolean;
notes: Note[];
}
/**
* A note
*/
export interface Note {
attachment: null;
author: User;
body: string;
created_at: string;
id: number;
noteable_id: number;
noteable_iid: number;
noteable_type: NoteableType;
position: {
base_sha: string;
head_sha: string;
new_line: number | null;
new_path: string;
old_line: number | null;
old_path: string;
position_type: string,
start_sha: string;
};
resolvable: boolean;
resolved: boolean | undefined;
resolved_by: User | undefined;
system: boolean;
type: NoteType;
updated_at: string;
}