types.d.ts 1.2 KB
Newer Older
T
Tomas Vik 已提交
1
/* eslint-disable camelcase */
2 3 4 5 6 7 8 9

/**
 * An issuable instance repesents one of these entities:
 *  - Merge Request
 *  - Issue
 *  - Epic
 *  - Snippet
 */
T
Tomas Vik 已提交
10 11 12 13 14 15
interface RestIssuable {
  id: number;
  iid: number;
  title: string;
  project_id: number;
  web_url: string;
16
  author: { name: string; avatar_url: string | null };
17 18 19
  references: {
    full: string; // e.g. "gitlab-org/gitlab#219925"
  };
20 21
  severity: string;
  name: string;
T
Tomas Vik 已提交
22 23
}

T
Tomas Vik 已提交
24 25 26 27
interface RestMr extends RestIssuable {
  sha: string;
}

28
interface RestMrVersion {
T
Tomas Vik 已提交
29 30
  head_commit_sha: string;
  base_commit_sha: string;
T
Tomas Vik 已提交
31
  start_commit_sha: string;
32 33 34 35
  diffs: RestDiffFile[];
}

interface RestDiffFile {
T
Tomas Vik 已提交
36 37 38 39 40
  new_path: string;
  old_path: string;
  deleted_file: boolean;
  new_file: boolean;
  renamed_file: boolean;
41
  diff: string;
T
Tomas Vik 已提交
42 43 44 45 46 47 48 49 50 51
}

interface RestVulnerability {
  location?: {
    file: string;
  };
  web_url: string;
  severity: string;
  name: string;
}
52 53 54 55 56

interface RestPipeline {
  status: 'running' | 'pending' | 'success' | 'failed' | 'canceled' | 'skipped';
  updated_at: string;
  id: number;
57
  project_id: number;
58
  web_url: string;
59
}
60 61 62 63 64 65 66 67

// Incomplete reference of the GitLab user model
interface RestUser {
  id: number;
  username: string;
  email: string;
  state: string;
}