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;
T
Tomas Vik 已提交
28 29
}

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

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

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

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

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