types.d.ts 1.3 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
interface RestMr extends RestIssuable {
  sha: string;
26 27
  source_project_id: number;
  target_project_id: number;
28 29
  target_branch: string;
  source_branch: string;
T
Tomas Vik 已提交
30 31
}

32
interface RestMrVersion {
T
Tomas Vik 已提交
33 34
  head_commit_sha: string;
  base_commit_sha: string;
T
Tomas Vik 已提交
35
  start_commit_sha: string;
36 37 38 39
  diffs: RestDiffFile[];
}

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

interface RestVulnerability {
  location?: {
    file: string;
  };
  web_url: string;
  severity: string;
  name: string;
}
56 57 58 59 60

interface RestPipeline {
  status: 'running' | 'pending' | 'success' | 'failed' | 'canceled' | 'skipped';
  updated_at: string;
  id: number;
61
  project_id: number;
62
  web_url: string;
63
}
64 65 66 67 68 69 70 71

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