@gitkraken/core-gitlens 0.62.0 → 0.64.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/git/cache.d.ts +1 -0
  3. package/dist/git/cache.js +11 -0
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/errors.d.ts +15 -0
  6. package/dist/git/errors.js +9 -1
  7. package/dist/git/errors.js.map +1 -1
  8. package/dist/git/models/pullRequest.d.ts +3 -0
  9. package/dist/git/models/pullRequest.js.map +1 -1
  10. package/dist/git/providers/operations.d.ts +4 -3
  11. package/dist/git/providers/staging.d.ts +16 -8
  12. package/dist/git/run.types.d.ts +6 -0
  13. package/dist/git/utils/hiddenRefs.utils.d.ts +15 -0
  14. package/dist/git/utils/hiddenRefs.utils.js +68 -2
  15. package/dist/git/utils/hiddenRefs.utils.js.map +1 -1
  16. package/dist/git/utils/pullRequest.utils.d.ts +3 -6
  17. package/dist/git/utils/pullRequest.utils.js +6 -7
  18. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  19. package/dist/git/watching/gitIgnoreFilter.d.ts +12 -5
  20. package/dist/git/watching/gitIgnoreFilter.js +26 -32
  21. package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
  22. package/dist/git/watching/provider.d.ts +18 -3
  23. package/dist/git/watching/watchGroup.d.ts +7 -2
  24. package/dist/git/watching/watchGroup.js +51 -3
  25. package/dist/git/watching/watchGroup.js.map +1 -1
  26. package/dist/git/watching/watchService.d.ts +6 -3
  27. package/dist/git/watching/watchService.js +94 -64
  28. package/dist/git/watching/watchService.js.map +1 -1
  29. package/dist/git-cli/cliGitProvider.d.ts +2 -0
  30. package/dist/git-cli/cliGitProvider.js +85 -24
  31. package/dist/git-cli/cliGitProvider.js.map +1 -1
  32. package/dist/git-cli/exec/git.js +4 -4
  33. package/dist/git-cli/exec/git.js.map +1 -1
  34. package/dist/git-cli/exec/indexLock.d.ts +7 -5
  35. package/dist/git-cli/exec/indexLock.js +19 -15
  36. package/dist/git-cli/exec/indexLock.js.map +1 -1
  37. package/dist/git-cli/providers/config.d.ts +1 -0
  38. package/dist/git-cli/providers/config.js +13 -3
  39. package/dist/git-cli/providers/config.js.map +1 -1
  40. package/dist/git-cli/providers/staging.d.ts +8 -8
  41. package/dist/git-cli/providers/staging.js +119 -24
  42. package/dist/git-cli/providers/staging.js.map +1 -1
  43. package/dist/plus/git-github/api/config.d.ts +5 -0
  44. package/dist/plus/git-github/api/config.js.map +1 -1
  45. package/dist/plus/git-github/api/github.js +24 -4
  46. package/dist/plus/git-github/api/github.js.map +1 -1
  47. package/dist/plus/git-github/models.d.ts +12 -0
  48. package/dist/plus/git-github/models.js +8 -3
  49. package/dist/plus/git-github/models.js.map +1 -1
  50. package/dist/plus/integrations/context.d.ts +5 -0
  51. package/dist/plus/integrations/extensionManager.d.ts +6 -0
  52. package/dist/plus/integrations/extensionManager.js +10 -0
  53. package/dist/plus/integrations/extensionManager.js.map +1 -0
  54. package/dist/plus/integrations/index.d.ts +5 -63
  55. package/dist/plus/integrations/index.js +4 -53
  56. package/dist/plus/integrations/index.js.map +1 -1
  57. package/dist/plus/integrations/integrationService.d.ts +14 -2
  58. package/dist/plus/integrations/integrationService.js +48 -12
  59. package/dist/plus/integrations/integrationService.js.map +1 -1
  60. package/dist/plus/integrations/manager.d.ts +10 -0
  61. package/dist/plus/integrations/managerContext.d.ts +69 -0
  62. package/dist/plus/integrations/managerContext.js +59 -0
  63. package/dist/plus/integrations/managerContext.js.map +1 -0
  64. package/dist/plus/integrations/models/gitlabMergeRequestWrites.d.ts +167 -0
  65. package/dist/plus/integrations/models/gitlabMergeRequestWrites.js +0 -0
  66. package/dist/plus/integrations/providers/github.js +6 -2
  67. package/dist/plus/integrations/providers/github.js.map +1 -1
  68. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +2 -2
  69. package/dist/plus/integrations/providers/gitlab/gitlab.js +3 -3
  70. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
  71. package/dist/plus/integrations/providers/gitlab/issueWrites.d.ts +4 -13
  72. package/dist/plus/integrations/providers/gitlab/issueWrites.js +33 -136
  73. package/dist/plus/integrations/providers/gitlab/issueWrites.js.map +1 -1
  74. package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.d.ts +30 -0
  75. package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js +569 -0
  76. package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js.map +1 -0
  77. package/dist/plus/integrations/providers/gitlab/writeErrors.d.ts +12 -0
  78. package/dist/plus/integrations/providers/gitlab/writeErrors.js +101 -0
  79. package/dist/plus/integrations/providers/gitlab/writeErrors.js.map +1 -0
  80. package/dist/plus/integrations/providers/gitlab/writeTransport.d.ts +47 -0
  81. package/dist/plus/integrations/providers/gitlab/writeTransport.js +135 -0
  82. package/dist/plus/integrations/providers/gitlab/writeTransport.js.map +1 -0
  83. package/dist/plus/integrations/providers/gitlab.d.ts +6 -1
  84. package/dist/plus/integrations/providers/gitlab.js +9 -1
  85. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  86. package/dist/plus/integrations/reads/etag.d.ts +5 -0
  87. package/dist/plus/integrations/reads/etag.js +2 -0
  88. package/dist/plus/integrations/reads/etag.js.map +1 -1
  89. package/dist/plus/integrations/reads/sweeps.js +1 -1
  90. package/dist/utils/env/node/exec.d.ts +2 -0
  91. package/dist/utils/env/node/exec.js +2 -0
  92. package/dist/utils/env/node/exec.js.map +1 -1
  93. package/docs/integrations.md +86 -9
  94. package/package.json +1 -1
  95. package/dist/plus/integrations/providers/gitlab/issueWriteErrors.d.ts +0 -11
  96. package/dist/plus/integrations/providers/gitlab/issueWriteErrors.js +0 -73
  97. package/dist/plus/integrations/providers/gitlab/issueWriteErrors.js.map +0 -1
@@ -192,6 +192,14 @@ export interface GitHubPullRequestStack {
192
192
  size: number;
193
193
  /** The branch the bottom of the stack targets — the stack's trunk. */
194
194
  baseRefName: string;
195
+ /** Present only when the read selected the stack's merged layers. */
196
+ entries?: {
197
+ nodes: ({
198
+ pullRequest: {
199
+ merged: boolean;
200
+ } | null;
201
+ } | null)[] | null;
202
+ };
195
203
  }
196
204
  export interface GitHubIssue extends Omit<GitHubIssueOrPullRequest, '__typename'> {
197
205
  /** `Actor` is nullable in GitHub's schema — `null` once the author's account is deleted */
@@ -310,6 +318,8 @@ export interface GitHubPullRequestEtagNode extends Pick<GitHubPullRequest, 'id'
310
318
  * never an etag input: only a change to the base branch's rules moves it.
311
319
  */
312
320
  isMergeQueueEnabled?: boolean;
321
+ /** Present only when the read selected the stack's merged layers; `null` when unstacked. */
322
+ stack?: Pick<GitHubPullRequestStack, 'entries'> | null;
313
323
  }
314
324
  export type GitHubCheckStatusState = 'REQUESTED' | 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'WAITING' | 'PENDING';
315
325
  export type GitHubCheckConclusionState = 'ACTION_REQUIRED' | 'TIMED_OUT' | 'CANCELLED' | 'FAILURE' | 'SUCCESS' | 'NEUTRAL' | 'SKIPPED' | 'STARTUP_FAILURE' | 'STALE';
@@ -384,6 +394,8 @@ export interface GitHubIssueEtagNode extends Pick<GitHubIssue, 'id' | 'number' |
384
394
  }
385
395
  export type GitHubViewerPermission = 'ADMIN' | 'MAINTAIN' | 'WRITE' | 'TRIAGE' | 'READ' | 'NONE';
386
396
  export declare function fromGitHubPullRequestLite(pr: GitHubPullRequestLite, provider: Provider, projection?: PullRequestProjection): PullRequest;
397
+ /** How many of a stack's selected entries have merged; `undefined` when the entries weren't selected. */
398
+ export declare function countGitHubStackMergedLayers(stack: Pick<GitHubPullRequestStack, 'entries'> | null | undefined): number | undefined;
387
399
  /**
388
400
  * The one place a GitHub `MergeQueueEntry` becomes a {@link PullRequestMergeQueueEntry}, whichever read selected it.
389
401
  * GitHub's estimate is a duration from the moment it answered, so it's fixed to a date here, at read time, rather
@@ -71,17 +71,22 @@ function fromGitHubMilestone(milestone) {
71
71
  ...milestone.url ? { url: milestone.url } : {}
72
72
  };
73
73
  }
74
- /** Both fields are absent on GitHub Enterprise Server (never selected) and `null` when unstacked. */
75
74
  function fromGitHubPullRequestStack(pr) {
76
75
  if (pr.stack == null || pr.stackEntry == null) return void 0;
76
+ const mergedLayers = countGitHubStackMergedLayers(pr.stack);
77
77
  return {
78
78
  id: pr.stack.id,
79
79
  number: pr.stack.number,
80
80
  size: pr.stack.size,
81
81
  position: pr.stackEntry.position,
82
- baseRef: pr.stack.baseRefName
82
+ baseRef: pr.stack.baseRefName,
83
+ ...mergedLayers != null ? { mergedLayers } : {}
83
84
  };
84
85
  }
86
+ /** How many of a stack's selected entries have merged; `undefined` when the entries weren't selected. */
87
+ function countGitHubStackMergedLayers(stack) {
88
+ return stack?.entries?.nodes?.filter((e) => e?.pullRequest?.merged === true).length;
89
+ }
85
90
  /** Absent where never selected (GitHub Enterprise Server, or a host that didn't opt in) and `null` when the pull
86
91
  * request isn't queued. */
87
92
  function fromGitHubPullRequestMergeQueueEntry(pr) {
@@ -409,6 +414,6 @@ function fromGitHubViewerPermissionToAccessLevel(permission) {
409
414
  }
410
415
  }
411
416
  //#endregion
412
- export { decodeGitHubCheckRunId, encodeGitHubCheckRunId, fromCommitFileStatus, fromGitHubCheckConclusionState, fromGitHubCheckContext, fromGitHubCheckContextState, fromGitHubCheckStatusState, fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntry, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequest, fromGitHubPullRequestLite, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestReviewState, fromGitHubPullRequestStatusCheckRollupState, fromGitHubStatusState, toGitHubCheckRunId, toGitHubPullRequestMergeableState, toGitHubPullRequestReviewDecision, toGitHubPullRequestState };
417
+ export { countGitHubStackMergedLayers, decodeGitHubCheckRunId, encodeGitHubCheckRunId, fromCommitFileStatus, fromGitHubCheckConclusionState, fromGitHubCheckContext, fromGitHubCheckContextState, fromGitHubCheckStatusState, fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntry, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequest, fromGitHubPullRequestLite, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestReviewState, fromGitHubPullRequestStatusCheckRollupState, fromGitHubStatusState, toGitHubCheckRunId, toGitHubPullRequestMergeableState, toGitHubPullRequestReviewDecision, toGitHubPullRequestState };
413
418
 
414
419
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","names":[],"sources":["../../../../plus/git-github/src/models.ts"],"sourcesContent":["import { copyReadProvenance } from '@gitkraken/provider-apis/read-provenance';\nimport 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\tPullRequestCheckRun,\n\tPullRequestCheckRunConclusion,\n\tPullRequestCheckRunStatus,\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, for a read that asks for it (`mergeQueue`) or, when it doesn't say, a host\n\t * that opts in (`GitHubApiConfig.getPullRequestReadOptions`) — see `stack`. `null` when the pull request isn't\n\t * queued. */\n\tmergeQueueEntry?: GitHubMergeQueueEntry | null;\n\t/** Selected with `mergeQueueEntry`. True whenever the base branch requires a merge queue, whatever the pull\n\t * request's state. */\n\tisMergeQueueEnabled?: boolean;\n\t/** Selected with `mergeQueueEntry`. 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\tid?: string;\n\t\t\t\tstatusCheckRollup: {\n\t\t\t\t\tstate: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\n\t\t\t\t\tcontexts?: GitHubCheckContexts;\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\tcommits?: {\n\t\tnodes: {\n\t\t\tcommit: {\n\t\t\t\tid?: string;\n\t\t\t\tstatusCheckRollup: {\n\t\t\t\t\tstate?: GitHubPullRequestStatusCheckRollupState;\n\t\t\t\t\tcontexts?: GitHubCheckContexts<GitHubCheckContextEtagNode>;\n\t\t\t\t} | null;\n\t\t\t};\n\t\t}[];\n\t};\n\t/** Every page of the head's checks, set by `GitHubApi.getPullRequestsEtagFieldsBatch` when it reads them. */\n\tcheckRuns?: GitHubCheckContextsRead<GitHubCheckContextEtagNode>;\n\t/** Selected when the read selects merge-queue data, like the full read's. `null` when the pull request isn't queued. */\n\tmergeQueueEntry?: Pick<GitHubMergeQueueEntry, 'state' | 'enqueuedAt'> | null;\n\t/** Selected when the read selects merge-queue data, exactly as the full read selects it. */\n\tmergeQueueEvents?: GitHubMergeQueueEvents | null;\n\t/**\n\t * Selected with the merge-queue data and nothing else, so its presence says the read selected it. Its value is\n\t * never an etag input: only a change to the base branch's rules moves it.\n\t */\n\tisMergeQueueEnabled?: boolean;\n}\n\nexport type GitHubCheckStatusState = 'REQUESTED' | 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'WAITING' | 'PENDING';\nexport type GitHubCheckConclusionState =\n\t| 'ACTION_REQUIRED'\n\t| 'TIMED_OUT'\n\t| 'CANCELLED'\n\t| 'FAILURE'\n\t| 'SUCCESS'\n\t| 'NEUTRAL'\n\t| 'SKIPPED'\n\t| 'STARTUP_FAILURE'\n\t| 'STALE';\nexport type GitHubStatusState = 'EXPECTED' | 'ERROR' | 'FAILURE' | 'PENDING' | 'SUCCESS';\n\nexport interface GitHubCheckRunContext {\n\t__typename: 'CheckRun';\n\tid: string;\n\tdatabaseId: number | null;\n\tname: string;\n\tstatus: GitHubCheckStatusState;\n\tconclusion: GitHubCheckConclusionState | null;\n\tdetailsUrl: string | null;\n\turl: string | null;\n\ttitle: string | null;\n\tstartedAt: string | null;\n\tcompletedAt: string | null;\n\tisRequired?: boolean;\n\tcheckSuite: {\n\t\tapp: { slug: string } | null;\n\t\tworkflowRun: { workflow: { name: string } | null } | null;\n\t} | null;\n}\n\nexport interface GitHubStatusContext {\n\t__typename: 'StatusContext';\n\tid: string;\n\tcontext: string;\n\tstate: GitHubStatusState;\n\ttargetUrl: string | null;\n\tcreatedAt: string;\n\tisRequired?: boolean;\n}\n\nexport type GitHubCheckContext = GitHubCheckRunContext | GitHubStatusContext;\n\nexport interface GitHubCheckContexts<N extends GitHubCheckContextEtagNode = GitHubCheckContext> {\n\tpageInfo: { hasNextPage: boolean; endCursor: string | null };\n\tnodes: (N | null)[] | null;\n}\n\n/** A head's checks, read across every page. `truncated` means the head has checks `contexts` lacks. */\nexport interface GitHubCheckContextsRead<N extends GitHubCheckContextEtagNode = GitHubCheckContext> {\n\treadonly contexts: readonly (N | null)[];\n\treadonly truncated: boolean;\n}\n\nexport type GitHubCheckContextEtagNode =\n\t| (Pick<GitHubCheckRunContext, '__typename' | 'id' | 'databaseId' | 'name' | 'status' | 'conclusion'> & {\n\t\t\tcheckSuite: { app: { slug: string } | null } | null;\n\t })\n\t| Pick<GitHubStatusContext, '__typename' | 'id' | 'context' | 'state'>;\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\tconst result = 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\treturn copyReadProvenance(result, pr);\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 where never selected (GitHub Enterprise Server, or a host that didn't opt in) and `null` when the pull\n * 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 where never selected (GitHub Enterprise Server, or a host that didn't opt in). Shared by\n * the full read and the etag's 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\tcheckRuns?: GitHubCheckContextsRead,\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\tconst result = 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\tcheckRuns?.contexts.map(fromGitHubCheckContext).filter((run): run is PullRequestCheckRun => run != null),\n\t\tcheckRuns?.truncated ? true : undefined,\n\t);\n\treturn copyReadProvenance(result, pr);\n}\n\n/** What a check run's opaque {@link PullRequestCheckRun.id} names. */\nexport type GitHubCheckRunRef =\n\t/** A GitHub Actions job, by its job id (the check run's `databaseId`). */\n\t| { readonly kind: 'actions-job'; readonly jobId: number }\n\t/** Any other check run, by its node id. */\n\t| { readonly kind: 'check-run'; readonly nodeId: string }\n\t/** A commit status, by its node id. */\n\t| { readonly kind: 'status'; readonly nodeId: string };\n\nexport function encodeGitHubCheckRunId(ref: GitHubCheckRunRef): string {\n\tswitch (ref.kind) {\n\t\tcase 'actions-job':\n\t\t\treturn `a:${ref.jobId}`;\n\t\tcase 'check-run':\n\t\t\treturn `c:${ref.nodeId}`;\n\t\tcase 'status':\n\t\t\treturn `s:${ref.nodeId}`;\n\t}\n}\n\n/** `undefined` for an id {@link encodeGitHubCheckRunId} didn't make. */\nexport function decodeGitHubCheckRunId(id: string): GitHubCheckRunRef | undefined {\n\tconst value = id.slice(2);\n\tif (value.length === 0) return undefined;\n\n\tswitch (id.slice(0, 2)) {\n\t\tcase 'a:': {\n\t\t\tconst jobId = Number(value);\n\t\t\treturn /^\\d+$/.test(value) && Number.isSafeInteger(jobId)\n\t\t\t\t? { kind: 'actions-job', jobId: jobId }\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase 'c:':\n\t\t\treturn { kind: 'check-run', nodeId: value };\n\t\tcase 's:':\n\t\t\treturn { kind: 'status', nodeId: value };\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/** An unknown status reads as `pending`, so a state GitHub adds later never fails the row. */\nexport function fromGitHubCheckStatusState(status: GitHubCheckStatusState): PullRequestCheckRunStatus {\n\tswitch (status) {\n\t\tcase 'REQUESTED':\n\t\t\treturn 'requested';\n\t\tcase 'QUEUED':\n\t\t\treturn 'queued';\n\t\tcase 'IN_PROGRESS':\n\t\t\treturn 'in-progress';\n\t\tcase 'COMPLETED':\n\t\t\treturn 'completed';\n\t\tcase 'WAITING':\n\t\t\treturn 'waiting';\n\t\tdefault:\n\t\t\treturn 'pending';\n\t}\n}\n\n/** An unknown conclusion reads as none, so a value GitHub adds later never fails the row. */\nexport function fromGitHubCheckConclusionState(\n\tconclusion: GitHubCheckConclusionState | null | undefined,\n): PullRequestCheckRunConclusion | undefined {\n\tswitch (conclusion) {\n\t\tcase 'ACTION_REQUIRED':\n\t\t\treturn 'action-required';\n\t\tcase 'TIMED_OUT':\n\t\t\treturn 'timed-out';\n\t\tcase 'CANCELLED':\n\t\t\treturn 'cancelled';\n\t\tcase 'FAILURE':\n\t\t\treturn 'failure';\n\t\tcase 'SUCCESS':\n\t\t\treturn 'success';\n\t\tcase 'NEUTRAL':\n\t\t\treturn 'neutral';\n\t\tcase 'SKIPPED':\n\t\t\treturn 'skipped';\n\t\tcase 'STARTUP_FAILURE':\n\t\t\treturn 'startup-failure';\n\t\tcase 'STALE':\n\t\t\treturn 'stale';\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nexport function fromGitHubStatusState(state: GitHubStatusState): {\n\tstatus: PullRequestCheckRunStatus;\n\tconclusion?: PullRequestCheckRunConclusion;\n} {\n\tswitch (state) {\n\t\tcase 'SUCCESS':\n\t\t\treturn { status: 'completed', conclusion: 'success' };\n\t\tcase 'FAILURE':\n\t\t\treturn { status: 'completed', conclusion: 'failure' };\n\t\tcase 'ERROR':\n\t\t\treturn { status: 'completed', conclusion: 'error' };\n\t\tdefault:\n\t\t\treturn { status: 'pending' };\n\t}\n}\n\n/**\n * A check context's kind, name and normalized state: what both a full row's {@link PullRequestCheckRun} and the etag's\n * cheap check read, so the two agree. `undefined` for a context type this doesn't know.\n */\nexport function fromGitHubCheckContextState(\n\tcontext: GitHubCheckContextEtagNode | null,\n): Pick<PullRequestCheckRun, 'kind' | 'name' | 'status' | 'conclusion'> | undefined {\n\tswitch (context?.__typename) {\n\t\tcase 'CheckRun':\n\t\t\treturn {\n\t\t\t\tkind: 'check-run',\n\t\t\t\tname: context.name,\n\t\t\t\tstatus: fromGitHubCheckStatusState(context.status),\n\t\t\t\tconclusion: fromGitHubCheckConclusionState(context.conclusion),\n\t\t\t};\n\t\tcase 'StatusContext':\n\t\t\treturn { kind: 'status', name: context.context, ...fromGitHubStatusState(context.state) };\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction gitHubActionsJobId(context: Extract<GitHubCheckContextEtagNode, { __typename: 'CheckRun' }>): number | null {\n\treturn context.checkSuite?.app?.slug === 'github-actions' ? context.databaseId : null;\n}\n\nexport function toGitHubCheckRunId(context: GitHubCheckContextEtagNode): string {\n\tif (context.__typename === 'StatusContext') return encodeGitHubCheckRunId({ kind: 'status', nodeId: context.id });\n\n\tconst jobId = gitHubActionsJobId(context);\n\treturn encodeGitHubCheckRunId(\n\t\tjobId != null ? { kind: 'actions-job', jobId: jobId } : { kind: 'check-run', nodeId: context.id },\n\t);\n}\n\nexport function fromGitHubCheckContext(context: GitHubCheckContext | null): PullRequestCheckRun | undefined {\n\tconst state = fromGitHubCheckContextState(context);\n\tif (state == null || context == null) return undefined;\n\n\tif (context.__typename === 'StatusContext') {\n\t\treturn {\n\t\t\t...state,\n\t\t\tid: toGitHubCheckRunId(context),\n\t\t\turl: context.targetUrl ?? undefined,\n\t\t\trequired: context.isRequired,\n\t\t\tstartedAt: new Date(context.createdAt),\n\t\t\thasLog: false,\n\t\t};\n\t}\n\n\treturn {\n\t\t...state,\n\t\tid: toGitHubCheckRunId(context),\n\t\tworkflowName: context.checkSuite?.workflowRun?.workflow?.name ?? undefined,\n\t\turl: context.detailsUrl ?? context.url ?? undefined,\n\t\trequired: context.isRequired,\n\t\tstartedAt: context.startedAt != null ? new Date(context.startedAt) : undefined,\n\t\tcompletedAt: context.completedAt != null ? new Date(context.completedAt) : undefined,\n\t\thasLog: gitHubActionsJobId(context) != null || context.title != null,\n\t};\n}\n\nexport function fromGitHubIssue(value: GitHubIssue, provider: Provider, projection?: IssueProjection): Issue {\n\tconst result = 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\treturn copyReadProvenance(result, value);\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":";;;;;AA8GA,SAAgB,qBAAqB,QAAgE;CACpG,QAAQ,QAAR;EACC,KAAK,SACJ,OAAO,mBAAmB;EAC3B,KAAK;EACL,KAAK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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;CACA,OAAO,mBAAmB,QAAQ,KAAK;AACxC;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 { copyReadProvenance } from '@gitkraken/provider-apis/read-provenance';\nimport 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\tPullRequestCheckRun,\n\tPullRequestCheckRunConclusion,\n\tPullRequestCheckRunStatus,\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, for a read that asks for it (`mergeQueue`) or, when it doesn't say, a host\n\t * that opts in (`GitHubApiConfig.getPullRequestReadOptions`) — see `stack`. `null` when the pull request isn't\n\t * queued. */\n\tmergeQueueEntry?: GitHubMergeQueueEntry | null;\n\t/** Selected with `mergeQueueEntry`. True whenever the base branch requires a merge queue, whatever the pull\n\t * request's state. */\n\tisMergeQueueEnabled?: boolean;\n\t/** Selected with `mergeQueueEntry`. 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\t/** Present only when the read selected the stack's merged layers. */\n\tentries?: { nodes: ({ pullRequest: { merged: boolean } | null } | null)[] | null };\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\tid?: string;\n\t\t\t\tstatusCheckRollup: {\n\t\t\t\t\tstate: 'SUCCESS' | 'FAILURE' | 'PENDING' | 'EXPECTED' | 'ERROR';\n\t\t\t\t\tcontexts?: GitHubCheckContexts;\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\tcommits?: {\n\t\tnodes: {\n\t\t\tcommit: {\n\t\t\t\tid?: string;\n\t\t\t\tstatusCheckRollup: {\n\t\t\t\t\tstate?: GitHubPullRequestStatusCheckRollupState;\n\t\t\t\t\tcontexts?: GitHubCheckContexts<GitHubCheckContextEtagNode>;\n\t\t\t\t} | null;\n\t\t\t};\n\t\t}[];\n\t};\n\t/** Every page of the head's checks, set by `GitHubApi.getPullRequestsEtagFieldsBatch` when it reads them. */\n\tcheckRuns?: GitHubCheckContextsRead<GitHubCheckContextEtagNode>;\n\t/** Selected when the read selects merge-queue data, like the full read's. `null` when the pull request isn't queued. */\n\tmergeQueueEntry?: Pick<GitHubMergeQueueEntry, 'state' | 'enqueuedAt'> | null;\n\t/** Selected when the read selects merge-queue data, exactly as the full read selects it. */\n\tmergeQueueEvents?: GitHubMergeQueueEvents | null;\n\t/**\n\t * Selected with the merge-queue data and nothing else, so its presence says the read selected it. Its value is\n\t * never an etag input: only a change to the base branch's rules moves it.\n\t */\n\tisMergeQueueEnabled?: boolean;\n\t/** Present only when the read selected the stack's merged layers; `null` when unstacked. */\n\tstack?: Pick<GitHubPullRequestStack, 'entries'> | null;\n}\n\nexport type GitHubCheckStatusState = 'REQUESTED' | 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'WAITING' | 'PENDING';\nexport type GitHubCheckConclusionState =\n\t| 'ACTION_REQUIRED'\n\t| 'TIMED_OUT'\n\t| 'CANCELLED'\n\t| 'FAILURE'\n\t| 'SUCCESS'\n\t| 'NEUTRAL'\n\t| 'SKIPPED'\n\t| 'STARTUP_FAILURE'\n\t| 'STALE';\nexport type GitHubStatusState = 'EXPECTED' | 'ERROR' | 'FAILURE' | 'PENDING' | 'SUCCESS';\n\nexport interface GitHubCheckRunContext {\n\t__typename: 'CheckRun';\n\tid: string;\n\tdatabaseId: number | null;\n\tname: string;\n\tstatus: GitHubCheckStatusState;\n\tconclusion: GitHubCheckConclusionState | null;\n\tdetailsUrl: string | null;\n\turl: string | null;\n\ttitle: string | null;\n\tstartedAt: string | null;\n\tcompletedAt: string | null;\n\tisRequired?: boolean;\n\tcheckSuite: {\n\t\tapp: { slug: string } | null;\n\t\tworkflowRun: { workflow: { name: string } | null } | null;\n\t} | null;\n}\n\nexport interface GitHubStatusContext {\n\t__typename: 'StatusContext';\n\tid: string;\n\tcontext: string;\n\tstate: GitHubStatusState;\n\ttargetUrl: string | null;\n\tcreatedAt: string;\n\tisRequired?: boolean;\n}\n\nexport type GitHubCheckContext = GitHubCheckRunContext | GitHubStatusContext;\n\nexport interface GitHubCheckContexts<N extends GitHubCheckContextEtagNode = GitHubCheckContext> {\n\tpageInfo: { hasNextPage: boolean; endCursor: string | null };\n\tnodes: (N | null)[] | null;\n}\n\n/** A head's checks, read across every page. `truncated` means the head has checks `contexts` lacks. */\nexport interface GitHubCheckContextsRead<N extends GitHubCheckContextEtagNode = GitHubCheckContext> {\n\treadonly contexts: readonly (N | null)[];\n\treadonly truncated: boolean;\n}\n\nexport type GitHubCheckContextEtagNode =\n\t| (Pick<GitHubCheckRunContext, '__typename' | 'id' | 'databaseId' | 'name' | 'status' | 'conclusion'> & {\n\t\t\tcheckSuite: { app: { slug: string } | null } | null;\n\t })\n\t| Pick<GitHubStatusContext, '__typename' | 'id' | 'context' | 'state'>;\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\tconst result = 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\treturn copyReadProvenance(result, pr);\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\nfunction fromGitHubPullRequestStack(pr: GitHubPullRequestLite): PullRequestStackInfo | undefined {\n\tif (pr.stack == null || pr.stackEntry == null) return undefined;\n\n\tconst mergedLayers = countGitHubStackMergedLayers(pr.stack);\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\t...(mergedLayers != null ? { mergedLayers: mergedLayers } : {}),\n\t};\n}\n\n/** How many of a stack's selected entries have merged; `undefined` when the entries weren't selected. */\nexport function countGitHubStackMergedLayers(\n\tstack: Pick<GitHubPullRequestStack, 'entries'> | null | undefined,\n): number | undefined {\n\treturn stack?.entries?.nodes?.filter(e => e?.pullRequest?.merged === true).length;\n}\n\n/** Absent where never selected (GitHub Enterprise Server, or a host that didn't opt in) and `null` when the pull\n * 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 where never selected (GitHub Enterprise Server, or a host that didn't opt in). Shared by\n * the full read and the etag's 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\tcheckRuns?: GitHubCheckContextsRead,\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\tconst result = 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\tcheckRuns?.contexts.map(fromGitHubCheckContext).filter((run): run is PullRequestCheckRun => run != null),\n\t\tcheckRuns?.truncated ? true : undefined,\n\t);\n\treturn copyReadProvenance(result, pr);\n}\n\n/** What a check run's opaque {@link PullRequestCheckRun.id} names. */\nexport type GitHubCheckRunRef =\n\t/** A GitHub Actions job, by its job id (the check run's `databaseId`). */\n\t| { readonly kind: 'actions-job'; readonly jobId: number }\n\t/** Any other check run, by its node id. */\n\t| { readonly kind: 'check-run'; readonly nodeId: string }\n\t/** A commit status, by its node id. */\n\t| { readonly kind: 'status'; readonly nodeId: string };\n\nexport function encodeGitHubCheckRunId(ref: GitHubCheckRunRef): string {\n\tswitch (ref.kind) {\n\t\tcase 'actions-job':\n\t\t\treturn `a:${ref.jobId}`;\n\t\tcase 'check-run':\n\t\t\treturn `c:${ref.nodeId}`;\n\t\tcase 'status':\n\t\t\treturn `s:${ref.nodeId}`;\n\t}\n}\n\n/** `undefined` for an id {@link encodeGitHubCheckRunId} didn't make. */\nexport function decodeGitHubCheckRunId(id: string): GitHubCheckRunRef | undefined {\n\tconst value = id.slice(2);\n\tif (value.length === 0) return undefined;\n\n\tswitch (id.slice(0, 2)) {\n\t\tcase 'a:': {\n\t\t\tconst jobId = Number(value);\n\t\t\treturn /^\\d+$/.test(value) && Number.isSafeInteger(jobId)\n\t\t\t\t? { kind: 'actions-job', jobId: jobId }\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase 'c:':\n\t\t\treturn { kind: 'check-run', nodeId: value };\n\t\tcase 's:':\n\t\t\treturn { kind: 'status', nodeId: value };\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/** An unknown status reads as `pending`, so a state GitHub adds later never fails the row. */\nexport function fromGitHubCheckStatusState(status: GitHubCheckStatusState): PullRequestCheckRunStatus {\n\tswitch (status) {\n\t\tcase 'REQUESTED':\n\t\t\treturn 'requested';\n\t\tcase 'QUEUED':\n\t\t\treturn 'queued';\n\t\tcase 'IN_PROGRESS':\n\t\t\treturn 'in-progress';\n\t\tcase 'COMPLETED':\n\t\t\treturn 'completed';\n\t\tcase 'WAITING':\n\t\t\treturn 'waiting';\n\t\tdefault:\n\t\t\treturn 'pending';\n\t}\n}\n\n/** An unknown conclusion reads as none, so a value GitHub adds later never fails the row. */\nexport function fromGitHubCheckConclusionState(\n\tconclusion: GitHubCheckConclusionState | null | undefined,\n): PullRequestCheckRunConclusion | undefined {\n\tswitch (conclusion) {\n\t\tcase 'ACTION_REQUIRED':\n\t\t\treturn 'action-required';\n\t\tcase 'TIMED_OUT':\n\t\t\treturn 'timed-out';\n\t\tcase 'CANCELLED':\n\t\t\treturn 'cancelled';\n\t\tcase 'FAILURE':\n\t\t\treturn 'failure';\n\t\tcase 'SUCCESS':\n\t\t\treturn 'success';\n\t\tcase 'NEUTRAL':\n\t\t\treturn 'neutral';\n\t\tcase 'SKIPPED':\n\t\t\treturn 'skipped';\n\t\tcase 'STARTUP_FAILURE':\n\t\t\treturn 'startup-failure';\n\t\tcase 'STALE':\n\t\t\treturn 'stale';\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nexport function fromGitHubStatusState(state: GitHubStatusState): {\n\tstatus: PullRequestCheckRunStatus;\n\tconclusion?: PullRequestCheckRunConclusion;\n} {\n\tswitch (state) {\n\t\tcase 'SUCCESS':\n\t\t\treturn { status: 'completed', conclusion: 'success' };\n\t\tcase 'FAILURE':\n\t\t\treturn { status: 'completed', conclusion: 'failure' };\n\t\tcase 'ERROR':\n\t\t\treturn { status: 'completed', conclusion: 'error' };\n\t\tdefault:\n\t\t\treturn { status: 'pending' };\n\t}\n}\n\n/**\n * A check context's kind, name and normalized state: what both a full row's {@link PullRequestCheckRun} and the etag's\n * cheap check read, so the two agree. `undefined` for a context type this doesn't know.\n */\nexport function fromGitHubCheckContextState(\n\tcontext: GitHubCheckContextEtagNode | null,\n): Pick<PullRequestCheckRun, 'kind' | 'name' | 'status' | 'conclusion'> | undefined {\n\tswitch (context?.__typename) {\n\t\tcase 'CheckRun':\n\t\t\treturn {\n\t\t\t\tkind: 'check-run',\n\t\t\t\tname: context.name,\n\t\t\t\tstatus: fromGitHubCheckStatusState(context.status),\n\t\t\t\tconclusion: fromGitHubCheckConclusionState(context.conclusion),\n\t\t\t};\n\t\tcase 'StatusContext':\n\t\t\treturn { kind: 'status', name: context.context, ...fromGitHubStatusState(context.state) };\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction gitHubActionsJobId(context: Extract<GitHubCheckContextEtagNode, { __typename: 'CheckRun' }>): number | null {\n\treturn context.checkSuite?.app?.slug === 'github-actions' ? context.databaseId : null;\n}\n\nexport function toGitHubCheckRunId(context: GitHubCheckContextEtagNode): string {\n\tif (context.__typename === 'StatusContext') return encodeGitHubCheckRunId({ kind: 'status', nodeId: context.id });\n\n\tconst jobId = gitHubActionsJobId(context);\n\treturn encodeGitHubCheckRunId(\n\t\tjobId != null ? { kind: 'actions-job', jobId: jobId } : { kind: 'check-run', nodeId: context.id },\n\t);\n}\n\nexport function fromGitHubCheckContext(context: GitHubCheckContext | null): PullRequestCheckRun | undefined {\n\tconst state = fromGitHubCheckContextState(context);\n\tif (state == null || context == null) return undefined;\n\n\tif (context.__typename === 'StatusContext') {\n\t\treturn {\n\t\t\t...state,\n\t\t\tid: toGitHubCheckRunId(context),\n\t\t\turl: context.targetUrl ?? undefined,\n\t\t\trequired: context.isRequired,\n\t\t\tstartedAt: new Date(context.createdAt),\n\t\t\thasLog: false,\n\t\t};\n\t}\n\n\treturn {\n\t\t...state,\n\t\tid: toGitHubCheckRunId(context),\n\t\tworkflowName: context.checkSuite?.workflowRun?.workflow?.name ?? undefined,\n\t\turl: context.detailsUrl ?? context.url ?? undefined,\n\t\trequired: context.isRequired,\n\t\tstartedAt: context.startedAt != null ? new Date(context.startedAt) : undefined,\n\t\tcompletedAt: context.completedAt != null ? new Date(context.completedAt) : undefined,\n\t\thasLog: gitHubActionsJobId(context) != null || context.title != null,\n\t};\n}\n\nexport function fromGitHubIssue(value: GitHubIssue, provider: Provider, projection?: IssueProjection): Issue {\n\tconst result = 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\treturn copyReadProvenance(result, value);\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":";;;;;AA8GA,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;;AAyUA,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;CACb;AACD;AAEA,SAAgB,0BACf,IACA,UACA,YACc;CACd,MAAM,SAAS,IAAI,YAClB,UACA,wBAAwB,GAAG,MAAM,GACjC,OAAO,GAAG,MAAM,GAChB,GAAG,IACH,G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AAM,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;CACA,OAAO,mBAAmB,QAAQ,KAAK;AACxC;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"}
@@ -244,9 +244,14 @@ export interface ConfigProvider {
244
244
  * `searchPullRequestsPage`, `getPullRequestsBatch`, `getPullRequestsForBranches`, `getPullRequestsForCommits` and
245
245
  * sweeps take their own `mergeQueue`, which overrides this for that read. Read on every query build, so a change
246
246
  * applies from the next read.
247
+ *
248
+ * `stackMergedLayers: true` makes GitHub.com pull request reads, and the etag cheap check, select a stack's merged
249
+ * layers (`stack.mergedLayers`). Off (omitted) by default: it costs a GitHub rate-limit point per 100 pull requests
250
+ * read.
247
251
  */
248
252
  getPullRequestReadOptions?(): {
249
253
  readonly mergeQueue?: boolean;
254
+ readonly stackMergedLayers?: boolean;
250
255
  };
251
256
  /** Per-remote-host configurations from `remotes`. */
252
257
  getRemoteConfigs(): readonly IntegrationsRemoteConfig[];
@@ -0,0 +1,6 @@
1
+ import { IntegrationManager } from "./manager.js";
2
+ import { IntegrationManagerContext } from "./managerContext.js";
3
+ //#region ../plus/integrations/src/extensionManager.d.ts
4
+ export declare function createExtensionIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager;
5
+ //#endregion
6
+ //# sourceMappingURL=extensionManager.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { createIntegrationService } from "./integrationService.js";
2
+ import { toIntegrationServiceContext } from "./managerContext.js";
3
+ //#region ../plus/integrations/src/extensionManager.ts
4
+ function createExtensionIntegrationManager(ctx) {
5
+ return createIntegrationService(toIntegrationServiceContext(ctx));
6
+ }
7
+ //#endregion
8
+ export { createExtensionIntegrationManager };
9
+
10
+ //# sourceMappingURL=extensionManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionManager.js","names":[],"sources":["../../../../plus/integrations/src/extensionManager.ts"],"sourcesContent":["import { createIntegrationService } from './integrationService.js';\nimport type { IntegrationManager } from './manager.js';\nimport type { IntegrationManagerContext } from './managerContext.js';\nimport { toIntegrationServiceContext } from './managerContext.js';\n\n// KEEP: never import `index.js` or the GitLab merge request writer here; the extension's bundle budget depends on it.\nexport function createExtensionIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager {\n\treturn createIntegrationService(toIntegrationServiceContext(ctx));\n}\n"],"mappings":";;;AAMA,SAAgB,kCAAkC,KAAoD;CACrG,OAAO,yBAAyB,4BAA4B,GAAG,CAAC;AACjE"}
@@ -1,14 +1,9 @@
1
- import { CacheController } from "../../utils/promiseCache.js";
2
- import { ResourceDescriptor } from "../../git/models/resourceDescriptor.js";
3
1
  import { Autolink, AutolinkReference, DynamicAutolinkReference, RefSet } from "../../git/models/autolink.js";
4
2
  import { ProviderReference } from "../../git/models/remoteProvider.js";
5
- import { IssueOrPullRequest, IssueOrPullRequestType } from "../../git/models/issueOrPullRequest.js";
6
- import { Issue, IssueProjection, IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship, IssueStateFilter } from "../../git/models/issue.js";
7
- import { PullRequest, PullRequestFilter, PullRequestProjection, PullRequestSearchCapabilities, PullRequestSearchCriteria, PullRequestStateFilter } from "../../git/models/pullRequest.js";
3
+ import { IssueProjection, IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelationship, IssueStateFilter } from "../../git/models/issue.js";
4
+ import { PullRequestFilter, PullRequestProjection, PullRequestSearchCapabilities, PullRequestSearchCriteria, PullRequestStateFilter } from "../../git/models/pullRequest.js";
8
5
  import { Account } from "../../git/models/author.js";
9
- import { DefaultBranch } from "../../git/models/defaultBranch.js";
10
6
  import { PullRequestActivityAuthor, PullRequestActivityComment, PullRequestActivityItem, PullRequestActivityReview, PullRequestActivityReviewComment } from "../../git/models/pullRequestActivity.js";
11
- import { RepositoryMetadata } from "../../git/models/repositoryMetadata.js";
12
7
  import { PullRequestCreateCapabilityResult, PullRequestWriteFailure, PullRequestWriteResult, PullRequestWriteSnapshot, PullRequestWriteTargetResult } from "../git-github/api/pullRequestWrites.js";
13
8
  import { IssueWriteResult } from "../git-github/api/issueWrites.js";
14
9
  import { AuthenticationSessionLike, CloudIntegrationAuthType, CloudIntegrationConnection, CloudIntegrationType, ConfiguredIntegrationDescriptor, ProviderAuthenticationSession, TokenInfo, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo } from "./authentication/models.js";
@@ -21,6 +16,7 @@ import { AzurePullRequestCreateCapabilityOptions, AzurePullRequestCreateCapabili
21
16
  import { BitbucketPullRequestCreateCapabilityOptions, BitbucketPullRequestCreateCapabilityResult, BitbucketPullRequestMergeCapability, BitbucketPullRequestMergeStatusOptions, BitbucketPullRequestMergeStatusResult, BitbucketPullRequestMergeStrategy, BitbucketPullRequestRepository, BitbucketPullRequestWriteAction, BitbucketPullRequestWriteFailure, BitbucketPullRequestWriteOptions, BitbucketPullRequestWriteReleaseOptions, BitbucketPullRequestWriteReleaseResult, BitbucketPullRequestWriteResult, BitbucketPullRequestWriteTargetOptions, BitbucketPullRequestWriteTargetResult, BitbucketUnsettledPullRequestWrite, BitbucketWrittenPullRequest } from "./models/bitbucketPullRequestWrites.js";
22
17
  import { BitbucketServerPullRequestActionCapability, BitbucketServerPullRequestCreateCapabilityResult, BitbucketServerPullRequestMergeCapability, BitbucketServerPullRequestRepository, BitbucketServerPullRequestVeto, BitbucketServerPullRequestWriteAction, BitbucketServerPullRequestWriteFailure, BitbucketServerPullRequestWriteOptions, BitbucketServerPullRequestWriteResult, BitbucketServerPullRequestWriteScope, BitbucketServerPullRequestWriteTargetOptions, BitbucketServerPullRequestWriteTargetResult, BitbucketServerWrittenPullRequest } from "./models/bitbucketServerPullRequestWrites.js";
23
18
  import { GitLabIssueCreateOptions, GitLabIssueCreateOptionsResult, GitLabIssueDeleteOptions, GitLabIssueReceipt, GitLabIssueWriteAddress, GitLabIssueWriteCapability, GitLabIssueWriteContext, GitLabIssueWriteFailure, GitLabIssueWriteField, GitLabIssueWriteOptions, GitLabIssueWriteOptionsResult, GitLabIssueWriteResult, GitLabIssueWriteScope, GitLabIssueWriteTargetOptions, GitLabIssueWriteTargetResult } from "./models/gitlabIssueWrites.js";
19
+ import { GitLabMergeBlocker, GitLabMergeExecution, GitLabMergeMethod, GitLabMergeRequestCreateOptions, GitLabMergeRequestCreateOptionsResult, GitLabMergeRequestDeleteOptions, GitLabMergeRequestMergeCapability, GitLabMergeRequestProject, GitLabMergeRequestReceipt, GitLabMergeRequestWriteAddress, GitLabMergeRequestWriteCapability, GitLabMergeRequestWriteContext, GitLabMergeRequestWriteFailure, GitLabMergeRequestWriteField, GitLabMergeRequestWriteOptions, GitLabMergeRequestWriteOptionsResult, GitLabMergeRequestWriteResult, GitLabMergeRequestWriteScope, GitLabMergeRequestWriteTargetOptions, GitLabMergeRequestWriteTargetResult, GitLabMergeSquash } from "./models/gitlabMergeRequestWrites.js";
24
20
  import { CaptureRelationshipCurrency, IssueRelationshipFailure, IssueRelationshipPin, IssueRelationshipReceipt, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
25
21
  import { IssueFilter } from "./providerFilters.js";
26
22
  import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
@@ -35,6 +31,7 @@ import { LookupBackedOffError } from "./errors.js";
35
31
  import { isAzureProviderId } from "./providers/providerErrors.js";
36
32
  import { EntityIdentifier, EntityIdentifierFields, EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, GitConfigEntityIdentifier, PullRequestEntityIdentifierInput, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getEntityIdentifierInput, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier } from "./providers/utils.js";
37
33
  import { ManualTokenAuthProviderOptions, createManualTokenAuthProvider } from "./authentication/manualTokenProvider.js";
34
+ import { IntegrationAccountCacheDescriptor, IntegrationManagerCacheLoader, IntegrationManagerCacheOptions, IntegrationManagerCacheProvider, IntegrationManagerCacheResult, IntegrationManagerContext } from "./managerContext.js";
38
35
  import { FieldPresence, IssueFieldGroup, PullRequestFieldGroup, getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
39
36
  import { areDomainsOnSameHost, getSingleConfiguredDomain, hostFromDomain } from "./utils/domain.utils.js";
40
37
  import { convertRemoteProviderIdToIntegrationId, getIntegrationConnectedKey, getIntegrationIdForRemote, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isIssuesHostIntegrationId, isSelfManagedHostIntegrationId } from "./utils/integration.utils.js";
@@ -42,61 +39,6 @@ import { getAzureRepositoryIdentity } from "./providers/azure/azure.utils.js";
42
39
  import { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from "./providers/gitlab/gitlab.utils.js";
43
40
  import { getActionablePullRequests, toActionablePullRequestInput } from "./providers/actionablePullRequests.js";
44
41
  //#region ../plus/integrations/src/index.d.ts
45
- /** A cached provider value, which may still be resolving. */
46
- export type IntegrationManagerCacheResult<T> = Promise<T | undefined> | T | undefined;
47
- /** Produces an account value on a cache miss. */
48
- export type IntegrationManagerCacheLoader<T> = (cacheable: CacheController) => {
49
- value: IntegrationManagerCacheResult<T>;
50
- expiresAt?: number;
51
- };
52
- /** The integration identity supplied to the consumer-owned account cache. */
53
- export type IntegrationAccountCacheDescriptor = IntegrationCacheDescriptor;
54
- /** Cache controls attached to a provider account lookup. */
55
- export interface IntegrationManagerCacheOptions {
56
- readonly connectionId?: string;
57
- readonly etag?: string;
58
- readonly expiryOverride?: boolean | number;
59
- readonly expireOnError?: boolean;
60
- }
61
- /**
62
- * Optional consumer-owned cache for values reused by the public manager facade.
63
- *
64
- * Only `getCurrentAccount` is required. Each other lookup is optional: one the cache omits runs its loader on every
65
- * call, uncached. A cache that keys entries by integration should key them by the descriptor's `id` and `domain`,
66
- * and treat `maybeConnected` and `sessionFingerprint` as the entry's etag, so a reconnect or a token change misses.
67
- *
68
- * The manager calls each method on the cache object itself, so a class instance (methods on its prototype) works.
69
- */
70
- export interface IntegrationManagerCacheProvider {
71
- getCurrentAccount(integration: IntegrationAccountCacheDescriptor, cacheable: IntegrationManagerCacheLoader<Account>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<Account>;
72
- getRepositoryMetadata?(repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<RepositoryMetadata>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<RepositoryMetadata>;
73
- getRepositoryDefaultBranch?(repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<DefaultBranch>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<DefaultBranch>;
74
- getPullRequestForSha?(sha: string, repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<PullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<PullRequest>;
75
- getPullRequestForBranch?(branch: string, repo: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<PullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<PullRequest>;
76
- getPullRequest?(id: string, resource: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<PullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<PullRequest>;
77
- getIssueOrPullRequest?(id: string, type: IssueOrPullRequestType | undefined, resource: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<IssueOrPullRequest>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<IssueOrPullRequest>;
78
- getIssue?(id: string, resource: ResourceDescriptor, integration: IntegrationCacheDescriptor | undefined, cacheable: IntegrationManagerCacheLoader<Issue>, options?: IntegrationManagerCacheOptions): IntegrationManagerCacheResult<Issue>;
79
- /** Evicts cached pull requests for the given installation origin, or all pull requests when omitted. */
80
- deletePullRequests?(scope?: {
81
- id: IntegrationCacheDescriptor['id'];
82
- domain: string;
83
- }): void;
84
- }
85
- /**
86
- * Consumer-facing runtime for {@link createIntegrationManager}.
87
- *
88
- * External consumers may omit `cache`; reads then execute their loaders directly without cross-call caching.
89
- * The extension host's broader integration context remains private to the implementation.
90
- */
91
- export interface IntegrationManagerContext {
92
- readonly storage: IntegrationStorageProvider;
93
- readonly account: AccountProvider;
94
- readonly config: ConfigProvider;
95
- readonly http: HttpProvider;
96
- readonly cache?: IntegrationManagerCacheProvider;
97
- readonly repositories: RepositoriesProvider;
98
- readonly hooks?: IntegrationServiceHooks;
99
- }
100
42
  /**
101
43
  * Construct an `@gitkraken/core-gitlens/plus/integrations` manager bound to the supplied runtime.
102
44
  *
@@ -111,5 +53,5 @@ export interface IntegrationManagerContext {
111
53
  */
112
54
  export declare function createIntegrationManager(ctx: IntegrationManagerContext): IntegrationManager;
113
55
  //#endregion
114
- export { type Account, type AccountProvider, type ActionablePullRequest, type ActionablePullRequestAccount, ActionablePullRequestBuildStatusState, type ActionablePullRequestCategory, type ActionablePullRequestEnrichedItem, type ActionablePullRequestEnrichedItems, type ActionablePullRequestFields, type ActionablePullRequestInput, ActionablePullRequestReviewState, type AuthenticationSessionLike, type AuthenticationSessionsChangeEvent, type Autolink, type AutolinkReference, type AzurePullRequestCreateCapabilityOptions, type AzurePullRequestCreateCapabilityResult, type AzurePullRequestMergeStrategy, type AzurePullRequestRepository, type AzurePullRequestWriteAction, type AzurePullRequestWriteFailure, type AzurePullRequestWriteOptions, type AzurePullRequestWriteResult, type AzurePullRequestWriteTargetOptions, type AzurePullRequestWriteTargetResult, type AzureServerPullRequestWriteOptions, type AzureServerPullRequestWriteScope, type AzureServerPullRequestWriteTargetOptions, type AzureServerWorkItemWriteScope, type AzureServicesWorkItemWriteScope, type AzureWrittenPullRequest, type BitbucketPullRequestCreateCapabilityOptions, type BitbucketPullRequestCreateCapabilityResult, type BitbucketPullRequestMergeCapability, type BitbucketPullRequestMergeStatusOptions, type BitbucketPullRequestMergeStatusResult, type BitbucketPullRequestMergeStrategy, type BitbucketPullRequestRepository, type BitbucketPullRequestWriteAction, type BitbucketPullRequestWriteFailure, type BitbucketPullRequestWriteOptions, type BitbucketPullRequestWriteReleaseOptions, type BitbucketPullRequestWriteReleaseResult, type BitbucketPullRequestWriteResult, type BitbucketPullRequestWriteTargetOptions, type BitbucketPullRequestWriteTargetResult, type BitbucketServerPullRequestActionCapability, type BitbucketServerPullRequestCreateCapabilityResult, type BitbucketServerPullRequestMergeCapability, type BitbucketServerPullRequestRepository, type BitbucketServerPullRequestVeto, type BitbucketServerPullRequestWriteAction, type BitbucketServerPullRequestWriteFailure, type BitbucketServerPullRequestWriteOptions, type BitbucketServerPullRequestWriteResult, type BitbucketServerPullRequestWriteScope, type BitbucketServerPullRequestWriteTargetOptions, type BitbucketServerPullRequestWriteTargetResult, type BitbucketServerWrittenPullRequest, type BitbucketUnsettledPullRequestWrite, type BitbucketWrittenPullRequest, type CaptureRelationshipCurrency, type ClosedPullRequestSweepOptions, type CloudIntegrationAuthType, type CloudIntegrationConnection, type CloudIntegrationType, type ConfigChangeEvent, type ConfigProvider, type ConfiguredIntegrationDescriptor, type ConfiguredIntegrationsChangeEvent, type ConnectionStateChangeEvent, type CurrentAccountResult, type DynamicAutolinkReference, type EntityIdentifier, type EntityIdentifierFields, type EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, type FieldPresence, type GetAutolinkReferencesOptions, GitCloudHostIntegrationId, type GitConfigEntityIdentifier, type GitHostIntegration, type GitLabIssueCreateOptions, type GitLabIssueCreateOptionsResult, type GitLabIssueDeleteOptions, type GitLabIssueReceipt, type GitLabIssueWriteAddress, type GitLabIssueWriteCapability, type GitLabIssueWriteContext, type GitLabIssueWriteFailure, type GitLabIssueWriteField, type GitLabIssueWriteOptions, type GitLabIssueWriteOptionsResult, type GitLabIssueWriteResult, type GitLabIssueWriteScope, type GitLabIssueWriteTargetOptions, type GitLabIssueWriteTargetResult, GitSelfManagedHostIntegrationId, type HttpProvider, type Integration, type IntegrationAuthenticationProvider, type IntegrationAuthenticationProviderDescriptor, type IntegrationAuthenticationSessionDescriptor, type IntegrationById, type IntegrationCacheDescriptor, type IntegrationConnectedKey, type IntegrationCredential, type IntegrationIds, type IntegrationManager, type IntegrationResult, type IntegrationServiceHooks, type IntegrationStorageProvider, type IntegrationType, type IntegrationsRemoteConfig, type IssueBatchResult, type IssueBatchTarget, type IssueCountResult, type IssueCountScope, type IssueDeleteOptions, type IssueEtagInclude, type IssueFieldGroup, IssueFilter, type IssueProjection, type IssueRelationshipFailure, type IssueRelationshipPin, type IssueRelationshipReceipt, type IssueRelationshipWriteOptions, type IssueRelationshipWriteResult, type IssueRelationshipsOptions, type IssueRelationshipsResult, type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueStateFilter, type IssueTrackerCreateOptions, type IssueTrackerCreateOptionsResult, type IssueTrackerDeleteOptions, type IssueTrackerField, type IssueTrackerIssueReceipt, type IssueTrackerIssueWriteOptions, type IssueTrackerIssueWriteOptionsResult, type IssueTrackerStatus, type IssueTrackerTransition, type IssueTrackerWriteConnection, type IssueTrackerWriteFailure, type IssueTrackerWriteOptions, type IssueTrackerWriteResult, type IssueTrackerWriteTargetOptions, type IssueTrackerWriteTargetResult, type IssueWriteOptions, type IssueWriteResult, type IssueWriteTargetOptions, type IssueWriteTargetResult, IssuesCloudHostIntegrationId, type IssuesIntegration, IssuesSelfManagedHostIntegrationId, type ListLinearProjectsOptions, type ListOrgsOptions, type ListProjectsOptions, LookupBackedOffError, type ManualTokenAuthProviderOptions, type MyPullRequestsForReposOptions, type ProviderAuthenticationSession, type ProviderBroadenOrg, type ProviderBroadenResult, type ProviderLinearProjectShape, type ProviderMetadata, type ProviderOrganization, type ProviderPageInfo, type ProviderPagedResult, type ProviderPullRequestSearchResult, type ProviderReference, type ProviderRepositoriesInput, type ProviderRepositoryInput, type ProviderRepositoryShape, type ProviderResult, type ProviderSweepResult, type ProviderSweepTarget, type ProviderSweepTargetEvent, type ProviderSweepTargetRef, type ProviderWarning, type ProviderWarningCause, type ProviderWarningCauseReason, type ProviderWarningKind, type ProviderWarningOmission, type ProviderWarningOmissionKind, type ProviderWarningOmissionRecovery, type ProviderWarningOmissionScope, type ProviderWarningScope, type ProviderWarningSelector, type ProviderWarningUnreadableItems, type PullRequestActivityAuthor, type PullRequestActivityComment, type PullRequestActivityItem, type PullRequestActivityResult, type PullRequestActivityReview, type PullRequestActivityReviewComment, type PullRequestActivityTarget, type PullRequestBatchResult, type PullRequestBatchTarget, type PullRequestBranchResult, type PullRequestBranchTarget, type PullRequestCheckLogResult, type PullRequestCheckLogTarget, type PullRequestCountResult, type PullRequestCountScope, type PullRequestCreateCapabilityOptions, type PullRequestCreateCapabilityResult, type PullRequestEntityIdentifierInput, type PullRequestEtagInclude, type PullRequestFieldGroup, PullRequestFilter, type PullRequestForCommitResult, type PullRequestProjection, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestStateFilter, type PullRequestSweepOptions, type PullRequestWriteFailure, type PullRequestWriteOptions, type PullRequestWriteResult, type PullRequestWriteSnapshot, type PullRequestWriteTargetOptions, type PullRequestWriteTargetResult, type RefSet, type RepositoriesProvider, type RepositoryIdentity, type RepositoryResolution, type RepositoryResolutionStatus, type ResolveRepositoryResult, type SearchMyPullRequestsOptions, type SearchPullRequestsOptions, type Source, type Sources, type SupportedCloudIntegrationIds, type TokenInfo, type WorkItemAddress, type WorkItemCreateOptions, type WorkItemCreateOptionsResult, type WorkItemDeleteCapability, type WorkItemDeleteOptions, type WorkItemDeleteResult, type WorkItemDeleteTargetChanged, type WorkItemDeletion, type WorkItemReceipt, type WorkItemState, type WorkItemWriteContext, type WorkItemWriteField, type WorkItemWriteOptions, type WorkItemWriteOptionsResult, type WorkItemWriteResult, type WorkItemWriteScope, type WorkItemWriteTargetOptions, type WorkItemWriteTargetResult, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
56
+ export { type Account, type AccountProvider, type ActionablePullRequest, type ActionablePullRequestAccount, ActionablePullRequestBuildStatusState, type ActionablePullRequestCategory, type ActionablePullRequestEnrichedItem, type ActionablePullRequestEnrichedItems, type ActionablePullRequestFields, type ActionablePullRequestInput, ActionablePullRequestReviewState, type AuthenticationSessionLike, type AuthenticationSessionsChangeEvent, type Autolink, type AutolinkReference, type AzurePullRequestCreateCapabilityOptions, type AzurePullRequestCreateCapabilityResult, type AzurePullRequestMergeStrategy, type AzurePullRequestRepository, type AzurePullRequestWriteAction, type AzurePullRequestWriteFailure, type AzurePullRequestWriteOptions, type AzurePullRequestWriteResult, type AzurePullRequestWriteTargetOptions, type AzurePullRequestWriteTargetResult, type AzureServerPullRequestWriteOptions, type AzureServerPullRequestWriteScope, type AzureServerPullRequestWriteTargetOptions, type AzureServerWorkItemWriteScope, type AzureServicesWorkItemWriteScope, type AzureWrittenPullRequest, type BitbucketPullRequestCreateCapabilityOptions, type BitbucketPullRequestCreateCapabilityResult, type BitbucketPullRequestMergeCapability, type BitbucketPullRequestMergeStatusOptions, type BitbucketPullRequestMergeStatusResult, type BitbucketPullRequestMergeStrategy, type BitbucketPullRequestRepository, type BitbucketPullRequestWriteAction, type BitbucketPullRequestWriteFailure, type BitbucketPullRequestWriteOptions, type BitbucketPullRequestWriteReleaseOptions, type BitbucketPullRequestWriteReleaseResult, type BitbucketPullRequestWriteResult, type BitbucketPullRequestWriteTargetOptions, type BitbucketPullRequestWriteTargetResult, type BitbucketServerPullRequestActionCapability, type BitbucketServerPullRequestCreateCapabilityResult, type BitbucketServerPullRequestMergeCapability, type BitbucketServerPullRequestRepository, type BitbucketServerPullRequestVeto, type BitbucketServerPullRequestWriteAction, type BitbucketServerPullRequestWriteFailure, type BitbucketServerPullRequestWriteOptions, type BitbucketServerPullRequestWriteResult, type BitbucketServerPullRequestWriteScope, type BitbucketServerPullRequestWriteTargetOptions, type BitbucketServerPullRequestWriteTargetResult, type BitbucketServerWrittenPullRequest, type BitbucketUnsettledPullRequestWrite, type BitbucketWrittenPullRequest, type CaptureRelationshipCurrency, type ClosedPullRequestSweepOptions, type CloudIntegrationAuthType, type CloudIntegrationConnection, type CloudIntegrationType, type ConfigChangeEvent, type ConfigProvider, type ConfiguredIntegrationDescriptor, type ConfiguredIntegrationsChangeEvent, type ConnectionStateChangeEvent, type CurrentAccountResult, type DynamicAutolinkReference, type EntityIdentifier, type EntityIdentifierFields, type EntityIdentifierInput, EntityIdentifierProviderType, EntityType, EntityVersion, type FieldPresence, type GetAutolinkReferencesOptions, GitCloudHostIntegrationId, type GitConfigEntityIdentifier, type GitHostIntegration, type GitLabIssueCreateOptions, type GitLabIssueCreateOptionsResult, type GitLabIssueDeleteOptions, type GitLabIssueReceipt, type GitLabIssueWriteAddress, type GitLabIssueWriteCapability, type GitLabIssueWriteContext, type GitLabIssueWriteFailure, type GitLabIssueWriteField, type GitLabIssueWriteOptions, type GitLabIssueWriteOptionsResult, type GitLabIssueWriteResult, type GitLabIssueWriteScope, type GitLabIssueWriteTargetOptions, type GitLabIssueWriteTargetResult, type GitLabMergeBlocker, type GitLabMergeExecution, type GitLabMergeMethod, type GitLabMergeRequestCreateOptions, type GitLabMergeRequestCreateOptionsResult, type GitLabMergeRequestDeleteOptions, type GitLabMergeRequestMergeCapability, type GitLabMergeRequestProject, type GitLabMergeRequestReceipt, type GitLabMergeRequestWriteAddress, type GitLabMergeRequestWriteCapability, type GitLabMergeRequestWriteContext, type GitLabMergeRequestWriteFailure, type GitLabMergeRequestWriteField, type GitLabMergeRequestWriteOptions, type GitLabMergeRequestWriteOptionsResult, type GitLabMergeRequestWriteResult, type GitLabMergeRequestWriteScope, type GitLabMergeRequestWriteTargetOptions, type GitLabMergeRequestWriteTargetResult, type GitLabMergeSquash, GitSelfManagedHostIntegrationId, type HttpProvider, type Integration, type IntegrationAccountCacheDescriptor, type IntegrationAuthenticationProvider, type IntegrationAuthenticationProviderDescriptor, type IntegrationAuthenticationSessionDescriptor, type IntegrationById, type IntegrationCacheDescriptor, type IntegrationConnectedKey, type IntegrationCredential, type IntegrationIds, type IntegrationManager, type IntegrationManagerCacheLoader, type IntegrationManagerCacheOptions, type IntegrationManagerCacheProvider, type IntegrationManagerCacheResult, type IntegrationManagerContext, type IntegrationResult, type IntegrationServiceHooks, type IntegrationStorageProvider, type IntegrationType, type IntegrationsRemoteConfig, type IssueBatchResult, type IssueBatchTarget, type IssueCountResult, type IssueCountScope, type IssueDeleteOptions, type IssueEtagInclude, type IssueFieldGroup, IssueFilter, type IssueProjection, type IssueRelationshipFailure, type IssueRelationshipPin, type IssueRelationshipReceipt, type IssueRelationshipWriteOptions, type IssueRelationshipWriteResult, type IssueRelationshipsOptions, type IssueRelationshipsResult, type IssueSearchCapabilities, type IssueSearchCriteria, type IssueSearchRelationship, type IssueStateFilter, type IssueTrackerCreateOptions, type IssueTrackerCreateOptionsResult, type IssueTrackerDeleteOptions, type IssueTrackerField, type IssueTrackerIssueReceipt, type IssueTrackerIssueWriteOptions, type IssueTrackerIssueWriteOptionsResult, type IssueTrackerStatus, type IssueTrackerTransition, type IssueTrackerWriteConnection, type IssueTrackerWriteFailure, type IssueTrackerWriteOptions, type IssueTrackerWriteResult, type IssueTrackerWriteTargetOptions, type IssueTrackerWriteTargetResult, type IssueWriteOptions, type IssueWriteResult, type IssueWriteTargetOptions, type IssueWriteTargetResult, IssuesCloudHostIntegrationId, type IssuesIntegration, IssuesSelfManagedHostIntegrationId, type ListLinearProjectsOptions, type ListOrgsOptions, type ListProjectsOptions, LookupBackedOffError, type ManualTokenAuthProviderOptions, type MyPullRequestsForReposOptions, type ProviderAuthenticationSession, type ProviderBroadenOrg, type ProviderBroadenResult, type ProviderLinearProjectShape, type ProviderMetadata, type ProviderOrganization, type ProviderPageInfo, type ProviderPagedResult, type ProviderPullRequestSearchResult, type ProviderReference, type ProviderRepositoriesInput, type ProviderRepositoryInput, type ProviderRepositoryShape, type ProviderResult, type ProviderSweepResult, type ProviderSweepTarget, type ProviderSweepTargetEvent, type ProviderSweepTargetRef, type ProviderWarning, type ProviderWarningCause, type ProviderWarningCauseReason, type ProviderWarningKind, type ProviderWarningOmission, type ProviderWarningOmissionKind, type ProviderWarningOmissionRecovery, type ProviderWarningOmissionScope, type ProviderWarningScope, type ProviderWarningSelector, type ProviderWarningUnreadableItems, type PullRequestActivityAuthor, type PullRequestActivityComment, type PullRequestActivityItem, type PullRequestActivityResult, type PullRequestActivityReview, type PullRequestActivityReviewComment, type PullRequestActivityTarget, type PullRequestBatchResult, type PullRequestBatchTarget, type PullRequestBranchResult, type PullRequestBranchTarget, type PullRequestCheckLogResult, type PullRequestCheckLogTarget, type PullRequestCountResult, type PullRequestCountScope, type PullRequestCreateCapabilityOptions, type PullRequestCreateCapabilityResult, type PullRequestEntityIdentifierInput, type PullRequestEtagInclude, type PullRequestFieldGroup, PullRequestFilter, type PullRequestForCommitResult, type PullRequestProjection, type PullRequestSearchCapabilities, type PullRequestSearchCriteria, type PullRequestStateFilter, type PullRequestSweepOptions, type PullRequestWriteFailure, type PullRequestWriteOptions, type PullRequestWriteResult, type PullRequestWriteSnapshot, type PullRequestWriteTargetOptions, type PullRequestWriteTargetResult, type RefSet, type RepositoriesProvider, type RepositoryIdentity, type RepositoryResolution, type RepositoryResolutionStatus, type ResolveRepositoryResult, type SearchMyPullRequestsOptions, type SearchPullRequestsOptions, type Source, type Sources, type SupportedCloudIntegrationIds, type TokenInfo, type WorkItemAddress, type WorkItemCreateOptions, type WorkItemCreateOptionsResult, type WorkItemDeleteCapability, type WorkItemDeleteOptions, type WorkItemDeleteResult, type WorkItemDeleteTargetChanged, type WorkItemDeletion, type WorkItemReceipt, type WorkItemState, type WorkItemWriteContext, type WorkItemWriteField, type WorkItemWriteOptions, type WorkItemWriteOptionsResult, type WorkItemWriteResult, type WorkItemWriteScope, type WorkItemWriteTargetOptions, type WorkItemWriteTargetResult, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
115
57
  //# sourceMappingURL=index.d.ts.map
@@ -1,70 +1,24 @@
1
- import { CacheController } from "../../utils/promiseCache.js";
2
1
  import { PullRequestFilter } from "../../git/models/pullRequest.js";
3
2
  import { LookupBackedOffError } from "./errors.js";
4
3
  import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, isIntegrationId, isSupportedCloudIntegrationId } from "./constants.js";
5
4
  import { isAzureProviderId } from "./providers/providerErrors.js";
6
- import { getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
7
5
  import { IssueFilter } from "./providerFilters.js";
8
6
  import { providersMetadata, supportsCodeSuggest } from "./providers/metadata.js";
9
7
  import { areDomainsOnSameHost, getSingleConfiguredDomain, hostFromDomain } from "./utils/domain.utils.js";
10
8
  import { convertRemoteProviderIdToIntegrationId, getIntegrationConnectedKey, getIntegrationIdForRemote, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isIssuesHostIntegrationId, isSelfManagedHostIntegrationId } from "./utils/integration.utils.js";
11
9
  import { toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo } from "./authentication/models.js";
10
+ import { getIssueFieldPresence, getPullRequestFieldPresence } from "./fieldPresence.js";
12
11
  import { ActionablePullRequestBuildStatusState, ActionablePullRequestReviewState } from "./models/actionablePullRequest.js";
13
12
  import { getAzureRepositoryIdentity } from "./providers/azure/azure.utils.js";
14
13
  import { isGitHostIntegration, isIntegration, isIssuesIntegration } from "./models/publicIntegration.js";
15
14
  import { createIntegrationService } from "./integrationService.js";
15
+ import { toIntegrationServiceContext } from "./managerContext.js";
16
+ import { GitLabMergeRequestWriter } from "./providers/gitlab/mergeRequestWrites.js";
16
17
  import { createManualTokenAuthProvider } from "./authentication/manualTokenProvider.js";
17
18
  import { EntityIdentifierProviderType, EntityType, EntityVersion, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getEntityIdentifierInput, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier } from "./providers/utils.js";
18
19
  import { isMaybeGitLabPullRequestUrl, splitOwnerAndRepo } from "./providers/gitlab/gitlab.utils.js";
19
20
  import { getActionablePullRequests, toActionablePullRequestInput } from "./providers/actionablePullRequests.js";
20
21
  //#region ../plus/integrations/src/index.ts
21
- function loadUncached(loader) {
22
- return loader(new CacheController()).value;
23
- }
24
- function toCacheDescriptor(integration) {
25
- if (integration == null) return void 0;
26
- return {
27
- id: integration.id,
28
- domain: integration.domain,
29
- ...integration.installationOrigin != null && { installationOrigin: integration.installationOrigin },
30
- get maybeConnected() {
31
- return integration.maybeConnected;
32
- },
33
- get sessionFingerprint() {
34
- return integration.sessionFingerprint;
35
- }
36
- };
37
- }
38
- const uncachedIntegrationCacheProvider = {
39
- getRepositoryMetadata: (_repo, _integration, loader) => loadUncached(loader),
40
- getRepositoryDefaultBranch: (_repo, _integration, loader) => loadUncached(loader),
41
- getPullRequestForSha: (_sha, _repo, _integration, loader) => loadUncached(loader),
42
- getPullRequestForBranch: (_branch, _repo, _integration, loader) => loadUncached(loader),
43
- getPullRequest: (_id, _resource, _integration, loader) => loadUncached(loader),
44
- getIssueOrPullRequest: (_id, _type, _resource, _integration, loader) => loadUncached(loader),
45
- getIssue: (_id, _resource, _integration, loader) => loadUncached(loader),
46
- getCurrentAccount: (_integration, loader) => loadUncached(loader),
47
- deletePullRequests: () => {}
48
- };
49
- /**
50
- * Adapts the consumer's cache to the internal one: each lookup the consumer supplies is called on `cache` itself (never
51
- * spread or detached, which would lose a class instance's prototype methods and `this`), and every other lookup runs
52
- * uncached.
53
- */
54
- function toIntegrationCacheProvider(cache) {
55
- if (cache == null) return uncachedIntegrationCacheProvider;
56
- return {
57
- getRepositoryMetadata: (repo, integration, loader, options) => cache.getRepositoryMetadata != null ? cache.getRepositoryMetadata(repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
58
- getRepositoryDefaultBranch: (repo, integration, loader, options) => cache.getRepositoryDefaultBranch != null ? cache.getRepositoryDefaultBranch(repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
59
- getPullRequestForSha: (sha, repo, integration, loader, options) => cache.getPullRequestForSha != null ? cache.getPullRequestForSha(sha, repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
60
- getPullRequestForBranch: (branch, repo, integration, loader, options) => cache.getPullRequestForBranch != null ? cache.getPullRequestForBranch(branch, repo, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
61
- getPullRequest: (id, resource, integration, loader, options) => cache.getPullRequest != null ? cache.getPullRequest(id, resource, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
62
- getIssueOrPullRequest: (id, type, resource, integration, loader, options) => cache.getIssueOrPullRequest != null ? cache.getIssueOrPullRequest(id, type, resource, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
63
- getIssue: (id, resource, integration, loader, options) => cache.getIssue != null ? cache.getIssue(id, resource, toCacheDescriptor(integration), loader, options) : loadUncached(loader),
64
- getCurrentAccount: (integration, loader, options) => cache.getCurrentAccount(toCacheDescriptor(integration), loader, options),
65
- deletePullRequests: (scope) => cache.deletePullRequests?.(scope)
66
- };
67
- }
68
22
  /**
69
23
  * Construct an `@gitkraken/core-gitlens/plus/integrations` manager bound to the supplied runtime.
70
24
  *
@@ -78,10 +32,7 @@ function toIntegrationCacheProvider(cache) {
78
32
  * own VS Code subscriptions.
79
33
  */
80
34
  function createIntegrationManager(ctx) {
81
- return createIntegrationService({
82
- ...ctx,
83
- cache: toIntegrationCacheProvider(ctx.cache)
84
- });
35
+ return createIntegrationService(toIntegrationServiceContext(ctx), (transport) => new GitLabMergeRequestWriter(transport));
85
36
  }
86
37
  //#endregion
87
38
  export { ActionablePullRequestBuildStatusState, ActionablePullRequestReviewState, EntityIdentifierProviderType, EntityType, EntityVersion, GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssueFilter, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, LookupBackedOffError, PullRequestFilter, areDomainsOnSameHost, convertRemoteProviderIdToIntegrationId, createIntegrationManager, createManualTokenAuthProvider, decodeEntityIdentifier, decodeEntityIdentifiersFromGitConfig, encodeEntityIdentifier, encodeIssueOrPullRequestForGitConfig, getActionablePullRequests, getAzureRepositoryIdentity, getEntityIdentifierInput, getIntegrationConnectedKey, getIntegrationIdForRemote, getIssueFieldPresence, getIssueFromGitConfigEntityIdentifier, getIssueOwner, getProviderIdFromEntityIdentifier, getPullRequestFieldPresence, getSingleConfiguredDomain, hostFromDomain, isAzureProviderId, isCloudGitSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitHostIntegration, isGitSelfManagedHostIntegrationId, isIntegration, isIntegrationId, isIssuesHostIntegrationId, isIssuesIntegration, isMaybeGitLabPullRequestUrl, isSelfManagedHostIntegrationId, isSupportedCloudIntegrationId, providersMetadata, splitOwnerAndRepo, supportsCodeSuggest, toActionablePullRequestInput, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };