forked from renovatebot/renovate
/
types.ts
94 lines (84 loc) · 2.04 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { Pr } from '../common';
// https://developer.github.com/v3/repos/statuses
// https://developer.github.com/v3/checks/runs/
export type CombinedBranchState = 'failure' | 'pending' | 'success';
export type BranchState = 'failure' | 'pending' | 'success' | 'error';
export interface GhBranchStatus {
context: string;
state: BranchState;
}
export interface CombinedBranchStatus {
state: CombinedBranchState;
statuses: GhBranchStatus[];
}
export interface Comment {
id: number;
body: string;
}
export interface GhPr extends Pr {
comments: Comment[];
mergeable: boolean;
}
export interface GhRestPr extends GhPr {
head: {
ref: string;
sha: string;
repo: { full_name: string };
};
mergeable_state: string;
number: number;
title: string;
state: string;
merged_at: string;
created_at: string;
closed_at: string;
user?: { login?: string };
}
export interface GhGraphQlPr extends GhPr {
commits: any;
reviewRequests: any;
assignees: any;
mergeStateStatus: string;
reviews: any;
baseRefName: string;
headRefName: string;
comments: Comment[] & { nodes?: { databaseId: number; body: string }[] };
labels: string[] & { nodes?: { name: string }[] };
}
export interface LocalRepoConfig {
repositoryName: string;
pushProtection: boolean;
prReviewsRequired: boolean;
repoForceRebase?: boolean;
parentRepo: string;
forkMode?: boolean;
forkToken?: string;
closedPrList: PrList | null;
openPrList: PrList | null;
prList: GhPr[] | null;
issueList: any[] | null;
mergeMethod: string;
defaultBranch: string;
repositoryOwner: string;
repository: string | null;
localDir: string;
isGhe: boolean;
renovateUsername: string;
productLinks: any;
}
export type BranchProtection = any;
export type PrList = Record<number, GhPr>;
export interface GhRepo {
isFork: boolean;
isArchived: boolean;
nameWithOwner: string;
mergeCommitAllowed: boolean;
rebaseMergeAllowed: boolean;
squashMergeAllowed: boolean;
defaultBranchRef: {
name: string;
target: {
oid: string;
};
};
}