FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vscode-pull-request-github/src/github/interface.ts at main · moovy2/vscode-pull-request-github · GitHub
moovy2
/
vscode-pull-request-github
Public
forked from
microsoft/vscode-pull-request-github
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
vscode-pull-request-github
/
src
/
github
/
interface.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
382 lines (334 loc) · 7.81 KB
Breadcrumbs
vscode-pull-request-github
/
src
/
github
/
interface.ts
Copy path
File metadata and controls
382 lines (334 loc) · 7.81 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
ReviewStateValue
}
from
'../common/timelineEvent'
;
export
enum
PRType
{
Query
,
All
,
LocalPullRequest
,
}
export
enum
ReviewEventEnum
{
Approve
=
'APPROVE'
,
RequestChanges
=
'REQUEST_CHANGES'
,
Comment
=
'COMMENT'
,
}
export
enum
GithubItemStateEnum
{
Open
=
'OPEN'
,
Merged
=
'MERGED'
,
Closed
=
'CLOSED'
,
}
export
enum
PullRequestMergeability
{
Mergeable
,
NotMergeable
,
Conflict
,
Unknown
,
Behind
,
}
export
enum
MergeQueueState
{
AwaitingChecks
,
Locked
,
Mergeable
,
Queued
,
Unmergeable
}
export
interface
ReviewState
{
reviewer
:
IAccount
|
ITeam
;
state
:
ReviewStateValue
;
}
export
interface
ReadyForReview
{
isDraft
:
boolean
;
mergeable
:
PullRequestMergeability
;
allowAutoMerge
:
boolean
;
}
export
interface
ConvertToDraft
{
isDraft
:
boolean
;
mergeable
:
PullRequestMergeability
;
}
export
interface
IActor
{
login
:
string
;
avatarUrl
?:
string
;
url
:
string
;
}
export
enum
AccountType
{
User
=
'User'
,
Organization
=
'Organization'
,
Mannequin
=
'Mannequin'
,
Bot
=
'Bot'
}
export
function
toAccountType
(
type
:
string
)
:
AccountType
{
switch
(
type
)
{
case
'Organization'
:
return
AccountType
.
Organization
;
case
'Mannequin'
:
return
AccountType
.
Mannequin
;
case
'Bot'
:
return
AccountType
.
Bot
;
default
:
return
AccountType
.
User
;
}
}
export
interface
IAccount
extends
IActor
{
login
:
string
;
id
:
string
;
name
?:
string
;
avatarUrl
?:
string
;
url
:
string
;
email
?:
string
;
specialDisplayName
?:
string
;
accountType
:
AccountType
;
}
export
interface
ITeam
{
name
?:
string
;
avatarUrl
?:
string
;
url
:
string
;
slug
?:
string
;
org
:
string
;
id
:
string
;
}
export
interface
MergeQueueEntry
{
position
:
number
;
state
:
MergeQueueState
;
url
:
string
;
}
export
function
reviewerId
(
reviewer
:
ITeam
|
IAccount
)
:
string
{
// We can literally get different login values for copilot depending on where it's coming from (already assignee vs suggested assingee)
return
isITeam
(
reviewer
)
?
reviewer
.
id
:
(
reviewer
.
specialDisplayName
??
reviewer
.
login
)
;
}
export
function
reviewerLabel
(
reviewer
:
ITeam
|
IAccount
|
IActor
|
any
)
:
string
{
return
isITeam
(
reviewer
)
?
(
reviewer
.
name
??
reviewer
.
slug
??
reviewer
.
id
)
:
(
reviewer
.
specialDisplayName
??
reviewer
.
login
)
;
}
export
function
isITeam
(
reviewer
:
ITeam
|
IAccount
|
IActor
|
any
)
:
reviewer
is
ITeam
{
const
asITeam
=
reviewer
as
Partial
<
ITeam
>
;
return
!
!
asITeam
.
org
;
}
export
interface
ISuggestedReviewer
extends
IAccount
{
isAuthor
:
boolean
;
isCommenter
:
boolean
;
}
export
function
isISuggestedReviewer
(
reviewer
:
IAccount
|
ISuggestedReviewer
|
ITeam
)
:
reviewer
is
ISuggestedReviewer
{
const
asISuggestedReviewer
=
reviewer
as
Partial
<
ISuggestedReviewer
>
;
return
!
!
asISuggestedReviewer
.
isAuthor
&&
!
!
asISuggestedReviewer
.
isCommenter
;
}
export
interface
IProject
{
title
:
string
;
id
:
string
;
}
export
interface
IProjectItem
{
id
:
string
;
project
:
IProject
;
}
export
interface
IMilestone
{
title
:
string
;
dueOn
?:
string
|
null
;
createdAt
:
string
;
id
:
string
;
number
:
number
;
}
export
interface
MergePullRequest
{
sha
:
string
;
merged
:
boolean
;
message
:
string
;
documentation_url
:
string
;
}
export
interface
IRepository
{
cloneUrl
:
string
;
isInOrganization
:
boolean
;
owner
:
string
;
name
:
string
;
}
export
interface
IGitHubRef
{
label
:
string
;
ref
:
string
;
sha
:
string
;
repo
:
IRepository
;
}
export
interface
ILabel
{
name
:
string
;
color
:
string
;
description
?:
string
;
}
export
interface
IIssueComment
{
author
:
IAccount
;
body
:
string
;
databaseId
:
number
;
reactionCount
:
number
;
createdAt
:
string
;
}
export
interface
Reaction
{
label
:
string
;
count
:
number
;
icon
?:
string
;
viewerHasReacted
:
boolean
;
reactors
:
readonly
string
[
]
;
}
export
type
StateReason
=
'REOPENED'
|
'NOT_PLANNED'
|
'COMPLETED'
|
'DUPLICATE'
;
export
interface
Issue
{
id
:
number
;
graphNodeId
:
string
;
url
:
string
;
number
:
number
;
state
:
string
;
stateReason
?:
StateReason
;
body
:
string
;
bodyHTML
?:
string
;
title
:
string
;
titleHTML
:
string
;
assignees
?:
IAccount
[
]
;
createdAt
:
string
;
updatedAt
:
string
;
user
:
IAccount
;
labels
:
ILabel
[
]
;
projectItems
?:
IProjectItem
[
]
;
milestone
?:
IMilestone
;
repositoryOwner
?:
string
;
repositoryName
?:
string
;
repositoryUrl
?:
string
;
comments
?:
IIssueComment
[
]
;
commentCount
:
number
;
reactionCount
:
number
;
reactions
:
Reaction
[
]
;
issueType
?:
string
;
}
export
interface
IssueReference
{
id
:
number
;
number
:
number
;
title
:
string
;
state
:
GithubItemStateEnum
;
url
:
string
;
}
export
interface
PullRequest
extends
Issue
{
isDraft
?:
boolean
;
isRemoteHeadDeleted
?:
boolean
;
head
?:
IGitHubRef
;
isRemoteBaseDeleted
?:
boolean
;
base
?:
IGitHubRef
;
commits
:
{
message
:
string
;
}
[
]
;
merged
?:
boolean
;
mergeable
?:
PullRequestMergeability
;
mergeQueueEntry
?:
MergeQueueEntry
|
null
;
viewerCanUpdate
:
boolean
;
autoMerge
?:
boolean
;
autoMergeMethod
?:
MergeMethod
;
allowAutoMerge
?:
boolean
;
mergeCommitMeta
?:
{
title
:
string
,
description
:
string
}
;
squashCommitMeta
?:
{
title
:
string
,
description
:
string
}
;
suggestedReviewers
?:
ISuggestedReviewer
[
]
;
closingIssues
?:
IssueReference
[
]
;
hasComments
?:
boolean
;
additions
?:
number
;
deletions
?:
number
;
}
export
enum
NotificationSubjectType
{
Issue
=
'Issue'
,
PullRequest
=
'PullRequest'
}
export
interface
Notification
{
owner
:
string
;
name
:
string
;
key
:
string
;
id
:
string
,
itemID
:
string
;
subject
:
{
title
:
string
;
type
:
NotificationSubjectType
;
url
:
string
;
}
;
reason
:
string
;
unread
:
boolean
;
updatedAt
:
Date
;
lastReadAt
:
Date
|
undefined
;
}
export
interface
IRawFileChange
{
sha
:
string
;
filename
:
string
;
previous_filename
?:
string
|
undefined
;
additions
:
number
;
deletions
:
number
;
changes
:
number
;
status
:
'added'
|
'removed'
|
'modified'
|
'renamed'
|
'copied'
|
'changed'
|
'unchanged'
;
raw_url
:
string
;
blob_url
:
string
;
contents_url
:
string
;
patch
?:
string
|
undefined
;
}
export
interface
IRawFileContent
{
type
:
string
;
size
:
number
;
name
:
string
;
path
:
string
;
content
?:
string
|
undefined
;
sha
:
string
;
url
:
string
;
git_url
:
string
|
null
;
html_url
:
string
|
null
;
download_url
:
string
|
null
;
}
export
interface
IGitTreeItem
{
path
:
string
;
mode
:
'100644'
|
'100755'
|
'120000'
;
// Must contain a content or a sha.
content
?:
string
;
sha
?:
string
|
null
;
}
export
interface
IPullRequestsPagingOptions
{
fetchNextPage
:
boolean
;
fetchOnePagePerRepo
?:
boolean
;
}
export
interface
IIssueEditData
{
body
?:
string
;
title
?:
string
;
}
export
type
MergeMethod
=
'merge'
|
'squash'
|
'rebase'
;
export
type
MergeMethodsAvailability
=
{
[
method
in
MergeMethod
]
:
boolean
;
}
;
export
type
RepoAccessAndMergeMethods
=
{
hasWritePermission
:
boolean
;
mergeMethodsAvailability
:
MergeMethodsAvailability
;
viewerCanAutoMerge
:
boolean
;
}
;
export
interface
User
extends
IAccount
{
company
?:
string
;
location
?:
string
;
bio
?:
string
;
commitContributions
:
{
createdAt
:
Date
;
repoNameWithOwner
:
string
;
}
[
]
;
}
export
enum
CheckState
{
Success
=
'success'
,
Failure
=
'failure'
,
Neutral
=
'neutral'
,
Pending
=
'pending'
,
Unknown
=
'unknown'
}
export
interface
PullRequestCheckStatus
{
id
:
string
;
databaseId
:
number
|
null
|
undefined
;
url
:
string
|
undefined
;
avatarUrl
:
string
|
undefined
;
state
:
CheckState
;
description
:
string
|
null
;
targetUrl
:
string
|
null
;
context
:
string
;
// Job name
workflowName
:
string
|
undefined
;
event
:
string
|
undefined
;
isRequired
:
boolean
;
isCheckRun
:
boolean
;
}
export
interface
PullRequestChecks
{
state
:
CheckState
;
statuses
:
PullRequestCheckStatus
[
]
;
}
export
interface
PullRequestReviewRequirement
{
count
:
number
;
state
:
CheckState
;
approvals
:
string
[
]
;
requestedChanges
:
string
[
]
;
}
Back
|
FazBrowse Home
|
New Git URL