@gitkraken/core-gitlens 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/git/cache.d.ts +31 -0
- package/dist/git/cache.js +101 -30
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +3 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +3 -1
- package/dist/git/errors.js +4 -1
- package/dist/git/errors.js.map +1 -1
- package/dist/git/models/pullRequest.d.ts +90 -1
- package/dist/git/models/pullRequest.js +18 -2
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/providers/shared/remotes.js +2 -0
- package/dist/git/providers/shared/remotes.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts +72 -1
- package/dist/git/utils/pullRequest.utils.js +99 -1
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/utils/repository.utils.d.ts +6 -0
- package/dist/git/utils/repository.utils.js +14 -2
- package/dist/git/utils/repository.utils.js.map +1 -1
- package/dist/git/watching/gitDirPoller.d.ts +10 -1
- package/dist/git/watching/gitDirPoller.js +9 -3
- package/dist/git/watching/gitDirPoller.js.map +1 -1
- package/dist/git/watching/unwatchedCacheValidator.d.ts +144 -0
- package/dist/git/watching/unwatchedCacheValidator.js +884 -0
- package/dist/git/watching/unwatchedCacheValidator.js.map +1 -0
- package/dist/git/watching/watchGroup.d.ts +2 -0
- package/dist/git/watching/watchGroup.js +4 -8
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +23 -0
- package/dist/git/watching/watchService.js +42 -2
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +2 -0
- package/dist/git/watching/watchSession.js +3 -2
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git-cli/cliGitProvider.js +1 -1
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +31 -1
- package/dist/git-cli/exec/commandClassifier.js +67 -16
- package/dist/git-cli/exec/commandClassifier.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +46 -2
- package/dist/git-cli/exec/git.js +80 -7
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitDirResolver.d.ts +11 -0
- package/dist/git-cli/exec/gitDirResolver.js +34 -1
- package/dist/git-cli/exec/gitDirResolver.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +2 -28
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +1 -0
- package/dist/git-cli/providers/branches.js +6 -0
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +13 -1
- package/dist/git-cli/providers/config.js +48 -14
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +1 -0
- package/dist/git-cli/providers/pausedOperations.js +4 -0
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/revision.js +2 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/worktrees.js +2 -0
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +25 -1
- package/dist/git-cli/service.js +45 -0
- package/dist/git-cli/service.js.map +1 -1
- package/dist/plus/ai/errors.d.ts +8 -2
- package/dist/plus/ai/errors.js +15 -3
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +51 -1
- package/dist/plus/git-github/api/github.js +276 -3
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +54 -1
- package/dist/plus/git-github/models.js +48 -3
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/integrations/fieldPresence.d.ts +6 -1
- package/dist/plus/integrations/fieldPresence.js +19 -9
- package/dist/plus/integrations/fieldPresence.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +26 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +51 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +15 -2
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +16 -1
- package/dist/plus/integrations/providers/github.js +53 -1
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/reads/etag.js +11 -0
- package/dist/plus/integrations/reads/etag.js.map +1 -1
- package/docs/integrations.md +39 -6
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { GitFileIndexStatus } from "../../git/models/fileStatus.js";
|
|
|
2
2
|
import { Provider } from "../../git/models/remoteProvider.js";
|
|
3
3
|
import { IssueOrPullRequestState } from "../../git/models/issueOrPullRequest.js";
|
|
4
4
|
import { Issue, IssueLabel, IssueProjection } from "../../git/models/issue.js";
|
|
5
|
-
import { PullRequest, PullRequestMergeableState, PullRequestProjection, PullRequestReviewDecision, PullRequestReviewState, PullRequestStatusCheckRollupState } from "../../git/models/pullRequest.js";
|
|
5
|
+
import { PullRequest, PullRequestMergeQueueEntry, PullRequestMergeQueueRemoval, PullRequestMergeQueueState, PullRequestMergeableState, PullRequestProjection, PullRequestReviewDecision, PullRequestReviewState, PullRequestStatusCheckRollupState } from "../../git/models/pullRequest.js";
|
|
6
6
|
import { Endpoints } from "@octokit/types";
|
|
7
7
|
//#region ../plus/git-github/src/models.d.ts
|
|
8
8
|
export interface GitHubBlame {
|
|
@@ -149,6 +149,39 @@ export interface GitHubPullRequestLite extends Omit<GitHubIssueOrPullRequest, '_
|
|
|
149
149
|
stackEntry?: {
|
|
150
150
|
position: number;
|
|
151
151
|
} | null;
|
|
152
|
+
/** Only selected against github.com — see `stack`. `null` when the pull request isn't queued. */
|
|
153
|
+
mergeQueueEntry?: GitHubMergeQueueEntry | null;
|
|
154
|
+
/** Only selected against github.com — see `stack`. True whenever the base branch requires a merge queue, whatever
|
|
155
|
+
* the pull request's state. */
|
|
156
|
+
isMergeQueueEnabled?: boolean;
|
|
157
|
+
/** Only selected against github.com — see `stack`. The latest merge-queue event only (`timelineItems(last: 1)`). */
|
|
158
|
+
mergeQueueEvents?: GitHubMergeQueueEvents | null;
|
|
159
|
+
}
|
|
160
|
+
/** The `timelineItems` of a pull request filtered to its merge-queue events, as GitLens selects them. */
|
|
161
|
+
export interface GitHubMergeQueueEvents {
|
|
162
|
+
nodes: (GitHubMergeQueueEvent | null)[] | null;
|
|
163
|
+
}
|
|
164
|
+
/** A merge-queue timeline event. Only a removal's fields are selected: the latest event being an addition is all an
|
|
165
|
+
* addition says. */
|
|
166
|
+
export type GitHubMergeQueueEvent = {
|
|
167
|
+
__typename: 'AddedToMergeQueueEvent';
|
|
168
|
+
} | {
|
|
169
|
+
__typename: 'RemovedFromMergeQueueEvent';
|
|
170
|
+
createdAt: string;
|
|
171
|
+
reason: string | null;
|
|
172
|
+
};
|
|
173
|
+
export type GitHubMergeQueueEntryState = 'QUEUED' | 'AWAITING_CHECKS' | 'MERGEABLE' | 'UNMERGEABLE' | 'LOCKED';
|
|
174
|
+
/** GitHub's `MergeQueueEntry`, as GitLens selects it. */
|
|
175
|
+
export interface GitHubMergeQueueEntry {
|
|
176
|
+
state: GitHubMergeQueueEntryState;
|
|
177
|
+
enqueuedAt: string;
|
|
178
|
+
/** Seconds from when it was read. */
|
|
179
|
+
estimatedTimeToMerge: number | null;
|
|
180
|
+
mergeQueue: {
|
|
181
|
+
url: string;
|
|
182
|
+
} | null;
|
|
183
|
+
/** 1-based, in enqueue order. */
|
|
184
|
+
position: number | null;
|
|
152
185
|
}
|
|
153
186
|
/** GitHub's stacked-pull-request object. Read-only; all stack mutations are REST-only. */
|
|
154
187
|
export interface GitHubPullRequestStack {
|
|
@@ -261,6 +294,10 @@ export interface GitHubPullRequestEtagNode extends Pick<GitHubPullRequest, 'id'
|
|
|
261
294
|
};
|
|
262
295
|
}[];
|
|
263
296
|
};
|
|
297
|
+
/** Always selected, but only against github.com, like the full read's. `null` when the pull request isn't queued. */
|
|
298
|
+
mergeQueueEntry?: Pick<GitHubMergeQueueEntry, 'state' | 'enqueuedAt'> | null;
|
|
299
|
+
/** Always selected, but only against github.com, exactly as the full read selects it. */
|
|
300
|
+
mergeQueueEvents?: GitHubMergeQueueEvents | null;
|
|
264
301
|
}
|
|
265
302
|
/**
|
|
266
303
|
* An input beyond an issue's lifecycle fields that `GitHubApi.getIssuesEtagFieldsBatch` can select. Mirrors the
|
|
@@ -279,6 +316,22 @@ export interface GitHubIssueEtagNode extends Pick<GitHubIssue, 'id' | 'number' |
|
|
|
279
316
|
}
|
|
280
317
|
export type GitHubViewerPermission = 'ADMIN' | 'MAINTAIN' | 'WRITE' | 'TRIAGE' | 'READ' | 'NONE';
|
|
281
318
|
export declare function fromGitHubPullRequestLite(pr: GitHubPullRequestLite, provider: Provider, projection?: PullRequestProjection): PullRequest;
|
|
319
|
+
/**
|
|
320
|
+
* The one place a GitHub `MergeQueueEntry` becomes a {@link PullRequestMergeQueueEntry}, whichever read selected it.
|
|
321
|
+
* GitHub's estimate is a duration from the moment it answered, so it's fixed to a date here, at read time, rather
|
|
322
|
+
* than added to the clock at each render, where a held entry would never count down.
|
|
323
|
+
*/
|
|
324
|
+
export declare function fromGitHubMergeQueueEntry(entry: GitHubMergeQueueEntry): PullRequestMergeQueueEntry;
|
|
325
|
+
/**
|
|
326
|
+
* The pull request's latest removal from its merge queue, from its latest merge-queue event: set only when that
|
|
327
|
+
* event is a removal (so it hasn't rejoined since) whose reason isn't `merged` (GitHub removes every merged entry
|
|
328
|
+
* with that reason). Absent on GitHub Enterprise Server (never selected). Shared by the full read and the etag's
|
|
329
|
+
* cheap check, so both derive the same removal.
|
|
330
|
+
*/
|
|
331
|
+
export declare function fromGitHubMergeQueueRemoval(events: GitHubMergeQueueEvents | null | undefined): PullRequestMergeQueueRemoval | undefined;
|
|
332
|
+
/** A state GitHub adds later still means the pull request is in the queue, so it reads as Queued rather than
|
|
333
|
+
* dropping the entry, which would report a queued pull request as not queued. */
|
|
334
|
+
export declare function fromGitHubMergeQueueEntryState(state: GitHubMergeQueueEntryState): PullRequestMergeQueueState;
|
|
282
335
|
export declare function fromGitHubIssueOrPullRequestState(state: GitHubPullRequestState): IssueOrPullRequestState;
|
|
283
336
|
export declare function toGitHubPullRequestState(state: IssueOrPullRequestState): GitHubPullRequestState;
|
|
284
337
|
export declare function fromGitHubPullRequestReviewDecision(reviewDecision: GitHubPullRequestReviewDecision): PullRequestReviewDecision;
|
|
@@ -56,7 +56,7 @@ function fromGitHubPullRequestLite(pr, provider, projection) {
|
|
|
56
56
|
isFork: pr.repository?.isFork
|
|
57
57
|
},
|
|
58
58
|
isCrossRepository: pr.isCrossRepository
|
|
59
|
-
}, pr.isDraft, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, fromGitHubPullRequestStack(pr), void 0, pr.body ?? void 0, pr.number, void 0, projection, void 0, void 0, fromGitHubMilestone(pr.milestone));
|
|
59
|
+
}, pr.isDraft, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, fromGitHubPullRequestStack(pr), void 0, pr.body ?? void 0, pr.number, void 0, projection, void 0, void 0, fromGitHubMilestone(pr.milestone), fromGitHubPullRequestMergeQueueEntry(pr), pr.isMergeQueueEnabled, fromGitHubMergeQueueRemoval(pr.mergeQueueEvents));
|
|
60
60
|
}
|
|
61
61
|
/** `undefined` only for a node from a selection that left the milestone out, which no fragment does today. */
|
|
62
62
|
function fromGitHubMilestone(milestone) {
|
|
@@ -80,6 +80,51 @@ function fromGitHubPullRequestStack(pr) {
|
|
|
80
80
|
baseRef: pr.stack.baseRefName
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
+
/** Absent on GitHub Enterprise Server (never selected) and `null` when the pull request isn't queued. */
|
|
84
|
+
function fromGitHubPullRequestMergeQueueEntry(pr) {
|
|
85
|
+
return pr.mergeQueueEntry != null ? fromGitHubMergeQueueEntry(pr.mergeQueueEntry) : void 0;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The one place a GitHub `MergeQueueEntry` becomes a {@link PullRequestMergeQueueEntry}, whichever read selected it.
|
|
89
|
+
* GitHub's estimate is a duration from the moment it answered, so it's fixed to a date here, at read time, rather
|
|
90
|
+
* than added to the clock at each render, where a held entry would never count down.
|
|
91
|
+
*/
|
|
92
|
+
function fromGitHubMergeQueueEntry(entry) {
|
|
93
|
+
return {
|
|
94
|
+
state: fromGitHubMergeQueueEntryState(entry.state),
|
|
95
|
+
enqueuedAt: new Date(entry.enqueuedAt),
|
|
96
|
+
estimatedMergeAt: entry.estimatedTimeToMerge != null ? new Date(Date.now() + entry.estimatedTimeToMerge * 1e3) : void 0,
|
|
97
|
+
url: entry.mergeQueue?.url,
|
|
98
|
+
position: entry.position ?? void 0
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The pull request's latest removal from its merge queue, from its latest merge-queue event: set only when that
|
|
103
|
+
* event is a removal (so it hasn't rejoined since) whose reason isn't `merged` (GitHub removes every merged entry
|
|
104
|
+
* with that reason). Absent on GitHub Enterprise Server (never selected). Shared by the full read and the etag's
|
|
105
|
+
* cheap check, so both derive the same removal.
|
|
106
|
+
*/
|
|
107
|
+
function fromGitHubMergeQueueRemoval(events) {
|
|
108
|
+
const latest = events?.nodes?.at(-1);
|
|
109
|
+
if (latest?.__typename !== "RemovedFromMergeQueueEvent") return void 0;
|
|
110
|
+
const reason = latest.reason ?? "";
|
|
111
|
+
if (reason.toLowerCase() === "merged") return void 0;
|
|
112
|
+
return {
|
|
113
|
+
reason,
|
|
114
|
+
removedAt: new Date(latest.createdAt)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/** A state GitHub adds later still means the pull request is in the queue, so it reads as Queued rather than
|
|
118
|
+
* dropping the entry, which would report a queued pull request as not queued. */
|
|
119
|
+
function fromGitHubMergeQueueEntryState(state) {
|
|
120
|
+
switch (state) {
|
|
121
|
+
case "AWAITING_CHECKS": return "AwaitingChecks";
|
|
122
|
+
case "MERGEABLE": return "Mergeable";
|
|
123
|
+
case "UNMERGEABLE": return "Unmergeable";
|
|
124
|
+
case "LOCKED": return "Locked";
|
|
125
|
+
default: return "Queued";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
83
128
|
function fromGitHubIssueOrPullRequestState(state) {
|
|
84
129
|
return state === "MERGED" ? "merged" : state === "CLOSED" ? "closed" : "opened";
|
|
85
130
|
}
|
|
@@ -186,7 +231,7 @@ function fromGitHubPullRequest(pr, provider, projection) {
|
|
|
186
231
|
username: r.login,
|
|
187
232
|
avatarUrl: r.avatarUrl,
|
|
188
233
|
url: r.url
|
|
189
|
-
})), fromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state), void 0, void 0, pr.commits.totalCount, fromGitHubPullRequestStack(pr), pr.changedFiles, pr.body ?? void 0, pr.number, void 0, projection, void 0, void 0, fromGitHubMilestone(pr.milestone));
|
|
234
|
+
})), fromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state), void 0, void 0, pr.commits.totalCount, fromGitHubPullRequestStack(pr), pr.changedFiles, pr.body ?? void 0, pr.number, void 0, projection, void 0, void 0, fromGitHubMilestone(pr.milestone), fromGitHubPullRequestMergeQueueEntry(pr), pr.isMergeQueueEnabled, fromGitHubMergeQueueRemoval(pr.mergeQueueEvents));
|
|
190
235
|
}
|
|
191
236
|
function fromGitHubIssue(value, provider, projection) {
|
|
192
237
|
return new Issue({
|
|
@@ -227,6 +272,6 @@ function fromGitHubViewerPermissionToAccessLevel(permission) {
|
|
|
227
272
|
}
|
|
228
273
|
}
|
|
229
274
|
//#endregion
|
|
230
|
-
export { fromCommitFileStatus, fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubPullRequest, fromGitHubPullRequestLite, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestReviewState, fromGitHubPullRequestStatusCheckRollupState, toGitHubPullRequestMergeableState, toGitHubPullRequestReviewDecision, toGitHubPullRequestState };
|
|
275
|
+
export { fromCommitFileStatus, fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntry, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequest, fromGitHubPullRequestLite, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestReviewState, fromGitHubPullRequestStatusCheckRollupState, toGitHubPullRequestMergeableState, toGitHubPullRequestReviewDecision, toGitHubPullRequestState };
|
|
231
276
|
|
|
232
277
|
//# sourceMappingURL=models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","names":[],"sources":["../../../../plus/git-github/src/models.ts"],"sourcesContent":["import type { Endpoints } from '@octokit/types';\nimport { GitFileIndexStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { IssueLabel, IssueProjection } from '@gitlens/git/models/issue.js';\nimport { Issue, RepositoryAccessLevel } from '@gitlens/git/models/issue.js';\nimport type { IssueMilestone } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\tPullRequestMember,\n\tPullRequestProjection,\n\tPullRequestStackInfo,\n\tPullRequestState,\n} from '@gitlens/git/models/pullRequest.js';\nimport {\n\tPullRequest,\n\tPullRequestMergeableState,\n\tPullRequestReviewDecision,\n\tPullRequestReviewState,\n\tPullRequestStatusCheckRollupState,\n} from '@gitlens/git/models/pullRequest.js';\nimport type { Provider } from '@gitlens/git/models/remoteProvider.js';\n\nexport interface GitHubBlame {\n\tranges: GitHubBlameRange[];\n\tviewer?: string;\n}\n\nexport interface GitHubBlameRange {\n\tstartingLine: number;\n\tendingLine: number;\n\tcommit: GitHubCommit;\n}\n\nexport interface GitHubBranch {\n\tname: string;\n\ttarget: {\n\t\toid: string;\n\t\tauthoredDate: string;\n\t\tcommittedDate: string;\n\t};\n}\n\nexport interface GitHubCommit {\n\toid: string;\n\tparents: { nodes: { oid: string }[] };\n\tmessage: string;\n\tadditions?: number | undefined;\n\tchangedFiles?: number | undefined;\n\tdeletions?: number | undefined;\n\tauthor: { avatarUrl: string | undefined; date: string; email: string | undefined; name: string };\n\tcommitter: { date: string; email: string | undefined; name: string };\n\n\tfiles?: Endpoints['GET /repos/{owner}/{repo}/commits/{ref}']['response']['data']['files'];\n}\n\nexport interface GitHubCommitRef {\n\toid: string;\n}\n\nexport type GitHubContributor = Endpoints['GET /repos/{owner}/{repo}/contributors']['response']['data'][0];\n\nexport type GitHubSshSigningKey = Endpoints['GET /users/{username}/ssh_signing_keys']['response']['data'][0];\n\nexport interface GitHubMember {\n\tlogin: string;\n\tavatarUrl: string;\n\turl: string;\n}\n\nexport interface GitHubPagedResult<T> {\n\tpageInfo: GitHubPageInfo;\n\ttotalCount: number;\n\tvalues: T[];\n}\nexport interface GitHubPageInfo {\n\tstartCursor?: string | null;\n\tendCursor?: string | null;\n\thasNextPage: boolean;\n\thasPreviousPage: boolean;\n}\n\nexport interface GitHubTag {\n\tname: string;\n\ttarget: {\n\t\toid: string;\n\t\tauthoredDate?: string;\n\t\tcommittedDate?: string;\n\t\tmessage?: string | null;\n\t\ttagger?: {\n\t\t\tdate: string;\n\t\t} | null;\n\n\t\ttarget?: {\n\t\t\toid?: string;\n\t\t\tauthoredDate?: string;\n\t\t\tcommittedDate?: string;\n\t\t\tmessage?: string | null;\n\t\t};\n\t};\n}\n\nexport type GitHubCommitFileStatus = NonNullable<\n\tEndpoints['GET /repos/{owner}/{repo}/commits/{ref}']['response']['data']['files']\n>[0]['status'];\n\nexport function fromCommitFileStatus(status: GitHubCommitFileStatus): GitFileIndexStatus | undefined {\n\tswitch (status) {\n\t\tcase 'added':\n\t\t\treturn GitFileIndexStatus.Added;\n\t\tcase 'changed':\n\t\tcase 'modified':\n\t\t\treturn GitFileIndexStatus.Modified;\n\t\tcase 'removed':\n\t\t\treturn GitFileIndexStatus.Deleted;\n\t\tcase 'renamed':\n\t\t\treturn GitFileIndexStatus.Renamed;\n\t\tcase 'copied':\n\t\t\treturn GitFileIndexStatus.Copied;\n\t}\n\treturn undefined;\n}\n\nexport interface GitHubIssueOrPullRequest {\n\t__typename: 'Issue' | 'PullRequest';\n\n\tclosed: boolean;\n\tclosedAt: string | null;\n\tcreatedAt: string;\n\tid: string;\n\tnumber: number;\n\tstate: GitHubIssueOrPullRequestState;\n\ttitle: string;\n\tupdatedAt: string;\n\turl: string;\n}\n\nexport type GitHubIssueState = 'OPEN' | 'CLOSED';\nexport type GitHubPullRequestState = 'OPEN' | 'CLOSED' | 'MERGED';\nexport type GitHubIssueOrPullRequestState = GitHubIssueState | GitHubPullRequestState;\n\n/** GitHub's `Milestone`, as `gqlMilestoneFragment` selects it. */\nexport interface GitHubMilestone {\n\tid: string;\n\ttitle: string;\n\tstate: 'OPEN' | 'CLOSED';\n\tdueOn: string | null;\n\turl: string;\n}\n\nexport interface GitHubPullRequestLite extends Omit<GitHubIssueOrPullRequest, '__typename'> {\n\t/** `Actor` is nullable in GitHub's schema — `null` once the author's account is deleted */\n\tauthor: GitHubMember | null;\n\tbody: string | null;\n\n\tbaseRefName: string;\n\tbaseRefOid: string;\n\n\theadRefName: string;\n\theadRefOid: string;\n\theadRepository: {\n\t\tisFork: boolean;\n\t\tname: string;\n\t\towner: {\n\t\t\tlogin: string;\n\t\t};\n\t\tsshUrl: string;\n\t\turl: string;\n\t};\n\n\tisCrossRepository: boolean;\n\tisDraft: boolean;\n\tmergedAt: string | null;\n\t/** `null` when the pull request has none. */\n\tmilestone: GitHubMilestone | null;\n\tpermalink: string;\n\n\trepository: {\n\t\tisFork: boolean;\n\t\tname: string;\n\t\towner: {\n\t\t\tlogin: string;\n\t\t};\n\t\tsshUrl: string;\n\t\turl: string;\n\t\tviewerPermission: GitHubViewerPermission;\n\t};\n\n\t/** Only selected against github.com — GitHub Enterprise Server schemas lag and reject the field. */\n\tstack?: GitHubPullRequestStack | null;\n\t/** Only selected against github.com — see `stack`. */\n\tstackEntry?: { position: number } | null;\n}\n\n/** GitHub's stacked-pull-request object. Read-only; all stack mutations are REST-only. */\nexport interface GitHubPullRequestStack {\n\tid: string;\n\tnumber: number;\n\tsize: number;\n\t/** The branch the bottom of the stack targets — the stack's trunk. */\n\tbaseRefName: string;\n}\n\nexport interface GitHubIssue extends Omit<GitHubIssueOrPullRequest, '__typename'> {\n\t/** `Actor` is nullable in GitHub's schema — `null` once the author's account is deleted */\n\tauthor: GitHubMember | null;\n\tassignees: { nodes: GitHubMember[] };\n\tcomments?: {\n\t\ttotalCount: number;\n\t};\n\tlabels?: { nodes: IssueLabel[] };\n\t/** `null` when the issue has none. */\n\tmilestone: GitHubMilestone | null;\n\treactions?: {\n\t\ttotalCount: number;\n\t};\n\trepository: {\n\t\tname: string;\n\t\towner: {\n\t\t\tlogin: string;\n\t\t};\n\t\tviewerPermission: GitHubViewerPermission;\n\t\turl: string;\n\t};\n\tbody: string;\n}\n\nexport type GitHubPullRequestReviewDecision = 'CHANGES_REQUESTED' | 'APPROVED' | 'REVIEW_REQUIRED';\nexport type GitHubPullRequestMergeableState = 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN';\nexport type GitHubPullRequestStatusCheckRollupState = 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\nexport type GitHubPullRequestReviewState = 'APPROVED' | 'CHANGES_REQUESTED' | 'COMMENTED' | 'DISMISSED' | 'PENDING';\n\ntype GitHubPullRequestReview = {\n\tid: string;\n\tauthor: GitHubMember | null;\n\tstate: GitHubPullRequestReviewState;\n\tcommit?: { oid: string } | null;\n};\n\nexport interface GitHubPullRequest extends GitHubPullRequestLite {\n\tadditions: number;\n\tassignees: {\n\t\tnodes: GitHubMember[];\n\t};\n\tchangedFiles: number;\n\tchecksUrl: string;\n\tdeletions: number;\n\tmergeable: GitHubPullRequestMergeableState;\n\treviewDecision: GitHubPullRequestReviewDecision;\n\tlatestReviews: {\n\t\tnodes: GitHubPullRequestReview[];\n\t};\n\t/**\n\t * The current user's own latest review. `latestReviews` is capped, so on a heavily-reviewed pull request\n\t * the viewer's own review can fall outside that window — which is exactly the row a \"needs my review\"\n\t * surface is asking about.\n\t */\n\tviewerLatestReview: GitHubPullRequestReview | null;\n\treviewRequests: {\n\t\tnodes: {\n\t\t\tasCodeOwner: boolean;\n\t\t\t/** Empty for a team (or anything else that isn't a user), which the `... on User` selection doesn't match. */\n\t\t\trequestedReviewer: Partial<GitHubMember> | null;\n\t\t}[];\n\t};\n\tcommits: {\n\t\ttotalCount: number;\n\t\tnodes: {\n\t\t\tcommit: {\n\t\t\t\tstatusCheckRollup: {\n\t\t\t\t\tstate: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\n\t\t\t\t} | null;\n\t\t\t};\n\t\t}[];\n\t};\n\ttotalCommentsCount: number;\n\tviewerCanUpdate: boolean;\n}\n\n/**\n * An input beyond a pull request's lifecycle fields that `GitHubApi.getPullRequestsEtagFieldsBatch` can select.\n * Mirrors the integrations package's `PullRequestEtagInclude`, which this package cannot import.\n */\nexport type GitHubPullRequestEtagInclude = 'mergeable' | 'reviewDecision' | 'checks';\n\n/**\n * The change state `GitHubApi.getPullRequestsEtagFieldsBatch` selects: a pull request's lifecycle fields, plus,\n * for each requested {@link GitHubPullRequestEtagInclude}, what its etag reads. Each selection is the full\n * fragment's own, so a value here is the one a full read would have mapped.\n */\nexport interface GitHubPullRequestEtagNode extends Pick<\n\tGitHubPullRequest,\n\t'id' | 'number' | 'state' | 'isDraft' | 'updatedAt' | 'headRefOid'\n> {\n\t/** Only with `mergeable`. */\n\tmergeable?: GitHubPullRequestMergeableState | null;\n\t/** Only with `reviewDecision`. `null` on a repository that requires no review. */\n\treviewDecision?: GitHubPullRequestReviewDecision | null;\n\t/** Only with `checks`. */\n\tcommits?: {\n\t\tnodes: { commit: { statusCheckRollup: { state: GitHubPullRequestStatusCheckRollupState } | null } }[];\n\t};\n}\n\n/**\n * An input beyond an issue's lifecycle fields that `GitHubApi.getIssuesEtagFieldsBatch` can select. Mirrors the\n * integrations package's `IssueEtagInclude`, which this package cannot import.\n */\nexport type GitHubIssueEtagInclude = 'reactions';\n\n/**\n * The change state `GitHubApi.getIssuesEtagFieldsBatch` selects, plus, for each requested\n * {@link GitHubIssueEtagInclude}, the full fragment's own selection of it.\n */\nexport interface GitHubIssueEtagNode extends Pick<GitHubIssue, 'id' | 'number' | 'state' | 'updatedAt'> {\n\t/** Only with `reactions`: the thumbs-up reactions, as the full fragment selects them. */\n\treactions?: { totalCount: number };\n}\n\nexport type GitHubViewerPermission =\n\t| 'ADMIN' // Can read, clone, and push to this repository. Can also manage issues, pull requests, and repository settings, including adding collaborators\n\t| 'MAINTAIN' // Can read, clone, and push to this repository. They can also manage issues, pull requests, and some repository settings\n\t| 'WRITE' // Can read, clone, and push to this repository. Can also manage issues and pull requests\n\t| 'TRIAGE' // Can read and clone this repository. Can also manage issues and pull requests\n\t| 'READ' // Can read and clone this repository. Can also open and comment on issues and pull requests\n\t| 'NONE';\n\n/** `ghost` is how github.com renders an actor whose account was deleted, under the handle `ghost` */\nfunction fromGitHubMemberOrGhost(member: GitHubMember | null | undefined): PullRequestMember {\n\tif (member == null) return { id: 'ghost', name: 'ghost', username: 'ghost' };\n\n\treturn {\n\t\tid: member.login,\n\t\tname: member.login,\n\t\tusername: member.login,\n\t\tavatarUrl: member.avatarUrl,\n\t\turl: member.url,\n\t};\n}\n\nexport function fromGitHubPullRequestLite(\n\tpr: GitHubPullRequestLite,\n\tprovider: Provider,\n\tprojection?: PullRequestProjection,\n): PullRequest {\n\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tundefined,\n\t\tundefined,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\t// The lite fragment selects nothing between `isDraft` and `stack`.\n\t\tundefined, // additions\n\t\tundefined, // deletions\n\t\tundefined, // commentsCount\n\t\tundefined, // thumbsUpCount\n\t\tundefined, // reviewDecision\n\t\tundefined, // reviewRequests\n\t\tundefined, // latestReviews\n\t\tundefined, // assignees\n\t\tundefined, // statusCheckRollupState\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tundefined, // commitCount\n\t\tfromGitHubPullRequestStack(pr),\n\t\tundefined, // filesChanged\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t);\n}\n\n/** `undefined` only for a node from a selection that left the milestone out, which no fragment does today. */\nfunction fromGitHubMilestone(milestone: GitHubMilestone | null | undefined): IssueMilestone | null | undefined {\n\tif (milestone == null) return milestone;\n\n\treturn {\n\t\tid: milestone.id,\n\t\ttitle: milestone.title,\n\t\tstate: milestone.state === 'CLOSED' ? 'closed' : 'open',\n\t\t...(milestone.dueOn != null ? { dueDate: new Date(milestone.dueOn) } : {}),\n\t\t...(milestone.url ? { url: milestone.url } : {}),\n\t};\n}\n\n/** Both fields are absent on GitHub Enterprise Server (never selected) and `null` when unstacked. */\nfunction fromGitHubPullRequestStack(pr: GitHubPullRequestLite): PullRequestStackInfo | undefined {\n\tif (pr.stack == null || pr.stackEntry == null) return undefined;\n\n\treturn {\n\t\tid: pr.stack.id,\n\t\tnumber: pr.stack.number,\n\t\tsize: pr.stack.size,\n\t\tposition: pr.stackEntry.position,\n\t\tbaseRef: pr.stack.baseRefName,\n\t};\n}\n\nexport function fromGitHubIssueOrPullRequestState(state: GitHubPullRequestState): PullRequestState {\n\treturn state === 'MERGED' ? 'merged' : state === 'CLOSED' ? 'closed' : 'opened';\n}\n\nexport function toGitHubPullRequestState(state: PullRequestState): GitHubPullRequestState {\n\treturn state === 'merged' ? 'MERGED' : state === 'closed' ? 'CLOSED' : 'OPEN';\n}\n\nexport function fromGitHubPullRequestReviewDecision(\n\treviewDecision: GitHubPullRequestReviewDecision,\n): PullRequestReviewDecision {\n\tswitch (reviewDecision) {\n\t\tcase 'APPROVED':\n\t\t\treturn PullRequestReviewDecision.Approved;\n\t\tcase 'CHANGES_REQUESTED':\n\t\t\treturn PullRequestReviewDecision.ChangesRequested;\n\t\tcase 'REVIEW_REQUIRED':\n\t\t\treturn PullRequestReviewDecision.ReviewRequired;\n\t}\n}\n\nexport function fromGitHubPullRequestReviewState(state: GitHubPullRequestReviewState): PullRequestReviewState {\n\tswitch (state) {\n\t\tcase 'APPROVED':\n\t\t\treturn PullRequestReviewState.Approved;\n\t\tcase 'CHANGES_REQUESTED':\n\t\t\treturn PullRequestReviewState.ChangesRequested;\n\t\tcase 'COMMENTED':\n\t\t\treturn PullRequestReviewState.Commented;\n\t\tcase 'DISMISSED':\n\t\t\treturn PullRequestReviewState.Dismissed;\n\t\tcase 'PENDING':\n\t\t\treturn PullRequestReviewState.Pending;\n\t}\n}\n\nexport function toGitHubPullRequestReviewDecision(\n\treviewDecision: PullRequestReviewDecision,\n): GitHubPullRequestReviewDecision {\n\tswitch (reviewDecision) {\n\t\tcase PullRequestReviewDecision.Approved:\n\t\t\treturn 'APPROVED';\n\t\tcase PullRequestReviewDecision.ChangesRequested:\n\t\t\treturn 'CHANGES_REQUESTED';\n\t\tcase PullRequestReviewDecision.ReviewRequired:\n\t\t\treturn 'REVIEW_REQUIRED';\n\t}\n}\n\nexport function fromGitHubPullRequestMergeableState(\n\tmergeableState: GitHubPullRequestMergeableState,\n): PullRequestMergeableState {\n\tswitch (mergeableState) {\n\t\tcase 'MERGEABLE':\n\t\t\treturn PullRequestMergeableState.Mergeable;\n\t\tcase 'CONFLICTING':\n\t\t\treturn PullRequestMergeableState.Conflicting;\n\t\tcase 'UNKNOWN':\n\t\t\treturn PullRequestMergeableState.Unknown;\n\t}\n}\n\nexport function toGitHubPullRequestMergeableState(\n\tmergeableState: PullRequestMergeableState,\n): GitHubPullRequestMergeableState {\n\tswitch (mergeableState) {\n\t\tcase PullRequestMergeableState.Mergeable:\n\t\t\treturn 'MERGEABLE';\n\t\tcase PullRequestMergeableState.Conflicting:\n\t\t\treturn 'CONFLICTING';\n\t\tcase PullRequestMergeableState.FailingChecks:\n\t\t\treturn 'UNKNOWN';\n\t\tcase PullRequestMergeableState.BlockedByPolicy:\n\t\t\treturn 'UNKNOWN';\n\t\tcase PullRequestMergeableState.Unknown:\n\t\t\treturn 'UNKNOWN';\n\t}\n}\n\nexport function fromGitHubPullRequestStatusCheckRollupState(\n\tstate: GitHubPullRequestStatusCheckRollupState | null | undefined,\n): PullRequestStatusCheckRollupState | undefined {\n\tswitch (state) {\n\t\tcase 'SUCCESS':\n\t\tcase 'EXPECTED':\n\t\t\treturn PullRequestStatusCheckRollupState.Success;\n\t\tcase 'FAILURE':\n\t\tcase 'ERROR':\n\t\t\treturn PullRequestStatusCheckRollupState.Failed;\n\t\tcase 'PENDING':\n\t\t\treturn PullRequestStatusCheckRollupState.Pending;\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nexport function fromGitHubPullRequest(\n\tpr: GitHubPullRequest,\n\tprovider: Provider,\n\tprojection?: PullRequestProjection,\n): PullRequest {\n\t// `latestReviews` is capped, so keep the viewer's own review even when it falls outside that window, deduped\n\t// by review id since the two selections overlap. Unsubmitted drafts are dropped from the union rather than\n\t// from the viewer's side alone: `PENDING` is in GitHub's review-state enum on both selections, and the field\n\t// this feeds is documented as reviews already SUBMITTED — a draft there tells a \"needs my review\" consumer\n\t// the review is done, and a reviewer with a submitted review plus a draft would get two conflicting rows.\n\tconst viewerLatestReview = pr.viewerLatestReview;\n\tconst latestReviews = [\n\t\t...pr.latestReviews.nodes,\n\t\t...(viewerLatestReview != null && !pr.latestReviews.nodes.some(r => r.id === viewerLatestReview.id)\n\t\t\t? [viewerLatestReview]\n\t\t\t: []),\n\t].filter(review => review.state !== 'PENDING');\n\n\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tfromGitHubPullRequestMergeableState(pr.mergeable),\n\t\tpr.viewerCanUpdate,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\tpr.additions,\n\t\tpr.deletions,\n\t\tpr.totalCommentsCount,\n\t\tundefined, // thumbsUpCount: the fragment selects no reactions\n\t\tfromGitHubPullRequestReviewDecision(pr.reviewDecision),\n\t\tpr.reviewRequests.nodes\n\t\t\t.map(r =>\n\t\t\t\tr.requestedReviewer != null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tisCodeOwner: r.asCodeOwner,\n\t\t\t\t\t\t\treviewer: {\n\t\t\t\t\t\t\t\t// A team has no login: an empty id, which matches no one, rather than a missing one.\n\t\t\t\t\t\t\t\tid: r.requestedReviewer.login ?? '',\n\t\t\t\t\t\t\t\tname: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tusername: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tavatarUrl: r.requestedReviewer.avatarUrl,\n\t\t\t\t\t\t\t\turl: r.requestedReviewer.url,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstate: PullRequestReviewState.ReviewRequested,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\t)\n\t\t\t.filter(<T>(r?: T): r is T => Boolean(r)),\n\t\tlatestReviews.map(r => ({\n\t\t\treviewer: fromGitHubMemberOrGhost(r.author),\n\t\t\tstate: fromGitHubPullRequestReviewState(r.state),\n\t\t\tcommitOid: r.commit?.oid,\n\t\t})),\n\t\tpr.assignees.nodes.map(r => ({\n\t\t\tid: r.login,\n\t\t\tname: r.login,\n\t\t\tusername: r.login,\n\t\t\tavatarUrl: r.avatarUrl,\n\t\t\turl: r.url,\n\t\t})),\n\t\tfromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state),\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tpr.commits.totalCount,\n\t\tfromGitHubPullRequestStack(pr),\n\t\tpr.changedFiles,\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t);\n}\n\nexport function fromGitHubIssue(value: GitHubIssue, provider: Provider, projection?: IssueProjection): Issue {\n\treturn new Issue(\n\t\t{\n\t\t\tid: provider.id,\n\t\t\tname: provider.name,\n\t\t\tdomain: provider.domain,\n\t\t\ticon: provider.icon,\n\t\t},\n\t\tString(value.number),\n\t\tvalue.id,\n\t\tvalue.title,\n\t\tvalue.url,\n\t\tnew Date(value.createdAt),\n\t\tnew Date(value.updatedAt),\n\t\tvalue.closed,\n\t\tfromGitHubIssueOrPullRequestState(value.state),\n\t\tvalue.author == null\n\t\t\t? undefined\n\t\t\t: {\n\t\t\t\t\tid: value.author.login,\n\t\t\t\t\tname: value.author.login,\n\t\t\t\t\tusername: value.author.login,\n\t\t\t\t\tavatarUrl: value.author.avatarUrl,\n\t\t\t\t\turl: value.author.url,\n\t\t\t\t},\n\t\tvalue.assignees.nodes.map(assignee => ({\n\t\t\tid: assignee.login,\n\t\t\tname: assignee.login,\n\t\t\tusername: assignee.login,\n\t\t\tavatarUrl: assignee.avatarUrl,\n\t\t\turl: assignee.url,\n\t\t})),\n\t\t{\n\t\t\towner: value.repository.owner.login,\n\t\t\trepo: value.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(value.repository.viewerPermission),\n\t\t\turl: value.repository.url,\n\t\t},\n\t\tvalue.closedAt == null ? undefined : new Date(value.closedAt),\n\t\tvalue.labels?.nodes == null\n\t\t\t? undefined\n\t\t\t: value.labels.nodes.map(label => ({\n\t\t\t\t\tcolor: label.color,\n\t\t\t\t\tname: label.name,\n\t\t\t\t})),\n\t\tvalue.comments?.totalCount,\n\t\tvalue.reactions?.totalCount,\n\t\tvalue.body,\n\t\tundefined, // project\n\t\tundefined, // number\n\t\tundefined, // issueType\n\t\tundefined, // providerState\n\t\tundefined, // bodyFormat\n\t\tundefined, // iterations\n\t\tprojection,\n\t\tundefined, // bodyField\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tundefined, // syncedWith\n\t\tfromGitHubMilestone(value.milestone),\n\t);\n}\n\nfunction fromGitHubViewerPermissionToAccessLevel(\n\tpermission: GitHubViewerPermission | null | undefined,\n): RepositoryAccessLevel {\n\tswitch (permission) {\n\t\tcase 'ADMIN':\n\t\t\treturn RepositoryAccessLevel.Admin;\n\t\tcase 'MAINTAIN':\n\t\t\treturn RepositoryAccessLevel.Maintain;\n\t\tcase 'WRITE':\n\t\t\treturn RepositoryAccessLevel.Write;\n\t\tcase 'TRIAGE':\n\t\t\treturn RepositoryAccessLevel.Triage;\n\t\tcase 'READ':\n\t\t\treturn Repository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,MAAM,KAAI,cAAa;EACtC,IAAI,SAAS;EACb,MAAM,SAAS;EACf,UAAU,SAAS;EACnB,WAAW,SAAS;EACpB,KAAK,SAAS;CACf,EAAE,GACF;EACC,OAAO,MAAM,WAAW,MAAM;EAC9B,MAAM,MAAM,WAAW;EACvB,aAAa,wCAAwC,MAAM,WAAW,gBAAgB;EACtF,KAAK,MAAM,WAAW;CACvB,GACA,MAAM,YAAY,OAAO,KAAA,IAAY,IAAI,KAAK,MAAM,QAAQ,GAC5D,MAAM,QAAQ,SAAS,OACpB,KAAA,IACA,MAAM,OAAO,MAAM,KAAI,WAAU;EACjC,OAAO,MAAM;EACb,MAAM,MAAM;CACb,EAAE,GACJ,MAAM,UAAU,YAChB,MAAM,WAAW,YACjB,MAAM,MACN,KAAA,GACA,KAAA,GACA,KAAA,GACA,KAAA,GACA,KAAA,GACA,KAAA,GACA,YACA,KAAA,GACA,KAAA,GACA,KAAA,GACA,KAAA,GACA,oBAAoB,MAAM,SAAS,CACpC;AACD;AAEA,SAAS,wCACR,YACwB;CACxB,QAAQ,YAAR;EACC,KAAK,SACJ,OAAA;EACD,KAAK,YACJ,OAAA;EACD,KAAK,SACJ,OAAA;EACD,KAAK,UACJ,OAAA;EACD,KAAK,QACJ,OAAA;EACD,SACC,OAAA;CACF;AACD"}
|
|
1
|
+
{"version":3,"file":"models.js","names":[],"sources":["../../../../plus/git-github/src/models.ts"],"sourcesContent":["import type { Endpoints } from '@octokit/types';\nimport { GitFileIndexStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { IssueLabel, IssueProjection } from '@gitlens/git/models/issue.js';\nimport { Issue, RepositoryAccessLevel } from '@gitlens/git/models/issue.js';\nimport type { IssueMilestone } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type {\n\tPullRequestMember,\n\tPullRequestMergeQueueEntry,\n\tPullRequestMergeQueueRemoval,\n\tPullRequestProjection,\n\tPullRequestStackInfo,\n\tPullRequestState,\n} from '@gitlens/git/models/pullRequest.js';\nimport {\n\tPullRequest,\n\tPullRequestMergeableState,\n\tPullRequestMergeQueueState,\n\tPullRequestReviewDecision,\n\tPullRequestReviewState,\n\tPullRequestStatusCheckRollupState,\n} from '@gitlens/git/models/pullRequest.js';\nimport type { Provider } from '@gitlens/git/models/remoteProvider.js';\n\nexport interface GitHubBlame {\n\tranges: GitHubBlameRange[];\n\tviewer?: string;\n}\n\nexport interface GitHubBlameRange {\n\tstartingLine: number;\n\tendingLine: number;\n\tcommit: GitHubCommit;\n}\n\nexport interface GitHubBranch {\n\tname: string;\n\ttarget: {\n\t\toid: string;\n\t\tauthoredDate: string;\n\t\tcommittedDate: string;\n\t};\n}\n\nexport interface GitHubCommit {\n\toid: string;\n\tparents: { nodes: { oid: string }[] };\n\tmessage: string;\n\tadditions?: number | undefined;\n\tchangedFiles?: number | undefined;\n\tdeletions?: number | undefined;\n\tauthor: { avatarUrl: string | undefined; date: string; email: string | undefined; name: string };\n\tcommitter: { date: string; email: string | undefined; name: string };\n\n\tfiles?: Endpoints['GET /repos/{owner}/{repo}/commits/{ref}']['response']['data']['files'];\n}\n\nexport interface GitHubCommitRef {\n\toid: string;\n}\n\nexport type GitHubContributor = Endpoints['GET /repos/{owner}/{repo}/contributors']['response']['data'][0];\n\nexport type GitHubSshSigningKey = Endpoints['GET /users/{username}/ssh_signing_keys']['response']['data'][0];\n\nexport interface GitHubMember {\n\tlogin: string;\n\tavatarUrl: string;\n\turl: string;\n}\n\nexport interface GitHubPagedResult<T> {\n\tpageInfo: GitHubPageInfo;\n\ttotalCount: number;\n\tvalues: T[];\n}\nexport interface GitHubPageInfo {\n\tstartCursor?: string | null;\n\tendCursor?: string | null;\n\thasNextPage: boolean;\n\thasPreviousPage: boolean;\n}\n\nexport interface GitHubTag {\n\tname: string;\n\ttarget: {\n\t\toid: string;\n\t\tauthoredDate?: string;\n\t\tcommittedDate?: string;\n\t\tmessage?: string | null;\n\t\ttagger?: {\n\t\t\tdate: string;\n\t\t} | null;\n\n\t\ttarget?: {\n\t\t\toid?: string;\n\t\t\tauthoredDate?: string;\n\t\t\tcommittedDate?: string;\n\t\t\tmessage?: string | null;\n\t\t};\n\t};\n}\n\nexport type GitHubCommitFileStatus = NonNullable<\n\tEndpoints['GET /repos/{owner}/{repo}/commits/{ref}']['response']['data']['files']\n>[0]['status'];\n\nexport function fromCommitFileStatus(status: GitHubCommitFileStatus): GitFileIndexStatus | undefined {\n\tswitch (status) {\n\t\tcase 'added':\n\t\t\treturn GitFileIndexStatus.Added;\n\t\tcase 'changed':\n\t\tcase 'modified':\n\t\t\treturn GitFileIndexStatus.Modified;\n\t\tcase 'removed':\n\t\t\treturn GitFileIndexStatus.Deleted;\n\t\tcase 'renamed':\n\t\t\treturn GitFileIndexStatus.Renamed;\n\t\tcase 'copied':\n\t\t\treturn GitFileIndexStatus.Copied;\n\t}\n\treturn undefined;\n}\n\nexport interface GitHubIssueOrPullRequest {\n\t__typename: 'Issue' | 'PullRequest';\n\n\tclosed: boolean;\n\tclosedAt: string | null;\n\tcreatedAt: string;\n\tid: string;\n\tnumber: number;\n\tstate: GitHubIssueOrPullRequestState;\n\ttitle: string;\n\tupdatedAt: string;\n\turl: string;\n}\n\nexport type GitHubIssueState = 'OPEN' | 'CLOSED';\nexport type GitHubPullRequestState = 'OPEN' | 'CLOSED' | 'MERGED';\nexport type GitHubIssueOrPullRequestState = GitHubIssueState | GitHubPullRequestState;\n\n/** GitHub's `Milestone`, as `gqlMilestoneFragment` selects it. */\nexport interface GitHubMilestone {\n\tid: string;\n\ttitle: string;\n\tstate: 'OPEN' | 'CLOSED';\n\tdueOn: string | null;\n\turl: string;\n}\n\nexport interface GitHubPullRequestLite extends Omit<GitHubIssueOrPullRequest, '__typename'> {\n\t/** `Actor` is nullable in GitHub's schema — `null` once the author's account is deleted */\n\tauthor: GitHubMember | null;\n\tbody: string | null;\n\n\tbaseRefName: string;\n\tbaseRefOid: string;\n\n\theadRefName: string;\n\theadRefOid: string;\n\theadRepository: {\n\t\tisFork: boolean;\n\t\tname: string;\n\t\towner: {\n\t\t\tlogin: string;\n\t\t};\n\t\tsshUrl: string;\n\t\turl: string;\n\t};\n\n\tisCrossRepository: boolean;\n\tisDraft: boolean;\n\tmergedAt: string | null;\n\t/** `null` when the pull request has none. */\n\tmilestone: GitHubMilestone | null;\n\tpermalink: string;\n\n\trepository: {\n\t\tisFork: boolean;\n\t\tname: string;\n\t\towner: {\n\t\t\tlogin: string;\n\t\t};\n\t\tsshUrl: string;\n\t\turl: string;\n\t\tviewerPermission: GitHubViewerPermission;\n\t};\n\n\t/** Only selected against github.com — GitHub Enterprise Server schemas lag and reject the field. */\n\tstack?: GitHubPullRequestStack | null;\n\t/** Only selected against github.com — see `stack`. */\n\tstackEntry?: { position: number } | null;\n\t/** Only selected against github.com — see `stack`. `null` when the pull request isn't queued. */\n\tmergeQueueEntry?: GitHubMergeQueueEntry | null;\n\t/** Only selected against github.com — see `stack`. True whenever the base branch requires a merge queue, whatever\n\t * the pull request's state. */\n\tisMergeQueueEnabled?: boolean;\n\t/** Only selected against github.com — see `stack`. The latest merge-queue event only (`timelineItems(last: 1)`). */\n\tmergeQueueEvents?: GitHubMergeQueueEvents | null;\n}\n\n/** The `timelineItems` of a pull request filtered to its merge-queue events, as GitLens selects them. */\nexport interface GitHubMergeQueueEvents {\n\tnodes: (GitHubMergeQueueEvent | null)[] | null;\n}\n\n/** A merge-queue timeline event. Only a removal's fields are selected: the latest event being an addition is all an\n * addition says. */\nexport type GitHubMergeQueueEvent =\n\t| { __typename: 'AddedToMergeQueueEvent' }\n\t| {\n\t\t\t__typename: 'RemovedFromMergeQueueEvent';\n\t\t\tcreatedAt: string;\n\t\t\treason: string | null;\n\t };\n\nexport type GitHubMergeQueueEntryState = 'QUEUED' | 'AWAITING_CHECKS' | 'MERGEABLE' | 'UNMERGEABLE' | 'LOCKED';\n\n/** GitHub's `MergeQueueEntry`, as GitLens selects it. */\nexport interface GitHubMergeQueueEntry {\n\tstate: GitHubMergeQueueEntryState;\n\tenqueuedAt: string;\n\t/** Seconds from when it was read. */\n\testimatedTimeToMerge: number | null;\n\tmergeQueue: { url: string } | null;\n\t/** 1-based, in enqueue order. */\n\tposition: number | null;\n}\n\n/** GitHub's stacked-pull-request object. Read-only; all stack mutations are REST-only. */\nexport interface GitHubPullRequestStack {\n\tid: string;\n\tnumber: number;\n\tsize: number;\n\t/** The branch the bottom of the stack targets — the stack's trunk. */\n\tbaseRefName: string;\n}\n\nexport interface GitHubIssue extends Omit<GitHubIssueOrPullRequest, '__typename'> {\n\t/** `Actor` is nullable in GitHub's schema — `null` once the author's account is deleted */\n\tauthor: GitHubMember | null;\n\tassignees: { nodes: GitHubMember[] };\n\tcomments?: {\n\t\ttotalCount: number;\n\t};\n\tlabels?: { nodes: IssueLabel[] };\n\t/** `null` when the issue has none. */\n\tmilestone: GitHubMilestone | null;\n\treactions?: {\n\t\ttotalCount: number;\n\t};\n\trepository: {\n\t\tname: string;\n\t\towner: {\n\t\t\tlogin: string;\n\t\t};\n\t\tviewerPermission: GitHubViewerPermission;\n\t\turl: string;\n\t};\n\tbody: string;\n}\n\nexport type GitHubPullRequestReviewDecision = 'CHANGES_REQUESTED' | 'APPROVED' | 'REVIEW_REQUIRED';\nexport type GitHubPullRequestMergeableState = 'MERGEABLE' | 'CONFLICTING' | 'UNKNOWN';\nexport type GitHubPullRequestStatusCheckRollupState = 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\nexport type GitHubPullRequestReviewState = 'APPROVED' | 'CHANGES_REQUESTED' | 'COMMENTED' | 'DISMISSED' | 'PENDING';\n\ntype GitHubPullRequestReview = {\n\tid: string;\n\tauthor: GitHubMember | null;\n\tstate: GitHubPullRequestReviewState;\n\tcommit?: { oid: string } | null;\n};\n\nexport interface GitHubPullRequest extends GitHubPullRequestLite {\n\tadditions: number;\n\tassignees: {\n\t\tnodes: GitHubMember[];\n\t};\n\tchangedFiles: number;\n\tchecksUrl: string;\n\tdeletions: number;\n\tmergeable: GitHubPullRequestMergeableState;\n\treviewDecision: GitHubPullRequestReviewDecision;\n\tlatestReviews: {\n\t\tnodes: GitHubPullRequestReview[];\n\t};\n\t/**\n\t * The current user's own latest review. `latestReviews` is capped, so on a heavily-reviewed pull request\n\t * the viewer's own review can fall outside that window — which is exactly the row a \"needs my review\"\n\t * surface is asking about.\n\t */\n\tviewerLatestReview: GitHubPullRequestReview | null;\n\treviewRequests: {\n\t\tnodes: {\n\t\t\tasCodeOwner: boolean;\n\t\t\t/** Empty for a team (or anything else that isn't a user), which the `... on User` selection doesn't match. */\n\t\t\trequestedReviewer: Partial<GitHubMember> | null;\n\t\t}[];\n\t};\n\tcommits: {\n\t\ttotalCount: number;\n\t\tnodes: {\n\t\t\tcommit: {\n\t\t\t\tstatusCheckRollup: {\n\t\t\t\t\tstate: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\n\t\t\t\t} | null;\n\t\t\t};\n\t\t}[];\n\t};\n\ttotalCommentsCount: number;\n\tviewerCanUpdate: boolean;\n}\n\n/**\n * An input beyond a pull request's lifecycle fields that `GitHubApi.getPullRequestsEtagFieldsBatch` can select.\n * Mirrors the integrations package's `PullRequestEtagInclude`, which this package cannot import.\n */\nexport type GitHubPullRequestEtagInclude = 'mergeable' | 'reviewDecision' | 'checks';\n\n/**\n * The change state `GitHubApi.getPullRequestsEtagFieldsBatch` selects: a pull request's lifecycle fields, plus,\n * for each requested {@link GitHubPullRequestEtagInclude}, what its etag reads. Each selection is the full\n * fragment's own, so a value here is the one a full read would have mapped.\n */\nexport interface GitHubPullRequestEtagNode extends Pick<\n\tGitHubPullRequest,\n\t'id' | 'number' | 'state' | 'isDraft' | 'updatedAt' | 'headRefOid'\n> {\n\t/** Only with `mergeable`. */\n\tmergeable?: GitHubPullRequestMergeableState | null;\n\t/** Only with `reviewDecision`. `null` on a repository that requires no review. */\n\treviewDecision?: GitHubPullRequestReviewDecision | null;\n\t/** Only with `checks`. */\n\tcommits?: {\n\t\tnodes: { commit: { statusCheckRollup: { state: GitHubPullRequestStatusCheckRollupState } | null } }[];\n\t};\n\t/** Always selected, but only against github.com, like the full read's. `null` when the pull request isn't queued. */\n\tmergeQueueEntry?: Pick<GitHubMergeQueueEntry, 'state' | 'enqueuedAt'> | null;\n\t/** Always selected, but only against github.com, exactly as the full read selects it. */\n\tmergeQueueEvents?: GitHubMergeQueueEvents | null;\n}\n\n/**\n * An input beyond an issue's lifecycle fields that `GitHubApi.getIssuesEtagFieldsBatch` can select. Mirrors the\n * integrations package's `IssueEtagInclude`, which this package cannot import.\n */\nexport type GitHubIssueEtagInclude = 'reactions';\n\n/**\n * The change state `GitHubApi.getIssuesEtagFieldsBatch` selects, plus, for each requested\n * {@link GitHubIssueEtagInclude}, the full fragment's own selection of it.\n */\nexport interface GitHubIssueEtagNode extends Pick<GitHubIssue, 'id' | 'number' | 'state' | 'updatedAt'> {\n\t/** Only with `reactions`: the thumbs-up reactions, as the full fragment selects them. */\n\treactions?: { totalCount: number };\n}\n\nexport type GitHubViewerPermission =\n\t| 'ADMIN' // Can read, clone, and push to this repository. Can also manage issues, pull requests, and repository settings, including adding collaborators\n\t| 'MAINTAIN' // Can read, clone, and push to this repository. They can also manage issues, pull requests, and some repository settings\n\t| 'WRITE' // Can read, clone, and push to this repository. Can also manage issues and pull requests\n\t| 'TRIAGE' // Can read and clone this repository. Can also manage issues and pull requests\n\t| 'READ' // Can read and clone this repository. Can also open and comment on issues and pull requests\n\t| 'NONE';\n\n/** `ghost` is how github.com renders an actor whose account was deleted, under the handle `ghost` */\nfunction fromGitHubMemberOrGhost(member: GitHubMember | null | undefined): PullRequestMember {\n\tif (member == null) return { id: 'ghost', name: 'ghost', username: 'ghost' };\n\n\treturn {\n\t\tid: member.login,\n\t\tname: member.login,\n\t\tusername: member.login,\n\t\tavatarUrl: member.avatarUrl,\n\t\turl: member.url,\n\t};\n}\n\nexport function fromGitHubPullRequestLite(\n\tpr: GitHubPullRequestLite,\n\tprovider: Provider,\n\tprojection?: PullRequestProjection,\n): PullRequest {\n\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tundefined,\n\t\tundefined,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\t// The lite fragment selects nothing between `isDraft` and `stack`.\n\t\tundefined, // additions\n\t\tundefined, // deletions\n\t\tundefined, // commentsCount\n\t\tundefined, // thumbsUpCount\n\t\tundefined, // reviewDecision\n\t\tundefined, // reviewRequests\n\t\tundefined, // latestReviews\n\t\tundefined, // assignees\n\t\tundefined, // statusCheckRollupState\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tundefined, // commitCount\n\t\tfromGitHubPullRequestStack(pr),\n\t\tundefined, // filesChanged\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t\tfromGitHubPullRequestMergeQueueEntry(pr),\n\t\tpr.isMergeQueueEnabled,\n\t\tfromGitHubMergeQueueRemoval(pr.mergeQueueEvents),\n\t);\n}\n\n/** `undefined` only for a node from a selection that left the milestone out, which no fragment does today. */\nfunction fromGitHubMilestone(milestone: GitHubMilestone | null | undefined): IssueMilestone | null | undefined {\n\tif (milestone == null) return milestone;\n\n\treturn {\n\t\tid: milestone.id,\n\t\ttitle: milestone.title,\n\t\tstate: milestone.state === 'CLOSED' ? 'closed' : 'open',\n\t\t...(milestone.dueOn != null ? { dueDate: new Date(milestone.dueOn) } : {}),\n\t\t...(milestone.url ? { url: milestone.url } : {}),\n\t};\n}\n\n/** Both fields are absent on GitHub Enterprise Server (never selected) and `null` when unstacked. */\nfunction fromGitHubPullRequestStack(pr: GitHubPullRequestLite): PullRequestStackInfo | undefined {\n\tif (pr.stack == null || pr.stackEntry == null) return undefined;\n\n\treturn {\n\t\tid: pr.stack.id,\n\t\tnumber: pr.stack.number,\n\t\tsize: pr.stack.size,\n\t\tposition: pr.stackEntry.position,\n\t\tbaseRef: pr.stack.baseRefName,\n\t};\n}\n\n/** Absent on GitHub Enterprise Server (never selected) and `null` when the pull request isn't queued. */\nfunction fromGitHubPullRequestMergeQueueEntry(pr: GitHubPullRequestLite): PullRequestMergeQueueEntry | undefined {\n\treturn pr.mergeQueueEntry != null ? fromGitHubMergeQueueEntry(pr.mergeQueueEntry) : undefined;\n}\n\n/**\n * The one place a GitHub `MergeQueueEntry` becomes a {@link PullRequestMergeQueueEntry}, whichever read selected it.\n * GitHub's estimate is a duration from the moment it answered, so it's fixed to a date here, at read time, rather\n * than added to the clock at each render, where a held entry would never count down.\n */\nexport function fromGitHubMergeQueueEntry(entry: GitHubMergeQueueEntry): PullRequestMergeQueueEntry {\n\treturn {\n\t\tstate: fromGitHubMergeQueueEntryState(entry.state),\n\t\tenqueuedAt: new Date(entry.enqueuedAt),\n\t\testimatedMergeAt:\n\t\t\tentry.estimatedTimeToMerge != null ? new Date(Date.now() + entry.estimatedTimeToMerge * 1000) : undefined,\n\t\turl: entry.mergeQueue?.url,\n\t\tposition: entry.position ?? undefined,\n\t};\n}\n\n/**\n * The pull request's latest removal from its merge queue, from its latest merge-queue event: set only when that\n * event is a removal (so it hasn't rejoined since) whose reason isn't `merged` (GitHub removes every merged entry\n * with that reason). Absent on GitHub Enterprise Server (never selected). Shared by the full read and the etag's\n * cheap check, so both derive the same removal.\n */\nexport function fromGitHubMergeQueueRemoval(\n\tevents: GitHubMergeQueueEvents | null | undefined,\n): PullRequestMergeQueueRemoval | undefined {\n\tconst latest = events?.nodes?.at(-1);\n\tif (latest?.__typename !== 'RemovedFromMergeQueueEvent') return undefined;\n\n\tconst reason = latest.reason ?? '';\n\tif (reason.toLowerCase() === 'merged') return undefined;\n\n\treturn { reason: reason, removedAt: new Date(latest.createdAt) };\n}\n\n/** A state GitHub adds later still means the pull request is in the queue, so it reads as Queued rather than\n * dropping the entry, which would report a queued pull request as not queued. */\nexport function fromGitHubMergeQueueEntryState(state: GitHubMergeQueueEntryState): PullRequestMergeQueueState {\n\tswitch (state) {\n\t\tcase 'AWAITING_CHECKS':\n\t\t\treturn PullRequestMergeQueueState.AwaitingChecks;\n\t\tcase 'MERGEABLE':\n\t\t\treturn PullRequestMergeQueueState.Mergeable;\n\t\tcase 'UNMERGEABLE':\n\t\t\treturn PullRequestMergeQueueState.Unmergeable;\n\t\tcase 'LOCKED':\n\t\t\treturn PullRequestMergeQueueState.Locked;\n\t\tdefault:\n\t\t\treturn PullRequestMergeQueueState.Queued;\n\t}\n}\n\nexport function fromGitHubIssueOrPullRequestState(state: GitHubPullRequestState): PullRequestState {\n\treturn state === 'MERGED' ? 'merged' : state === 'CLOSED' ? 'closed' : 'opened';\n}\n\nexport function toGitHubPullRequestState(state: PullRequestState): GitHubPullRequestState {\n\treturn state === 'merged' ? 'MERGED' : state === 'closed' ? 'CLOSED' : 'OPEN';\n}\n\nexport function fromGitHubPullRequestReviewDecision(\n\treviewDecision: GitHubPullRequestReviewDecision,\n): PullRequestReviewDecision {\n\tswitch (reviewDecision) {\n\t\tcase 'APPROVED':\n\t\t\treturn PullRequestReviewDecision.Approved;\n\t\tcase 'CHANGES_REQUESTED':\n\t\t\treturn PullRequestReviewDecision.ChangesRequested;\n\t\tcase 'REVIEW_REQUIRED':\n\t\t\treturn PullRequestReviewDecision.ReviewRequired;\n\t}\n}\n\nexport function fromGitHubPullRequestReviewState(state: GitHubPullRequestReviewState): PullRequestReviewState {\n\tswitch (state) {\n\t\tcase 'APPROVED':\n\t\t\treturn PullRequestReviewState.Approved;\n\t\tcase 'CHANGES_REQUESTED':\n\t\t\treturn PullRequestReviewState.ChangesRequested;\n\t\tcase 'COMMENTED':\n\t\t\treturn PullRequestReviewState.Commented;\n\t\tcase 'DISMISSED':\n\t\t\treturn PullRequestReviewState.Dismissed;\n\t\tcase 'PENDING':\n\t\t\treturn PullRequestReviewState.Pending;\n\t}\n}\n\nexport function toGitHubPullRequestReviewDecision(\n\treviewDecision: PullRequestReviewDecision,\n): GitHubPullRequestReviewDecision {\n\tswitch (reviewDecision) {\n\t\tcase PullRequestReviewDecision.Approved:\n\t\t\treturn 'APPROVED';\n\t\tcase PullRequestReviewDecision.ChangesRequested:\n\t\t\treturn 'CHANGES_REQUESTED';\n\t\tcase PullRequestReviewDecision.ReviewRequired:\n\t\t\treturn 'REVIEW_REQUIRED';\n\t}\n}\n\nexport function fromGitHubPullRequestMergeableState(\n\tmergeableState: GitHubPullRequestMergeableState,\n): PullRequestMergeableState {\n\tswitch (mergeableState) {\n\t\tcase 'MERGEABLE':\n\t\t\treturn PullRequestMergeableState.Mergeable;\n\t\tcase 'CONFLICTING':\n\t\t\treturn PullRequestMergeableState.Conflicting;\n\t\tcase 'UNKNOWN':\n\t\t\treturn PullRequestMergeableState.Unknown;\n\t}\n}\n\nexport function toGitHubPullRequestMergeableState(\n\tmergeableState: PullRequestMergeableState,\n): GitHubPullRequestMergeableState {\n\tswitch (mergeableState) {\n\t\tcase PullRequestMergeableState.Mergeable:\n\t\t\treturn 'MERGEABLE';\n\t\tcase PullRequestMergeableState.Conflicting:\n\t\t\treturn 'CONFLICTING';\n\t\tcase PullRequestMergeableState.FailingChecks:\n\t\t\treturn 'UNKNOWN';\n\t\tcase PullRequestMergeableState.BlockedByPolicy:\n\t\t\treturn 'UNKNOWN';\n\t\tcase PullRequestMergeableState.Unknown:\n\t\t\treturn 'UNKNOWN';\n\t}\n}\n\nexport function fromGitHubPullRequestStatusCheckRollupState(\n\tstate: GitHubPullRequestStatusCheckRollupState | null | undefined,\n): PullRequestStatusCheckRollupState | undefined {\n\tswitch (state) {\n\t\tcase 'SUCCESS':\n\t\tcase 'EXPECTED':\n\t\t\treturn PullRequestStatusCheckRollupState.Success;\n\t\tcase 'FAILURE':\n\t\tcase 'ERROR':\n\t\t\treturn PullRequestStatusCheckRollupState.Failed;\n\t\tcase 'PENDING':\n\t\t\treturn PullRequestStatusCheckRollupState.Pending;\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nexport function fromGitHubPullRequest(\n\tpr: GitHubPullRequest,\n\tprovider: Provider,\n\tprojection?: PullRequestProjection,\n): PullRequest {\n\t// `latestReviews` is capped, so keep the viewer's own review even when it falls outside that window, deduped\n\t// by review id since the two selections overlap. Unsubmitted drafts are dropped from the union rather than\n\t// from the viewer's side alone: `PENDING` is in GitHub's review-state enum on both selections, and the field\n\t// this feeds is documented as reviews already SUBMITTED — a draft there tells a \"needs my review\" consumer\n\t// the review is done, and a reviewer with a submitted review plus a draft would get two conflicting rows.\n\tconst viewerLatestReview = pr.viewerLatestReview;\n\tconst latestReviews = [\n\t\t...pr.latestReviews.nodes,\n\t\t...(viewerLatestReview != null && !pr.latestReviews.nodes.some(r => r.id === viewerLatestReview.id)\n\t\t\t? [viewerLatestReview]\n\t\t\t: []),\n\t].filter(review => review.state !== 'PENDING');\n\n\treturn new PullRequest(\n\t\tprovider,\n\t\tfromGitHubMemberOrGhost(pr.author),\n\t\tString(pr.number),\n\t\tpr.id,\n\t\tpr.title,\n\t\tpr.permalink,\n\t\t{\n\t\t\towner: pr.repository.owner.login,\n\t\t\trepo: pr.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(pr.repository.viewerPermission),\n\t\t},\n\t\tfromGitHubIssueOrPullRequestState(pr.state),\n\t\tnew Date(pr.createdAt),\n\t\tnew Date(pr.updatedAt),\n\t\tpr.closedAt == null ? undefined : new Date(pr.closedAt),\n\t\tpr.mergedAt == null ? undefined : new Date(pr.mergedAt),\n\t\tfromGitHubPullRequestMergeableState(pr.mergeable),\n\t\tpr.viewerCanUpdate,\n\t\t{\n\t\t\thead: {\n\t\t\t\texists: pr.headRepository != null,\n\t\t\t\towner: pr.headRepository?.owner.login,\n\t\t\t\trepo: pr.headRepository?.name,\n\t\t\t\tsha: pr.headRefOid,\n\t\t\t\tbranch: pr.headRefName,\n\t\t\t\turl: pr.headRepository?.url,\n\t\t\t\tcloneHttps: pr.headRepository != null ? `${pr.headRepository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.headRepository?.sshUrl,\n\t\t\t\tisFork: pr.headRepository?.isFork,\n\t\t\t},\n\t\t\tbase: {\n\t\t\t\texists: pr.repository != null,\n\t\t\t\towner: pr.repository?.owner.login,\n\t\t\t\trepo: pr.repository?.name,\n\t\t\t\tsha: pr.baseRefOid,\n\t\t\t\tbranch: pr.baseRefName,\n\t\t\t\turl: pr.repository?.url,\n\t\t\t\tcloneHttps: pr.repository != null ? `${pr.repository.url}.git` : undefined,\n\t\t\t\tcloneSsh: pr.repository?.sshUrl,\n\t\t\t\tisFork: pr.repository?.isFork,\n\t\t\t},\n\t\t\tisCrossRepository: pr.isCrossRepository,\n\t\t},\n\t\tpr.isDraft,\n\t\tpr.additions,\n\t\tpr.deletions,\n\t\tpr.totalCommentsCount,\n\t\tundefined, // thumbsUpCount: the fragment selects no reactions\n\t\tfromGitHubPullRequestReviewDecision(pr.reviewDecision),\n\t\tpr.reviewRequests.nodes\n\t\t\t.map(r =>\n\t\t\t\tr.requestedReviewer != null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tisCodeOwner: r.asCodeOwner,\n\t\t\t\t\t\t\treviewer: {\n\t\t\t\t\t\t\t\t// A team has no login: an empty id, which matches no one, rather than a missing one.\n\t\t\t\t\t\t\t\tid: r.requestedReviewer.login ?? '',\n\t\t\t\t\t\t\t\tname: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tusername: r.requestedReviewer.login,\n\t\t\t\t\t\t\t\tavatarUrl: r.requestedReviewer.avatarUrl,\n\t\t\t\t\t\t\t\turl: r.requestedReviewer.url,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tstate: PullRequestReviewState.ReviewRequested,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined,\n\t\t\t)\n\t\t\t.filter(<T>(r?: T): r is T => Boolean(r)),\n\t\tlatestReviews.map(r => ({\n\t\t\treviewer: fromGitHubMemberOrGhost(r.author),\n\t\t\tstate: fromGitHubPullRequestReviewState(r.state),\n\t\t\tcommitOid: r.commit?.oid,\n\t\t})),\n\t\tpr.assignees.nodes.map(r => ({\n\t\t\tid: r.login,\n\t\t\tname: r.login,\n\t\t\tusername: r.login,\n\t\t\tavatarUrl: r.avatarUrl,\n\t\t\turl: r.url,\n\t\t})),\n\t\tfromGitHubPullRequestStatusCheckRollupState(pr.commits.nodes?.[0]?.commit.statusCheckRollup?.state),\n\t\tundefined, // project\n\t\tundefined, // version\n\t\tpr.commits.totalCount,\n\t\tfromGitHubPullRequestStack(pr),\n\t\tpr.changedFiles,\n\t\tpr.body ?? undefined,\n\t\tpr.number,\n\t\tundefined, // authoredByMe\n\t\tprojection,\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tfromGitHubMilestone(pr.milestone),\n\t\tfromGitHubPullRequestMergeQueueEntry(pr),\n\t\tpr.isMergeQueueEnabled,\n\t\tfromGitHubMergeQueueRemoval(pr.mergeQueueEvents),\n\t);\n}\n\nexport function fromGitHubIssue(value: GitHubIssue, provider: Provider, projection?: IssueProjection): Issue {\n\treturn new Issue(\n\t\t{\n\t\t\tid: provider.id,\n\t\t\tname: provider.name,\n\t\t\tdomain: provider.domain,\n\t\t\ticon: provider.icon,\n\t\t},\n\t\tString(value.number),\n\t\tvalue.id,\n\t\tvalue.title,\n\t\tvalue.url,\n\t\tnew Date(value.createdAt),\n\t\tnew Date(value.updatedAt),\n\t\tvalue.closed,\n\t\tfromGitHubIssueOrPullRequestState(value.state),\n\t\tvalue.author == null\n\t\t\t? undefined\n\t\t\t: {\n\t\t\t\t\tid: value.author.login,\n\t\t\t\t\tname: value.author.login,\n\t\t\t\t\tusername: value.author.login,\n\t\t\t\t\tavatarUrl: value.author.avatarUrl,\n\t\t\t\t\turl: value.author.url,\n\t\t\t\t},\n\t\tvalue.assignees.nodes.map(assignee => ({\n\t\t\tid: assignee.login,\n\t\t\tname: assignee.login,\n\t\t\tusername: assignee.login,\n\t\t\tavatarUrl: assignee.avatarUrl,\n\t\t\turl: assignee.url,\n\t\t})),\n\t\t{\n\t\t\towner: value.repository.owner.login,\n\t\t\trepo: value.repository.name,\n\t\t\taccessLevel: fromGitHubViewerPermissionToAccessLevel(value.repository.viewerPermission),\n\t\t\turl: value.repository.url,\n\t\t},\n\t\tvalue.closedAt == null ? undefined : new Date(value.closedAt),\n\t\tvalue.labels?.nodes == null\n\t\t\t? undefined\n\t\t\t: value.labels.nodes.map(label => ({\n\t\t\t\t\tcolor: label.color,\n\t\t\t\t\tname: label.name,\n\t\t\t\t})),\n\t\tvalue.comments?.totalCount,\n\t\tvalue.reactions?.totalCount,\n\t\tvalue.body,\n\t\tundefined, // project\n\t\tundefined, // number\n\t\tundefined, // issueType\n\t\tundefined, // providerState\n\t\tundefined, // bodyFormat\n\t\tundefined, // iterations\n\t\tprojection,\n\t\tundefined, // bodyField\n\t\tundefined, // viewer\n\t\tundefined, // viewerUnresolved\n\t\tundefined, // syncedWith\n\t\tfromGitHubMilestone(value.milestone),\n\t);\n}\n\nfunction fromGitHubViewerPermissionToAccessLevel(\n\tpermission: GitHubViewerPermission | null | undefined,\n): RepositoryAccessLevel {\n\tswitch (permission) {\n\t\tcase 'ADMIN':\n\t\t\treturn RepositoryAccessLevel.Admin;\n\t\tcase 'MAINTAIN':\n\t\t\treturn RepositoryAccessLevel.Maintain;\n\t\tcase 'WRITE':\n\t\t\treturn RepositoryAccessLevel.Write;\n\t\tcase 'TRIAGE':\n\t\t\treturn RepositoryAccessLevel.Triage;\n\t\tcase 'READ':\n\t\t\treturn RepositoryAccessLevel.Read;\n\t\tdefault:\n\t\t\treturn RepositoryAccessLevel.None;\n\t}\n}\n"],"mappings":";;;;AA0GA,SAAgB,qBAAqB,QAAgE;CACpG,QAAQ,QAAR;EACC,KAAK,SACJ,OAAO,mBAAmB;EAC3B,KAAK;EACL,KAAK,YACJ,OAAO,mBAAmB;EAC3B,KAAK,WACJ,OAAO,mBAAmB;EAC3B,KAAK,WACJ,OAAO,mBAAmB;EAC3B,KAAK,UACJ,OAAO,mBAAmB;CAC5B;AAED;;AAsPA,SAAS,wBAAwB,QAA4D;CAC5F,IAAI,UAAU,MAAM,OAAO;EAAE,IAAI;EAAS,MAAM;EAAS,UAAU;CAAQ;CAE3E,OAAO;EACN,IAAI,OAAO;EACX,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,WAAW,OAAO;EAClB,KAAK,OAAO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|
@@ -48,7 +48,12 @@ export type PullRequestFieldGroup =
|
|
|
48
48
|
/** `stack`. */
|
|
49
49
|
'stack' |
|
|
50
50
|
/** `milestone`. */
|
|
51
|
-
'milestone'
|
|
51
|
+
'milestone' |
|
|
52
|
+
/**
|
|
53
|
+
* `mergeQueue`, `mergeQueueRequired` and `mergeQueueRemoval`: the merge-queue data was read, so an absent entry
|
|
54
|
+
* means not queued and an absent removal means none since the pull request last joined. Only GitHub.com's is read.
|
|
55
|
+
*/
|
|
56
|
+
'mergeQueue';
|
|
52
57
|
/** A group is `fetched` only when every field in it is. */
|
|
53
58
|
export type IssueFieldGroup =
|
|
54
59
|
/** `body`, and `bodyField` where the provider sets it. */
|
|
@@ -15,7 +15,8 @@ const pullRequestFieldGroups = [
|
|
|
15
15
|
"access",
|
|
16
16
|
"authoredByMe",
|
|
17
17
|
"stack",
|
|
18
|
-
"milestone"
|
|
18
|
+
"milestone",
|
|
19
|
+
"mergeQueue"
|
|
19
20
|
];
|
|
20
21
|
const issueFieldGroups = [
|
|
21
22
|
"description",
|
|
@@ -36,11 +37,15 @@ function pullRequestPresenceOf(fetched, unavailable) {
|
|
|
36
37
|
function issuePresenceOf(fetched, unavailable) {
|
|
37
38
|
return presenceOf(issueFieldGroups, fetched, unavailable);
|
|
38
39
|
}
|
|
39
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` and `mergeQueue` are only selected against
|
|
42
|
+
* github.com.
|
|
43
|
+
*/
|
|
40
44
|
const gitHubLite = pullRequestPresenceOf([
|
|
41
45
|
"description",
|
|
42
46
|
"stack",
|
|
43
|
-
"milestone"
|
|
47
|
+
"milestone",
|
|
48
|
+
"mergeQueue"
|
|
44
49
|
]);
|
|
45
50
|
/**
|
|
46
51
|
* GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they
|
|
@@ -60,7 +65,8 @@ const gitHubFull = pullRequestPresenceOf([
|
|
|
60
65
|
"comments",
|
|
61
66
|
"access",
|
|
62
67
|
"stack",
|
|
63
|
-
"milestone"
|
|
68
|
+
"milestone",
|
|
69
|
+
"mergeQueue"
|
|
64
70
|
]);
|
|
65
71
|
const gitHubPullRequests = {
|
|
66
72
|
point: gitHubLite,
|
|
@@ -92,13 +98,15 @@ const gitHubPullRequests = {
|
|
|
92
98
|
batch: gitHubFull
|
|
93
99
|
};
|
|
94
100
|
/**
|
|
95
|
-
* GitHub Enterprise Server rejects the stack selection,
|
|
101
|
+
* GitHub Enterprise Server rejects the stack selection, and the merge-queue one isn't verified there, so neither is
|
|
102
|
+
* selected: a read that carries `stack` or `mergeQueue` on github.com can't here.
|
|
96
103
|
* provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the
|
|
97
104
|
* repository-scoped read may come from commit statuses alone.
|
|
98
105
|
*/
|
|
99
106
|
const gitHubEnterprisePullRequests = Object.fromEntries(Object.entries(gitHubPullRequests).map(([projection, presence]) => {
|
|
100
107
|
const enterprise = { ...presence };
|
|
101
108
|
if (enterprise.stack === "fetched") enterprise.stack = "unavailable";
|
|
109
|
+
if (enterprise.mergeQueue === "fetched") enterprise.mergeQueue = "unavailable";
|
|
102
110
|
if (projection === "repos") enterprise.checks = "not-requested";
|
|
103
111
|
return [projection, Object.freeze(enterprise)];
|
|
104
112
|
}));
|
|
@@ -121,7 +129,7 @@ const gitHubIssues = {
|
|
|
121
129
|
* GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,
|
|
122
130
|
* and everything else beyond the merge request's identity and refs, off the row.
|
|
123
131
|
*/
|
|
124
|
-
const gitLabOwn = pullRequestPresenceOf([], ["stack"]);
|
|
132
|
+
const gitLabOwn = pullRequestPresenceOf([], ["stack", "mergeQueue"]);
|
|
125
133
|
/**
|
|
126
134
|
* provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null
|
|
127
135
|
* count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is
|
|
@@ -139,7 +147,7 @@ function gitLabProviderApis(comments) {
|
|
|
139
147
|
"reactions",
|
|
140
148
|
"milestone",
|
|
141
149
|
...comments ? ["comments"] : []
|
|
142
|
-
], ["stack"]);
|
|
150
|
+
], ["stack", "mergeQueue"]);
|
|
143
151
|
}
|
|
144
152
|
function gitLabPullRequestsFor(providerApis) {
|
|
145
153
|
return {
|
|
@@ -161,7 +169,8 @@ const azureUnavailable = [
|
|
|
161
169
|
"assignees",
|
|
162
170
|
"reactions",
|
|
163
171
|
"stack",
|
|
164
|
-
"milestone"
|
|
172
|
+
"milestone",
|
|
173
|
+
"mergeQueue"
|
|
165
174
|
];
|
|
166
175
|
/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */
|
|
167
176
|
const azureListed = pullRequestPresenceOf([
|
|
@@ -196,7 +205,8 @@ const bitbucketUnavailable = [
|
|
|
196
205
|
"assignees",
|
|
197
206
|
"reactions",
|
|
198
207
|
"stack",
|
|
199
|
-
"milestone"
|
|
208
|
+
"milestone",
|
|
209
|
+
"mergeQueue"
|
|
200
210
|
];
|
|
201
211
|
const bitbucketProviderApis = pullRequestPresenceOf([
|
|
202
212
|
"description",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldPresence.js","names":[],"sources":["../../../../plus/integrations/src/fieldPresence.ts"],"sourcesContent":["import type { IssueProjection, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { PullRequestProjection, PullRequestShape } from '@gitlens/git/models/pullRequest.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from './constants.js';\n\n/**\n * Whether a row's read fetched a field group.\n *\n * - `fetched`: the read asked for it and surfaces it, so an empty value means \"none\".\n * - `not-requested`: this read didn't ask for it, or asked but doesn't surface it faithfully. Ignore the value even\n * when one is present (some reads fill placeholders); another read may supply it.\n * - `unavailable`: this provider or host can't supply it on this read.\n */\nexport type FieldPresence = 'fetched' | 'not-requested' | 'unavailable';\n\n/** A group is `fetched` only when every field in it is. */\nexport type PullRequestFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `latestReviews`. */\n\t| 'reviews'\n\t/**\n\t * `reviewRequests`: who is requested. Not each request's `isCodeOwner`, which only GitLens' own GitHub reads\n\t * report; every other row leaves it undefined.\n\t */\n\t| 'reviewRequests'\n\t/**\n\t * `reviewDecision`. Only GitHub reports one; elsewhere it is derived from the reviewers' states on the row, which\n\t * ignores the host's own approval rules, so it is never `fetched` there — derive it from `reviews` and\n\t * `reviewRequests` instead.\n\t */\n\t| 'reviewDecision'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `statusCheckRollupState`, on the `PullRequest` class. */\n\t| 'checks'\n\t/** `mergeableState`. */\n\t| 'mergeable'\n\t/** `additions`, `deletions` and `filesChanged`. */\n\t| 'diffStats'\n\t/** `commitCount`, on the `PullRequest` class. */\n\t| 'commitCount'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `viewerCanUpdate`, on the `PullRequest` class, and `repository.accessLevel`. */\n\t| 'access'\n\t/** `authoredByMe`, and the `viewer` it was matched against. */\n\t| 'authoredByMe'\n\t/** `stack`. */\n\t| 'stack'\n\t/** `milestone`. */\n\t| 'milestone';\n\n/** A group is `fetched` only when every field in it is. */\nexport type IssueFieldGroup =\n\t/** `body`, and `bodyField` where the provider sets it. */\n\t| 'description'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `labels`. */\n\t| 'labels'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `repository.accessLevel`. */\n\t| 'access'\n\t/** `milestone`: a Linear issue's is its project milestone. */\n\t| 'milestone';\n\ntype Presence<G extends string> = Readonly<Record<G, FieldPresence>>;\ntype PresenceTable<P extends string, G extends string> = Readonly<Partial<Record<P, Presence<G>>>>;\n\nconst pullRequestFieldGroups: readonly PullRequestFieldGroup[] = [\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'authoredByMe',\n\t'stack',\n\t'milestone',\n];\n\nconst issueFieldGroups: readonly IssueFieldGroup[] = [\n\t'description',\n\t'assignees',\n\t'labels',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'milestone',\n];\n\n/** Every group in `groups` listed as neither `fetched` nor `unavailable` is `not-requested`. */\nfunction presenceOf<G extends string>(\n\tgroups: readonly G[],\n\tfetched: readonly G[],\n\tunavailable: readonly G[] = [],\n): Presence<G> {\n\treturn Object.freeze(\n\t\tObject.fromEntries(\n\t\t\tgroups.map(\n\t\t\t\tgroup =>\n\t\t\t\t\t[\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tfetched.includes(group)\n\t\t\t\t\t\t\t? 'fetched'\n\t\t\t\t\t\t\t: unavailable.includes(group)\n\t\t\t\t\t\t\t\t? 'unavailable'\n\t\t\t\t\t\t\t\t: 'not-requested',\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t) as Record<G, FieldPresence>,\n\t);\n}\n\nfunction pullRequestPresenceOf(\n\tfetched: readonly PullRequestFieldGroup[],\n\tunavailable?: readonly PullRequestFieldGroup[],\n): Presence<PullRequestFieldGroup> {\n\treturn presenceOf(pullRequestFieldGroups, fetched, unavailable);\n}\n\nfunction issuePresenceOf(\n\tfetched: readonly IssueFieldGroup[],\n\tunavailable?: readonly IssueFieldGroup[],\n): Presence<IssueFieldGroup> {\n\treturn presenceOf(issueFieldGroups, fetched, unavailable);\n}\n\n/** GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` is only selected against github.com. */\nconst gitHubLite = pullRequestPresenceOf(['description', 'stack', 'milestone']);\n\n/**\n * GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they\n * are, GitHub's own review decision included: none stays none, even while a review is requested.\n * `authoredByMe` needs the current account, which a read may fail to resolve, and the other reads never set it.\n */\nconst gitHubFull = pullRequestPresenceOf([\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'access',\n\t'stack',\n\t'milestone',\n]);\n\nconst gitHubPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: gitHubLite,\n\tsearch: gitHubFull,\n\t'search-summary': gitHubLite,\n\t'text-search': gitHubFull,\n\taccount: gitHubFull,\n\t// The lite fragment's own rows.\n\t'account-summary': gitHubLite,\n\t// provider-apis' own fragment and normalizer. Its review-state map has no DISMISSED, so a dismissed review is\n\t// dropped (and none carries a `commitOid`); it removes code-owner requests; it derives the review decision from\n\t// that list rather than reading GitHub's; and it doesn't read `repository.accessLevel`.\n\trepos: pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'checks',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'commitCount',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\t// `summary` drops the `commits` subtree that carries both the check rollup and the commit count.\n\t'repos-summary': pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\tbatch: gitHubFull,\n};\n\n/**\n * GitHub Enterprise Server rejects the stack selection, so a read that carries `stack` on github.com can't here.\n * provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the\n * repository-scoped read may come from commit statuses alone.\n */\nconst gitHubEnterprisePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = Object.fromEntries(\n\tObject.entries(gitHubPullRequests).map(([projection, presence]) => {\n\t\tconst enterprise: Record<PullRequestFieldGroup, FieldPresence> = { ...presence };\n\t\tif (enterprise.stack === 'fetched') {\n\t\t\tenterprise.stack = 'unavailable';\n\t\t}\n\t\tif (projection === 'repos') {\n\t\t\tenterprise.checks = 'not-requested';\n\t\t}\n\t\treturn [projection, Object.freeze(enterprise)];\n\t}),\n);\n\n/** GitLens' own issue fragment, which every native read selects with the body. */\nconst gitHubNativeIssue = presenceOf(issueFieldGroups, issueFieldGroups);\n\nconst gitHubIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: gitHubNativeIssue,\n\tsearch: gitHubNativeIssue,\n\taccount: gitHubNativeIssue,\n\t// provider-apis' own fragment selects neither the body nor the repository's `viewerPermission`.\n\trepos: presenceOf(issueFieldGroups, ['assignees', 'labels', 'comments', 'reactions', 'milestone']),\n\tbatch: gitHubNativeIssue,\n};\n\n/*\n * Every other provider. None of them reads the viewer's access (`repository.accessLevel` is absent on every row),\n * resolves `authoredByMe` reliably, or has stacks, and only GitLab and Linear have milestones. provider-apis honors\n * neither `summary` nor `includeReviews` for them, so each `-summary` tag reads like its full one.\n */\n\n/**\n * GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,\n * and everything else beyond the merge request's identity and refs, off the row.\n */\nconst gitLabOwn = pullRequestPresenceOf([], ['stack']);\n\n/**\n * provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null\n * count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is\n * promised — except that GitLab.com's comment count resolver answers 0 rather than null, which a self-managed\n * version may not.\n */\nfunction gitLabProviderApis(comments: boolean): Presence<PullRequestFieldGroup> {\n\treturn pullRequestPresenceOf(\n\t\t[\n\t\t\t'description',\n\t\t\t'reviews',\n\t\t\t'reviewRequests',\n\t\t\t'assignees',\n\t\t\t'checks',\n\t\t\t'mergeable',\n\t\t\t'reactions',\n\t\t\t'milestone',\n\t\t\t...(comments ? (['comments'] as const) : []),\n\t\t],\n\t\t['stack'],\n\t);\n}\n\nfunction gitLabPullRequestsFor(\n\tproviderApis: Presence<PullRequestFieldGroup>,\n): PresenceTable<PullRequestProjection, PullRequestFieldGroup> {\n\treturn {\n\t\tpoint: gitLabOwn,\n\t\tsearch: providerApis,\n\t\t'text-search': gitLabOwn,\n\t\taccount: providerApis,\n\t\t'account-summary': providerApis,\n\t\trepos: providerApis,\n\t\t'repos-summary': providerApis,\n\t\tbatch: providerApis,\n\t};\n}\n\n/**\n * Azure DevOps pull requests have no assignees (both converters fill `assignees` with the reviewers, which `reviews` and\n * `reviewRequests` already hold) and no reactions. Neither converter reads checks or counts.\n */\nconst azureUnavailable: readonly PullRequestFieldGroup[] = ['assignees', 'reactions', 'stack', 'milestone'];\n/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */\nconst azureListed = pullRequestPresenceOf(['reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n/** The batch reads fetch each pull request by id, which returns the whole description. */\nconst azureById = pullRequestPresenceOf(['description', 'reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n\nconst azurePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which leaves the description off the row.\n\tpoint: azureListed,\n\tsearch: azureListed,\n\t'text-search': azureListed,\n\taccount: azureListed,\n\t'account-summary': azureListed,\n\trepos: azureListed,\n\t'repos-summary': azureListed,\n\tbatch: azureById,\n};\n\nconst azureServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t...azurePullRequests,\n\t'search-summary': azureListed,\n};\n\n/**\n * Bitbucket pull requests have no assignees or reactions. Neither provider-apis nor GitLens reads their build\n * statuses or mergeability: provider-apis fills a literal Mergeable, and GitLens' own converters leave it unset.\n */\nconst bitbucketUnavailable: readonly PullRequestFieldGroup[] = ['assignees', 'reactions', 'stack', 'milestone'];\nconst bitbucketProviderApis = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\n\nconst bitbucketPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which drops the comment count. The commit read selects `+values.*`, which isn't\n\t// known to bring the participants the reviews come from, as the other two point reads do.\n\tpoint: pullRequestPresenceOf(['description'], bitbucketUnavailable),\n\tsearch: bitbucketProviderApis,\n\t'text-search': bitbucketProviderApis,\n\taccount: bitbucketProviderApis,\n\t'account-summary': bitbucketProviderApis,\n\trepos: bitbucketProviderApis,\n\t'repos-summary': bitbucketProviderApis,\n\t// GitLens' own converter over reads that do select the participants.\n\tbatch: pullRequestPresenceOf(['description', 'reviews', 'reviewRequests'], bitbucketUnavailable),\n};\n\n/** provider-apis' and GitLens' own Data Center converters read the same fields. */\nconst bitbucketServerAll = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\nconst bitbucketServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: bitbucketServerAll,\n\tsearch: bitbucketServerAll,\n\t'search-summary': bitbucketServerAll,\n\t'text-search': bitbucketServerAll,\n\taccount: bitbucketServerAll,\n\t'account-summary': bitbucketServerAll,\n\trepos: bitbucketServerAll,\n\t'repos-summary': bitbucketServerAll,\n\tbatch: bitbucketServerAll,\n};\n\n/**\n * provider-apis' GitLab issue reads (GraphQL, and REST for the account-wide one). The repository's access isn't read.\n * The GraphQL comment count is nullable like the merge request's, and passed through, so only GitLab.com's is\n * promised; the REST one is always a number. The REST normalizer drops the milestone the response carries.\n */\nfunction gitLabIssuesFor(comments: boolean): PresenceTable<IssueProjection, IssueFieldGroup> {\n\tconst graphQL = issuePresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'labels',\n\t\t'reactions',\n\t\t'milestone',\n\t\t...(comments ? (['comments'] as const) : []),\n\t]);\n\treturn {\n\t\tpoint: graphQL,\n\t\taccount: issuePresenceOf(['description', 'assignees', 'labels', 'comments', 'reactions']),\n\t\trepos: graphQL,\n\t\tbatch: graphQL,\n\t};\n}\n\n/**\n * Azure DevOps work items have no reactions (provider-apis' converter fills 0; GitLens' leaves it unset) and belong to\n * a project, not a repository.\n */\nconst azureWorkItemUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/** provider-apis' work item converter, and GitLens' copy of it for the batch read. */\nconst azureWorkItem = issuePresenceOf(['description', 'assignees', 'labels', 'comments'], azureWorkItemUnavailable);\n/** GitLens' own work item converter, which drops the tags. */\nconst azureOwnWorkItem = issuePresenceOf(['description', 'assignees', 'comments'], azureWorkItemUnavailable);\n\nconst azureIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: azureOwnWorkItem,\n\taccount: azureWorkItem,\n\trepos: azureWorkItem,\n\tbatch: azureWorkItem,\n};\n\nconst azureServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...azureIssues,\n\tsearch: azureOwnWorkItem,\n};\n\n/**\n * Bitbucket Cloud's legacy issues, which only the host's own `getIssue` and `searchMyIssues` read. They have no\n * labels, their votes aren't reactions, and neither a comment count nor the repository's access is read.\n */\nconst bitbucketIssue = issuePresenceOf(['description', 'assignees'], ['labels', 'reactions', 'milestone']);\nconst bitbucketIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: bitbucketIssue,\n\taccount: bitbucketIssue,\n};\n\n/**\n * Tracker issues belong to no repository, and a tracker's votes aren't reactions (and read 0 where voting is off), so\n * neither group can be supplied. Nor a milestone: Trello has none, and Jira's fix versions and sprints are many per\n * issue, not one.\n */\nconst trackerUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/**\n * provider-apis' Jira converter counts the comments embedded in the issue, which Jira may cap, rather than reading\n * their total.\n */\nconst jiraProviderApis = issuePresenceOf(['description', 'assignees', 'labels'], trackerUnavailable);\n\nconst jiraIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: jiraProviderApis,\n\taccount: jiraProviderApis,\n\tproject: jiraProviderApis,\n\t// GitLens' own by-key read, which reads the comment total.\n\tbatch: issuePresenceOf(['description', 'assignees', 'labels', 'comments'], trackerUnavailable),\n};\n\nconst jiraServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...jiraIssues,\n\tbatch: jiraProviderApis,\n};\n\n/** provider-apis' Linear fragment selects no labels (it fills an empty list), comments or reactions. */\nconst linearIssue = issuePresenceOf(['description', 'assignees', 'milestone'], ['access']);\nconst linearIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: linearIssue,\n\taccount: linearIssue,\n\tproject: linearIssue,\n\tbatch: linearIssue,\n};\n\n/** A Trello card's description is never read; its members are its assignees. */\nconst trelloCard = issuePresenceOf(['assignees', 'labels', 'comments'], trackerUnavailable);\nconst trelloIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: trelloCard,\n\tproject: trelloCard,\n};\n\n/**\n * provider-apis' Asana task fields: its notes, its single assignee, its tags as labels and its likes as reactions.\n * Comments are stories, which a task doesn't count, so reading them would cost a request per task.\n */\nconst asanaTask = issuePresenceOf(['description', 'assignees', 'labels', 'reactions'], ['access', 'milestone']);\nconst asanaIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: asanaTask,\n\taccount: asanaTask,\n\tproject: asanaTask,\n};\n\nconst pullRequestPresence = new Map<string, PresenceTable<PullRequestProjection, PullRequestFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubPullRequests],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubEnterprisePullRequests],\n\t[GitCloudHostIntegrationId.GitLab, gitLabPullRequestsFor(gitLabProviderApis(true))],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabPullRequestsFor(gitLabProviderApis(false))],\n\t[GitCloudHostIntegrationId.AzureDevOps, azurePullRequests],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerPullRequests],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketPullRequests],\n\t[GitSelfManagedHostIntegrationId.BitbucketServer, bitbucketServerPullRequests],\n]);\n\nconst issuePresence = new Map<string, PresenceTable<IssueProjection, IssueFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubIssues],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubIssues],\n\t[GitCloudHostIntegrationId.GitLab, gitLabIssuesFor(true)],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabIssuesFor(false)],\n\t[GitCloudHostIntegrationId.AzureDevOps, azureIssues],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerIssues],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketIssues],\n\t[IssuesCloudHostIntegrationId.Jira, jiraIssues],\n\t[IssuesSelfManagedHostIntegrationId.JiraServer, jiraServerIssues],\n\t[IssuesCloudHostIntegrationId.Linear, linearIssues],\n\t[IssuesCloudHostIntegrationId.Trello, trelloIssues],\n\t[IssuesCloudHostIntegrationId.Asana, asanaIssues],\n]);\n\nfunction lookup<P extends string, G extends string>(\n\ttables: ReadonlyMap<string, PresenceTable<P, G>>,\n\tproviderId: string,\n\tprojection: P | undefined,\n): Presence<G> | undefined {\n\tif (projection == null) return undefined;\n\n\tconst table = tables.get(providerId);\n\t// `hasOwn` so a projection read off an untrusted row can't resolve to an `Object.prototype` member.\n\treturn table != null && Object.hasOwn(table, projection) ? table[projection] : undefined;\n}\n\n/**\n * Which field groups the read that produced `pr` fetched, keyed by its provider and {@link PullRequestShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getPullRequestFieldPresence(\n\tpr: PullRequestShape,\n): Readonly<Record<PullRequestFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(pullRequestPresence, pr.provider.id, pr.projection);\n}\n\n/**\n * Which field groups the read that produced `issue` fetched, keyed by its provider and {@link IssueShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getIssueFieldPresence(issue: IssueShape): Readonly<Record<IssueFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(issuePresence, issue.provider.id, issue.projection);\n}\n"],"mappings":";;AA+EA,MAAM,yBAA2D;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAEA,MAAM,mBAA+C;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAGA,SAAS,WACR,QACA,SACA,cAA4B,CAAC,GACf;CACd,OAAO,OAAO,OACb,OAAO,YACN,OAAO,KACN,UACC,CACC,OACA,QAAQ,SAAS,KAAK,IACnB,YACA,YAAY,SAAS,KAAK,IACzB,gBACA,eACL,CACF,CACD,CACD;AACD;AAEA,SAAS,sBACR,SACA,aACkC;CAClC,OAAO,WAAW,wBAAwB,SAAS,WAAW;AAC/D;AAEA,SAAS,gBACR,SACA,aAC4B;CAC5B,OAAO,WAAW,kBAAkB,SAAS,WAAW;AACzD;;AAGA,MAAM,aAAa,sBAAsB;CAAC;CAAe;CAAS;AAAW,CAAC;;;;;;AAO9E,MAAM,aAAa,sBAAsB;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AAED,MAAM,qBAAkF;CACvF,OAAO;CACP,QAAQ;CACR,kBAAkB;CAClB,eAAe;CACf,SAAS;CAET,mBAAmB;CAInB,OAAO,sBAAsB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAED,iBAAiB,sBAAsB;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,OAAO;AACR;;;;;;AAOA,MAAM,+BAA4F,OAAO,YACxG,OAAO,QAAQ,kBAAkB,CAAC,CAAC,KAAK,CAAC,YAAY,cAAc;CAClE,MAAM,aAA2D,EAAE,GAAG,SAAS;CAC/E,IAAI,WAAW,UAAU,WACxB,WAAW,QAAQ;CAEpB,IAAI,eAAe,SAClB,WAAW,SAAS;CAErB,OAAO,CAAC,YAAY,OAAO,OAAO,UAAU,CAAC;AAC9C,CAAC,CACF;;AAGA,MAAM,oBAAo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AAS,QAAQ,OAAO,OAAO,OAAO,UAAU,IAAI,MAAM,cAAc,KAAA;AAChF;;;;;AAMA,SAAgB,4BACf,IACqE;CACrE,OAAO,OAAO,qBAAqB,GAAG,SAAS,IAAI,GAAG,UAAU;AACjE;;;;;AAMA,SAAgB,sBAAsB,OAAiF;CACtH,OAAO,OAAO,eAAe,MAAM,SAAS,IAAI,MAAM,UAAU;AACjE"}
|
|
1
|
+
{"version":3,"file":"fieldPresence.js","names":[],"sources":["../../../../plus/integrations/src/fieldPresence.ts"],"sourcesContent":["import type { IssueProjection, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { PullRequestProjection, PullRequestShape } from '@gitlens/git/models/pullRequest.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from './constants.js';\n\n/**\n * Whether a row's read fetched a field group.\n *\n * - `fetched`: the read asked for it and surfaces it, so an empty value means \"none\".\n * - `not-requested`: this read didn't ask for it, or asked but doesn't surface it faithfully. Ignore the value even\n * when one is present (some reads fill placeholders); another read may supply it.\n * - `unavailable`: this provider or host can't supply it on this read.\n */\nexport type FieldPresence = 'fetched' | 'not-requested' | 'unavailable';\n\n/** A group is `fetched` only when every field in it is. */\nexport type PullRequestFieldGroup =\n\t/** `body`. */\n\t| 'description'\n\t/** `latestReviews`. */\n\t| 'reviews'\n\t/**\n\t * `reviewRequests`: who is requested. Not each request's `isCodeOwner`, which only GitLens' own GitHub reads\n\t * report; every other row leaves it undefined.\n\t */\n\t| 'reviewRequests'\n\t/**\n\t * `reviewDecision`. Only GitHub reports one; elsewhere it is derived from the reviewers' states on the row, which\n\t * ignores the host's own approval rules, so it is never `fetched` there — derive it from `reviews` and\n\t * `reviewRequests` instead.\n\t */\n\t| 'reviewDecision'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `statusCheckRollupState`, on the `PullRequest` class. */\n\t| 'checks'\n\t/** `mergeableState`. */\n\t| 'mergeable'\n\t/** `additions`, `deletions` and `filesChanged`. */\n\t| 'diffStats'\n\t/** `commitCount`, on the `PullRequest` class. */\n\t| 'commitCount'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `viewerCanUpdate`, on the `PullRequest` class, and `repository.accessLevel`. */\n\t| 'access'\n\t/** `authoredByMe`, and the `viewer` it was matched against. */\n\t| 'authoredByMe'\n\t/** `stack`. */\n\t| 'stack'\n\t/** `milestone`. */\n\t| 'milestone'\n\t/**\n\t * `mergeQueue`, `mergeQueueRequired` and `mergeQueueRemoval`: the merge-queue data was read, so an absent entry\n\t * means not queued and an absent removal means none since the pull request last joined. Only GitHub.com's is read.\n\t */\n\t| 'mergeQueue';\n\n/** A group is `fetched` only when every field in it is. */\nexport type IssueFieldGroup =\n\t/** `body`, and `bodyField` where the provider sets it. */\n\t| 'description'\n\t/** `assignees`. */\n\t| 'assignees'\n\t/** `labels`. */\n\t| 'labels'\n\t/** `commentsCount`. */\n\t| 'comments'\n\t/** `thumbsUpCount`. */\n\t| 'reactions'\n\t/** `repository.accessLevel`. */\n\t| 'access'\n\t/** `milestone`: a Linear issue's is its project milestone. */\n\t| 'milestone';\n\ntype Presence<G extends string> = Readonly<Record<G, FieldPresence>>;\ntype PresenceTable<P extends string, G extends string> = Readonly<Partial<Record<P, Presence<G>>>>;\n\nconst pullRequestFieldGroups: readonly PullRequestFieldGroup[] = [\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'authoredByMe',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n];\n\nconst issueFieldGroups: readonly IssueFieldGroup[] = [\n\t'description',\n\t'assignees',\n\t'labels',\n\t'comments',\n\t'reactions',\n\t'access',\n\t'milestone',\n];\n\n/** Every group in `groups` listed as neither `fetched` nor `unavailable` is `not-requested`. */\nfunction presenceOf<G extends string>(\n\tgroups: readonly G[],\n\tfetched: readonly G[],\n\tunavailable: readonly G[] = [],\n): Presence<G> {\n\treturn Object.freeze(\n\t\tObject.fromEntries(\n\t\t\tgroups.map(\n\t\t\t\tgroup =>\n\t\t\t\t\t[\n\t\t\t\t\t\tgroup,\n\t\t\t\t\t\tfetched.includes(group)\n\t\t\t\t\t\t\t? 'fetched'\n\t\t\t\t\t\t\t: unavailable.includes(group)\n\t\t\t\t\t\t\t\t? 'unavailable'\n\t\t\t\t\t\t\t\t: 'not-requested',\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t) as Record<G, FieldPresence>,\n\t);\n}\n\nfunction pullRequestPresenceOf(\n\tfetched: readonly PullRequestFieldGroup[],\n\tunavailable?: readonly PullRequestFieldGroup[],\n): Presence<PullRequestFieldGroup> {\n\treturn presenceOf(pullRequestFieldGroups, fetched, unavailable);\n}\n\nfunction issuePresenceOf(\n\tfetched: readonly IssueFieldGroup[],\n\tunavailable?: readonly IssueFieldGroup[],\n): Presence<IssueFieldGroup> {\n\treturn presenceOf(issueFieldGroups, fetched, unavailable);\n}\n\n/**\n * GitLens' own lite fragment (`fromGitHubPullRequestLite`). `stack` and `mergeQueue` are only selected against\n * github.com.\n */\nconst gitHubLite = pullRequestPresenceOf(['description', 'stack', 'milestone', 'mergeQueue']);\n\n/**\n * GitLens' own full fragment, which selects no reactions. The account-wide and batch reads return its rows as they\n * are, GitHub's own review decision included: none stays none, even while a review is requested.\n * `authoredByMe` needs the current account, which a read may fail to resolve, and the other reads never set it.\n */\nconst gitHubFull = pullRequestPresenceOf([\n\t'description',\n\t'reviews',\n\t'reviewRequests',\n\t'reviewDecision',\n\t'assignees',\n\t'checks',\n\t'mergeable',\n\t'diffStats',\n\t'commitCount',\n\t'comments',\n\t'access',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n]);\n\nconst gitHubPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: gitHubLite,\n\tsearch: gitHubFull,\n\t'search-summary': gitHubLite,\n\t'text-search': gitHubFull,\n\taccount: gitHubFull,\n\t// The lite fragment's own rows.\n\t'account-summary': gitHubLite,\n\t// provider-apis' own fragment and normalizer. Its review-state map has no DISMISSED, so a dismissed review is\n\t// dropped (and none carries a `commitOid`); it removes code-owner requests; it derives the review decision from\n\t// that list rather than reading GitHub's; and it doesn't read `repository.accessLevel`.\n\trepos: pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'checks',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'commitCount',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\t// `summary` drops the `commits` subtree that carries both the check rollup and the commit count.\n\t'repos-summary': pullRequestPresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'mergeable',\n\t\t'diffStats',\n\t\t'comments',\n\t\t'reactions',\n\t\t'milestone',\n\t]),\n\tbatch: gitHubFull,\n};\n\n/**\n * GitHub Enterprise Server rejects the stack selection, and the merge-queue one isn't verified there, so neither is\n * selected: a read that carries `stack` or `mergeQueue` on github.com can't here.\n * provider-apis also gates check runs on the server version, which this table can't see, so its rollup on the\n * repository-scoped read may come from commit statuses alone.\n */\nconst gitHubEnterprisePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = Object.fromEntries(\n\tObject.entries(gitHubPullRequests).map(([projection, presence]) => {\n\t\tconst enterprise: Record<PullRequestFieldGroup, FieldPresence> = { ...presence };\n\t\tif (enterprise.stack === 'fetched') {\n\t\t\tenterprise.stack = 'unavailable';\n\t\t}\n\t\tif (enterprise.mergeQueue === 'fetched') {\n\t\t\tenterprise.mergeQueue = 'unavailable';\n\t\t}\n\t\tif (projection === 'repos') {\n\t\t\tenterprise.checks = 'not-requested';\n\t\t}\n\t\treturn [projection, Object.freeze(enterprise)];\n\t}),\n);\n\n/** GitLens' own issue fragment, which every native read selects with the body. */\nconst gitHubNativeIssue = presenceOf(issueFieldGroups, issueFieldGroups);\n\nconst gitHubIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: gitHubNativeIssue,\n\tsearch: gitHubNativeIssue,\n\taccount: gitHubNativeIssue,\n\t// provider-apis' own fragment selects neither the body nor the repository's `viewerPermission`.\n\trepos: presenceOf(issueFieldGroups, ['assignees', 'labels', 'comments', 'reactions', 'milestone']),\n\tbatch: gitHubNativeIssue,\n};\n\n/*\n * Every other provider. None of them reads the viewer's access (`repository.accessLevel` is absent on every row),\n * resolves `authoredByMe` reliably, or has stacks, and only GitLab and Linear have milestones; none's merge queue\n * (GitLab's merge trains included) is read yet. provider-apis honors neither `summary` nor `includeReviews` for them,\n * so each `-summary` tag reads like its full one.\n */\n\n/**\n * GitLens' own GitLab reads: the point reads, and the free-text search. They select the description but leave it,\n * and everything else beyond the merge request's identity and refs, off the row.\n */\nconst gitLabOwn = pullRequestPresenceOf([], ['stack', 'mergeQueue']);\n\n/**\n * provider-apis' merge request fragment and normalizer, which every other GitLab read goes through. It turns a null\n * count into 0: GitLab's schema makes `diffStatsSummary`, `commitCount` and `userNotesCount` nullable, so none is\n * promised — except that GitLab.com's comment count resolver answers 0 rather than null, which a self-managed\n * version may not.\n */\nfunction gitLabProviderApis(comments: boolean): Presence<PullRequestFieldGroup> {\n\treturn pullRequestPresenceOf(\n\t\t[\n\t\t\t'description',\n\t\t\t'reviews',\n\t\t\t'reviewRequests',\n\t\t\t'assignees',\n\t\t\t'checks',\n\t\t\t'mergeable',\n\t\t\t'reactions',\n\t\t\t'milestone',\n\t\t\t...(comments ? (['comments'] as const) : []),\n\t\t],\n\t\t['stack', 'mergeQueue'],\n\t);\n}\n\nfunction gitLabPullRequestsFor(\n\tproviderApis: Presence<PullRequestFieldGroup>,\n): PresenceTable<PullRequestProjection, PullRequestFieldGroup> {\n\treturn {\n\t\tpoint: gitLabOwn,\n\t\tsearch: providerApis,\n\t\t'text-search': gitLabOwn,\n\t\taccount: providerApis,\n\t\t'account-summary': providerApis,\n\t\trepos: providerApis,\n\t\t'repos-summary': providerApis,\n\t\tbatch: providerApis,\n\t};\n}\n\n/**\n * Azure DevOps pull requests have no assignees (both converters fill `assignees` with the reviewers, which `reviews` and\n * `reviewRequests` already hold) and no reactions. Neither converter reads checks or counts.\n */\nconst azureUnavailable: readonly PullRequestFieldGroup[] = [\n\t'assignees',\n\t'reactions',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n];\n/** Every list read: Azure truncates a listed pull request's description (to 400 characters). */\nconst azureListed = pullRequestPresenceOf(['reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n/** The batch reads fetch each pull request by id, which returns the whole description. */\nconst azureById = pullRequestPresenceOf(['description', 'reviews', 'reviewRequests', 'mergeable'], azureUnavailable);\n\nconst azurePullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which leaves the description off the row.\n\tpoint: azureListed,\n\tsearch: azureListed,\n\t'text-search': azureListed,\n\taccount: azureListed,\n\t'account-summary': azureListed,\n\trepos: azureListed,\n\t'repos-summary': azureListed,\n\tbatch: azureById,\n};\n\nconst azureServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t...azurePullRequests,\n\t'search-summary': azureListed,\n};\n\n/**\n * Bitbucket pull requests have no assignees or reactions. Neither provider-apis nor GitLens reads their build\n * statuses or mergeability: provider-apis fills a literal Mergeable, and GitLens' own converters leave it unset.\n */\nconst bitbucketUnavailable: readonly PullRequestFieldGroup[] = [\n\t'assignees',\n\t'reactions',\n\t'stack',\n\t'milestone',\n\t'mergeQueue',\n];\nconst bitbucketProviderApis = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\n\nconst bitbucketPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\t// GitLens' own converter, which drops the comment count. The commit read selects `+values.*`, which isn't\n\t// known to bring the participants the reviews come from, as the other two point reads do.\n\tpoint: pullRequestPresenceOf(['description'], bitbucketUnavailable),\n\tsearch: bitbucketProviderApis,\n\t'text-search': bitbucketProviderApis,\n\taccount: bitbucketProviderApis,\n\t'account-summary': bitbucketProviderApis,\n\trepos: bitbucketProviderApis,\n\t'repos-summary': bitbucketProviderApis,\n\t// GitLens' own converter over reads that do select the participants.\n\tbatch: pullRequestPresenceOf(['description', 'reviews', 'reviewRequests'], bitbucketUnavailable),\n};\n\n/** provider-apis' and GitLens' own Data Center converters read the same fields. */\nconst bitbucketServerAll = pullRequestPresenceOf(\n\t['description', 'reviews', 'reviewRequests', 'comments'],\n\tbitbucketUnavailable,\n);\nconst bitbucketServerPullRequests: PresenceTable<PullRequestProjection, PullRequestFieldGroup> = {\n\tpoint: bitbucketServerAll,\n\tsearch: bitbucketServerAll,\n\t'search-summary': bitbucketServerAll,\n\t'text-search': bitbucketServerAll,\n\taccount: bitbucketServerAll,\n\t'account-summary': bitbucketServerAll,\n\trepos: bitbucketServerAll,\n\t'repos-summary': bitbucketServerAll,\n\tbatch: bitbucketServerAll,\n};\n\n/**\n * provider-apis' GitLab issue reads (GraphQL, and REST for the account-wide one). The repository's access isn't read.\n * The GraphQL comment count is nullable like the merge request's, and passed through, so only GitLab.com's is\n * promised; the REST one is always a number. The REST normalizer drops the milestone the response carries.\n */\nfunction gitLabIssuesFor(comments: boolean): PresenceTable<IssueProjection, IssueFieldGroup> {\n\tconst graphQL = issuePresenceOf([\n\t\t'description',\n\t\t'assignees',\n\t\t'labels',\n\t\t'reactions',\n\t\t'milestone',\n\t\t...(comments ? (['comments'] as const) : []),\n\t]);\n\treturn {\n\t\tpoint: graphQL,\n\t\taccount: issuePresenceOf(['description', 'assignees', 'labels', 'comments', 'reactions']),\n\t\trepos: graphQL,\n\t\tbatch: graphQL,\n\t};\n}\n\n/**\n * Azure DevOps work items have no reactions (provider-apis' converter fills 0; GitLens' leaves it unset) and belong to\n * a project, not a repository.\n */\nconst azureWorkItemUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/** provider-apis' work item converter, and GitLens' copy of it for the batch read. */\nconst azureWorkItem = issuePresenceOf(['description', 'assignees', 'labels', 'comments'], azureWorkItemUnavailable);\n/** GitLens' own work item converter, which drops the tags. */\nconst azureOwnWorkItem = issuePresenceOf(['description', 'assignees', 'comments'], azureWorkItemUnavailable);\n\nconst azureIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: azureOwnWorkItem,\n\taccount: azureWorkItem,\n\trepos: azureWorkItem,\n\tbatch: azureWorkItem,\n};\n\nconst azureServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...azureIssues,\n\tsearch: azureOwnWorkItem,\n};\n\n/**\n * Bitbucket Cloud's legacy issues, which only the host's own `getIssue` and `searchMyIssues` read. They have no\n * labels, their votes aren't reactions, and neither a comment count nor the repository's access is read.\n */\nconst bitbucketIssue = issuePresenceOf(['description', 'assignees'], ['labels', 'reactions', 'milestone']);\nconst bitbucketIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: bitbucketIssue,\n\taccount: bitbucketIssue,\n};\n\n/**\n * Tracker issues belong to no repository, and a tracker's votes aren't reactions (and read 0 where voting is off), so\n * neither group can be supplied. Nor a milestone: Trello has none, and Jira's fix versions and sprints are many per\n * issue, not one.\n */\nconst trackerUnavailable: readonly IssueFieldGroup[] = ['reactions', 'access', 'milestone'];\n/**\n * provider-apis' Jira converter counts the comments embedded in the issue, which Jira may cap, rather than reading\n * their total.\n */\nconst jiraProviderApis = issuePresenceOf(['description', 'assignees', 'labels'], trackerUnavailable);\n\nconst jiraIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: jiraProviderApis,\n\taccount: jiraProviderApis,\n\tproject: jiraProviderApis,\n\t// GitLens' own by-key read, which reads the comment total.\n\tbatch: issuePresenceOf(['description', 'assignees', 'labels', 'comments'], trackerUnavailable),\n};\n\nconst jiraServerIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\t...jiraIssues,\n\tbatch: jiraProviderApis,\n};\n\n/** provider-apis' Linear fragment selects no labels (it fills an empty list), comments or reactions. */\nconst linearIssue = issuePresenceOf(['description', 'assignees', 'milestone'], ['access']);\nconst linearIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: linearIssue,\n\taccount: linearIssue,\n\tproject: linearIssue,\n\tbatch: linearIssue,\n};\n\n/** A Trello card's description is never read; its members are its assignees. */\nconst trelloCard = issuePresenceOf(['assignees', 'labels', 'comments'], trackerUnavailable);\nconst trelloIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: trelloCard,\n\tproject: trelloCard,\n};\n\n/**\n * provider-apis' Asana task fields: its notes, its single assignee, its tags as labels and its likes as reactions.\n * Comments are stories, which a task doesn't count, so reading them would cost a request per task.\n */\nconst asanaTask = issuePresenceOf(['description', 'assignees', 'labels', 'reactions'], ['access', 'milestone']);\nconst asanaIssues: PresenceTable<IssueProjection, IssueFieldGroup> = {\n\tpoint: asanaTask,\n\taccount: asanaTask,\n\tproject: asanaTask,\n};\n\nconst pullRequestPresence = new Map<string, PresenceTable<PullRequestProjection, PullRequestFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubPullRequests],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubEnterprisePullRequests],\n\t[GitCloudHostIntegrationId.GitLab, gitLabPullRequestsFor(gitLabProviderApis(true))],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabPullRequestsFor(gitLabProviderApis(false))],\n\t[GitCloudHostIntegrationId.AzureDevOps, azurePullRequests],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerPullRequests],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketPullRequests],\n\t[GitSelfManagedHostIntegrationId.BitbucketServer, bitbucketServerPullRequests],\n]);\n\nconst issuePresence = new Map<string, PresenceTable<IssueProjection, IssueFieldGroup>>([\n\t[GitCloudHostIntegrationId.GitHub, gitHubIssues],\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise, gitHubIssues],\n\t[GitCloudHostIntegrationId.GitLab, gitLabIssuesFor(true)],\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted, gitLabIssuesFor(false)],\n\t[GitCloudHostIntegrationId.AzureDevOps, azureIssues],\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer, azureServerIssues],\n\t[GitCloudHostIntegrationId.Bitbucket, bitbucketIssues],\n\t[IssuesCloudHostIntegrationId.Jira, jiraIssues],\n\t[IssuesSelfManagedHostIntegrationId.JiraServer, jiraServerIssues],\n\t[IssuesCloudHostIntegrationId.Linear, linearIssues],\n\t[IssuesCloudHostIntegrationId.Trello, trelloIssues],\n\t[IssuesCloudHostIntegrationId.Asana, asanaIssues],\n]);\n\nfunction lookup<P extends string, G extends string>(\n\ttables: ReadonlyMap<string, PresenceTable<P, G>>,\n\tproviderId: string,\n\tprojection: P | undefined,\n): Presence<G> | undefined {\n\tif (projection == null) return undefined;\n\n\tconst table = tables.get(providerId);\n\t// `hasOwn` so a projection read off an untrusted row can't resolve to an `Object.prototype` member.\n\treturn table != null && Object.hasOwn(table, projection) ? table[projection] : undefined;\n}\n\n/**\n * Which field groups the read that produced `pr` fetched, keyed by its provider and {@link PullRequestShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getPullRequestFieldPresence(\n\tpr: PullRequestShape,\n): Readonly<Record<PullRequestFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(pullRequestPresence, pr.provider.id, pr.projection);\n}\n\n/**\n * Which field groups the read that produced `issue` fetched, keyed by its provider and {@link IssueShape.projection}.\n * `undefined` when either is unknown or the provider has no table yet — then nothing can be said about any field.\n */\nexport function getIssueFieldPresence(issue: IssueShape): Readonly<Record<IssueFieldGroup, FieldPresence>> | undefined {\n\treturn lookup(issuePresence, issue.provider.id, issue.projection);\n}\n"],"mappings":";;AAoFA,MAAM,yBAA2D;CAChE;C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,OAAO,IAAI,UAAU;CAEnC,OAAO,SAAS,QAAQ,OAAO,OAAO,OAAO,UAAU,IAAI,MAAM,cAAc,KAAA;AAChF;;;;;AAMA,SAAgB,4BACf,IACqE;CACrE,OAAO,OAAO,qBAAqB,GAAG,SAAS,IAAI,GAAG,UAAU;AACjE;;;;;AAMA,SAAgB,sBAAsB,OAAiF;CACtH,OAAO,OAAO,eAAe,MAAM,SAAS,IAAI,MAAM,UAAU;AACjE"}
|
|
@@ -2,7 +2,7 @@ import { PagedResult } from "../../../utils/paging.js";
|
|
|
2
2
|
import { ResourceDescriptor } from "../../../git/models/resourceDescriptor.js";
|
|
3
3
|
import { IssueOrPullRequestState } from "../../../git/models/issueOrPullRequest.js";
|
|
4
4
|
import { IssueSearchCriteria, IssueShape } from "../../../git/models/issue.js";
|
|
5
|
-
import { PullRequest, PullRequestFilter, PullRequestMergeMethod, PullRequestSearchCriteria, PullRequestShape, PullRequestStackInfo, PullRequestStackLayers, PullRequestStateFilter } from "../../../git/models/pullRequest.js";
|
|
5
|
+
import { PullRequest, PullRequestFilter, PullRequestMergeMethod, PullRequestMergeQueueActionResult, PullRequestMergeQueueEntry, PullRequestSearchCriteria, PullRequestShape, PullRequestStackInfo, PullRequestStackLayers, PullRequestStateFilter } from "../../../git/models/pullRequest.js";
|
|
6
6
|
import { Account as Account$1, UnidentifiedAuthor } from "../../../git/models/author.js";
|
|
7
7
|
import { DefaultBranch } from "../../../git/models/defaultBranch.js";
|
|
8
8
|
import { RepositoryMetadata } from "../../../git/models/repositoryMetadata.js";
|
|
@@ -174,6 +174,10 @@ export declare abstract class GitHostIntegration<ID extends IntegrationIds = Int
|
|
|
174
174
|
/** Stack membership for every stacked pull request in the repository, keyed by pull request number.
|
|
175
175
|
* Only hosts with a stacks concept implement this (currently GitHub). */
|
|
176
176
|
getStacksByPullRequestNumber?(owner: string, repo: string, cancellation?: AbortSignal): Promise<Map<number, PullRequestStackInfo> | undefined>;
|
|
177
|
+
/** Merge-queue entries for the given base branches of the repository, keyed by pull request number, for rows from a
|
|
178
|
+
* read that selects no merge queue. Only hosts with a readable merge queue implement this (currently GitHub.com);
|
|
179
|
+
* `undefined` means unavailable. INTERIM: remove once provider-apis carries the entry on its rows (goals S6). */
|
|
180
|
+
getMergeQueueEntriesByPullRequestNumber?(owner: string, repo: string, branches: readonly string[], cancellation?: AbortSignal): Promise<Map<number, PullRequestMergeQueueEntry> | undefined>;
|
|
177
181
|
/** The ordered layers of the stack the given pull request belongs to, bottom to top. `undefined`
|
|
178
182
|
* when the host has no stacks concept, the repository isn't enrolled, or the pull request isn't
|
|
179
183
|
* stacked. */
|
|
@@ -282,6 +286,27 @@ export declare abstract class GitHostIntegration<ID extends IntegrationIds = Int
|
|
|
282
286
|
protected abstract mergeProviderPullRequest(session: ProviderAuthenticationSession, pr: PullRequest, options?: {
|
|
283
287
|
mergeMethod?: PullRequestMergeMethod;
|
|
284
288
|
}, cancellation?: AbortSignal): Promise<boolean>;
|
|
289
|
+
/**
|
|
290
|
+
* Adds a pull request to its base branch's merge queue (where `mergeQueueRequired` says merging means queueing).
|
|
291
|
+
* The result says why on failure: the host's refusal (`already-queued`, `head-changed`, `permission`, …),
|
|
292
|
+
* `unsupported` where this host has no merge queue to act on (only GitHub.com's is), or `unknown` for anything
|
|
293
|
+
* else, including no connection or a failure to reach the host — the provider's message rides along for logs, not
|
|
294
|
+
* for display. Cancellation throws `CancellationError`. Evicts cached pull requests whatever the outcome, as
|
|
295
|
+
* {@link mergePullRequest} does.
|
|
296
|
+
*/
|
|
297
|
+
enqueuePullRequest(pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;
|
|
298
|
+
/**
|
|
299
|
+
* Removes a queued pull request from its base branch's merge queue, losing its place there. Results, failures and
|
|
300
|
+
* cancellation as {@link enqueuePullRequest}.
|
|
301
|
+
*/
|
|
302
|
+
dequeuePullRequest(pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;
|
|
303
|
+
/** {@link mergePullRequest}'s session and failure handling, for the merge-queue actions. */
|
|
304
|
+
private runMergeQueueAction;
|
|
305
|
+
/** Implemented only by hosts whose merge queue this integration can act on (currently GitHub.com); the base
|
|
306
|
+
* reports `unsupported` without one. */
|
|
307
|
+
protected enqueueProviderPullRequest?(session: ProviderAuthenticationSession, pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;
|
|
308
|
+
/** See {@link enqueueProviderPullRequest}. */
|
|
309
|
+
protected dequeueProviderPullRequest?(session: ProviderAuthenticationSession, pr: PullRequest, cancellation?: AbortSignal): Promise<PullRequestMergeQueueActionResult>;
|
|
285
310
|
getPullRequestForBranch(repo: T, branch: string, options?: {
|
|
286
311
|
avatarSize?: number;
|
|
287
312
|
expiryOverride?: boolean | number;
|